Repository navigation
[X86][clang] 128bit floating-point operations in x86 machines #77401
Description
Activity
- addedclangClang issues not falling into any other categoryClang issues not falling into any other category
on Jan 9, 2024 - addedfloating-pointFloating-point mathFloating-point mathand removedclangClang issues not falling into any other categoryClang issues not falling into any other category
on Jan 9, 2024 @llvm/issue-subscribers-backend-x86
Author: Longsheng Mou (CoTinker)
Details
testcase:#include <fenv.h> #include <stdlib.h> #include <stdio.h> int main (void) { volatile __float128 a = 0x0.fffp-16382q, b = 0x0.fffp0q, c; c = a / b; if (fetestexcept (FE_UNDERFLOW | FE_INEXACT)) printf("Fail1\n"); if (c != 0x1p-16382q) printf("Fail2\n"); exit (0); }compile command:
% clang test.c -o test -lm -m32 % ./test Fail1 Fail2compile in x86_64 will return normally, but x86 output Fail.
https://godbolt.org/z/vhdsMhd8dTechnically you need to enable FENV_ACCESS for this program
Technically you need to enable FENV_ACCESS for this program
#pragma STDC FENV_ACCESS ON
It seems not work.@arsenm Hi, enable FENV_ACCESS still fail. Does FENV_ACCESS supported in
m32?
https://godbolt.org/z/MsYTe1cPcCC @brad0
https://godbolt.org/z/4KbaWcvsG
I see the asm, clang x86 with
m32abi is not compatible with libgcc.CC @hvdijk
@arsenm Hi, enable FENV_ACCESS still fail. Does FENV_ACCESS supported in
m32? https://godbolt.org/z/MsYTe1cPcI think it should work the same as x64
In fact, not work! I guess float128 (long double) not align to 16 in x86-32.
I'm reading the x86 isel dag->dag pass, maybe lowering mir gets mistake in the step.Do you have any idea about this problem?
It seems a legacy.
https://lists.llvm.org/pipermail/llvm-dev/2016-December/108033.html
Seems no body care about x86-32? @arsenm16 remaining items
- added a commit that references this issue
on Jul 15, 2025 - added a commit that references this issue
on Jul 16, 2025 - added a commit that references this issue
on Jul 17, 2025 - added a commit that references this issue
on Jul 17, 2025 - added a commit that references this issue
on Jul 29, 2025
testcase:
compile command:
compile in x86_64 will return normally, but x86 output Fail.
https://godbolt.org/z/vhdsMhd8d