Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[builtins] Missing __extendhfxf2 and __truncxfhf2 #105181

Open
overmighty opened this issue Aug 20, 2024 · 0 comments · Fixed by #113897 · May be fixed by #120372
Open

[builtins] Missing __extendhfxf2 and __truncxfhf2 #105181

overmighty opened this issue Aug 20, 2024 · 0 comments · Fixed by #113897 · May be fixed by #120372

Comments

@overmighty
Copy link
Member

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

lntue pushed a commit that referenced this issue Oct 1, 2024
Issue: #105181
extendhfxf2 calls extendhfXfy to convert _Float16 to double, then type
casts this converted value to long double.
__uint128_t may not be available on all architectures. Thus I din't use
extendhfXfy to widen precision to 128 bits.
VitaNuo pushed a commit to VitaNuo/llvm-project that referenced this issue Oct 2, 2024
Issue: llvm#105181
extendhfxf2 calls extendhfXfy to convert _Float16 to double, then type
casts this converted value to long double.
__uint128_t may not be available on all architectures. Thus I din't use
extendhfXfy to widen precision to 128 bits.
VitaNuo pushed a commit to VitaNuo/llvm-project that referenced this issue Oct 2, 2024
Issue: llvm#105181
extendhfxf2 calls extendhfXfy to convert _Float16 to double, then type
casts this converted value to long double.
__uint128_t may not be available on all architectures. Thus I din't use
extendhfXfy to widen precision to 128 bits.
Sterling-Augustine pushed a commit to Sterling-Augustine/llvm-project that referenced this issue Oct 3, 2024
Issue: llvm#105181
extendhfxf2 calls extendhfXfy to convert _Float16 to double, then type
casts this converted value to long double.
__uint128_t may not be available on all architectures. Thus I din't use
extendhfXfy to widen precision to 128 bits.
xgupta pushed a commit to xgupta/llvm-project that referenced this issue Oct 4, 2024
Issue: llvm#105181
extendhfxf2 calls extendhfXfy to convert _Float16 to double, then type
casts this converted value to long double.
__uint128_t may not be available on all architectures. Thus I din't use
extendhfXfy to widen precision to 128 bits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant