Skip to content

[builtins] Missing __extendhfxf2 and __truncxfhf2 #105181

@overmighty

Description

@overmighty

These functions convert their argument between _Float16 and x86 80-bit long double.

https://godbolt.org/z/YqWsToYde

C++ code:

long double foo(_Float16 x) {
    return x;
}

Error when running Clang with -rtlib=compiler-rt:

/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../x86_64-linux-gnu/bin/ld: /tmp/example-2fb810.o: undefined reference to symbol '__extendhfxf2@@GCC_12.0.0'
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../x86_64-linux-gnu/bin/ld: /opt/compiler-explorer/gcc-snapshot/lib64/libgcc_s.so.1: error adding symbols: DSO missing from command line
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Compiler returned: 1

C++ code:

_Float16 bar(long double x) {
    return static_cast<_Float16>(x);
}

Error when running Clang with -rtlib=compiler-rt:

/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../x86_64-linux-gnu/bin/ld: /tmp/example-32f526.o: undefined reference to symbol '__truncxfhf2@@GCC_12.0.0'
/opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../x86_64-linux-gnu/bin/ld: /opt/compiler-explorer/gcc-snapshot/lib64/libgcc_s.so.1: error adding symbols: DSO missing from command line
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Compiler returned: 1

cc @lntue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions