Open vzakhari opened 5 months ago
Is this possibly the same issue as https://github.com/llvm/llvm-project/issues/93401?
I am not sure about this. The __divtc3
implementation does rely on FP division (i.e. __divtf3
), but it is a bit more than just FP division. One will have to check if resolving https://github.com/llvm/llvm-project/issues/93401 resolves this issue as well.
I am getting quite incorrect result for
_Complex __float128
division with clang 17.0.6. GCC 13.2.0 version returns closer result.I used libquadmath for printing the results. Here is a reproducer:
Compilation with
clang testdiv.c -I ${GCC_INSTALL}/lib/gcc/x86_64-pc-linux-gnu/13.2.0/include ${GCC_INSTALL}/lib64/libquadmath.a -lm --gcc-toolchain=${GCC_INSTALL}
:This is close to the correct mathematical result: https://www.wolframalpha.com/input?i=%284.181214e%2B4931+-1.113838e%2B4932i%29%2F%28-1.113838e%2B4932+-4.181214e%2B4931i%29
When I link the builtins library with
clang testdiv.c -I ${GCC_INSTALL}/lib/gcc/x86_64-pc-linux-gnu/13.2.0/include ${GCC_INSTALL}/lib64/libquadmath.a -lm ${CLANG_INSTALL}/lib/clang/17/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a --gcc-toolchain=${GCC_INSTALL}
I get this: