[X86][clang] 128bit floating-point operations in x86 machines · Issue #77401 · llvm/llvm-project (original) (raw)

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
Fail2

compile in x86_64 will return normally, but x86 output Fail.
https://godbolt.org/z/vhdsMhd8d