glibc/sysdeps/x86
Adhemerval Zanella 5011210399 x86: Do not use __builtin_fpclassify for _Float64x/long double
Neither gcc [1] nor clang [2] handles pseudo-normal numbers correctly
with the __builtin_fpclassify, so disable its usage for _Float64x and
long double types.

This only affects x86, so add a new header, fp-builtin-denormal.h, that
defines whether the architecture requires disabling the optimization
through a new glibc define (__FP_BUILTIN_FPCLASSIFY_DENORMAL).

It fixes the regression on test-ldouble-fpclassify and
test-float64x-fpclassify when built with clang:

Failure: fpclassify (pseudo_zero): Exception "Invalid operation" set
Failure: fpclassify (pseudo_inf): Exception "Invalid operation" set
Failure: fpclassify (pseudo_qnan): Exception "Invalid operation" set
Failure: fpclassify (pseudo_snan): Exception "Invalid operation" set
Failure: fpclassify (pseudo_unnormal): Exception "Invalid operation" set
Failure: fpclassify_downward (pseudo_zero): Exception "Invalid operation" set
Failure: fpclassify_downward (pseudo_inf): Exception "Invalid operation" set
Failure: fpclassify_downward (pseudo_qnan): Exception "Invalid operation" set
Failure: fpclassify_downward (pseudo_snan): Exception "Invalid operation" set
Failure: fpclassify_downward (pseudo_unnormal): Exception "Invalid operation" set
Failure: fpclassify_towardzero (pseudo_zero): Exception "Invalid operation" set
Failure: fpclassify_towardzero (pseudo_inf): Exception "Invalid operation" set
Failure: fpclassify_towardzero (pseudo_qnan): Exception "Invalid operation" set
Failure: fpclassify_towardzero (pseudo_snan): Exception "Invalid operation" set
Failure: fpclassify_towardzero (pseudo_unnormal): Exception "Invalid operation" set
Failure: fpclassify_upward (pseudo_zero): Exception "Invalid operation" set
Failure: fpclassify_upward (pseudo_inf): Exception "Invalid operation" set
Failure: fpclassify_upward (pseudo_qnan): Exception "Invalid operation" set
Failure: fpclassify_upward (pseudo_snan): Exception "Invalid operation" set
Failure: fpclassify_upward (pseudo_unnormal): Exception "Invalid operation" set

Checked on x86_64-linux-gnu with gcc-15 and clang-18.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123161
[2] https://github.com/llvm/llvm-project/issues/172533

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-12-22 15:55:16 -03:00
..
bits x86: Do not use __builtin_fpclassify for _Float64x/long double 2025-12-22 15:55:16 -03:00
fpu x86: Do not use __builtin_fpclassify for _Float64x/long double 2025-12-22 15:55:16 -03:00
htl Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
include x86: Use separate variable for TLSDESC XSAVE/XSAVEC state size (bug 32810) 2025-03-29 09:17:38 +01:00
nptl Remove support for lock elision. 2025-11-18 14:21:13 +01:00
sys/platform Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
Makeconfig
Makefile x86: Set have-protected-data to no if unsupported 2025-08-22 17:55:32 -07:00
Versions i386: Also add GLIBC_ABI_GNU2_TLS version [BZ #33129] 2025-08-18 11:58:01 -07:00
__longjmp_cancel.S Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
abi-note.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
atomic-machine.h atomic: Reinstate HAVE_64B_ATOMICS configure check 2025-12-17 22:57:00 +00:00
cacheinfo.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
cacheinfo.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
configure i386: Fix fmod/fmodf/remainder/remainderf for gcc-12 2025-12-04 13:12:50 -03:00
configure.ac i386: Fix fmod/fmodf/remainder/remainderf for gcc-12 2025-12-04 13:12:50 -03:00
cpu-features-offsets.sym
cpu-features.c Set Prefer_No_AVX512 flag for hygon platform 2025-11-11 10:47:26 +08:00
cpu-tunables.c Fix typo in comment 2025-03-31 10:54:52 -03:00
dl-cacheinfo.h x86: Include <bits/stdlib-bsearch.h> in dl-cacheinfo.h 2025-09-08 20:31:36 -07:00
dl-diagnostics-cpu.c x86: Use separate variable for TLSDESC XSAVE/XSAVEC state size (bug 32810) 2025-03-29 09:17:38 +01:00
dl-get-cpu-features.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
dl-hwcap.h Remove dl-procinfo.h 2025-03-05 11:22:09 -03:00
dl-hwcap2.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
dl-isa-level.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
dl-lookupcfg.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
dl-minsigstacksize.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
dl-new-hash.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
dl-procinfo.c Remove unused dl-procinfo.h 2025-02-28 16:55:18 +00:00
dl-prop.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
dl-tunables.list Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
elf-initfini.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
features-offsets.sym
float128-abi.h
fpu_control.h x86: Restore "*&" GCC asm memory operand workaround to installed fpu-control.h 2025-09-24 08:04:41 +02:00
get-cpuid-feature-leaf.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
get-isa-level.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
gmp-arch.h stdlib: Remove longlong.h 2025-11-26 10:10:06 -03:00
hp-timing.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
init-arch.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
isa-ifunc-macros.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
isa-level.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
isa-level.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
jmp_buf-ssp.sym
ldbl2mpn.c stdlib: Remove longlong.h 2025-11-26 10:10:06 -03:00
ldsodefs.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
libc-start.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
link_map.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
linkmap.h
longjmp.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
readelflib.c Cleanup some recently added whitespace. 2025-10-30 18:56:58 -07:00
sysdep.h i386: Update ___tls_get_addr to preserve vector registers 2025-06-19 04:30:31 +08:00
tininess.h
tst-cpu-features-cpuinfo-static.c
tst-cpu-features-cpuinfo.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-cpu-features-supports-static.c
tst-cpu-features-supports.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-get-cpu-features-static.c
tst-get-cpu-features.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-gnu2-tls2-x86-noxsave.c x86: Update tst-gnu2-tls2 tests 2025-06-19 05:46:31 +08:00
tst-gnu2-tls2-x86-noxsavec.c x86: Update tst-gnu2-tls2 tests 2025-06-19 05:46:31 +08:00
tst-gnu2-tls2-x86-noxsavexsavec.c x86: Update tst-gnu2-tls2 tests 2025-06-19 05:46:31 +08:00
tst-gnu2-tls2.c x86: Update tst-gnu2-tls2 tests 2025-06-19 05:46:31 +08:00
tst-gnu2-tls2.h x86: Update tst-gnu2-tls2 tests 2025-06-19 05:46:31 +08:00
tst-hwcap-tunables.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-ifunc-isa-1-static.c
tst-ifunc-isa-1.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-ifunc-isa-2-static.c
tst-ifunc-isa-2.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-ifunc-isa.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-isa-level-1.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-isa-level-mod-1-baseline.c
tst-isa-level-mod-1-v2.c
tst-isa-level-mod-1-v3.c
tst-isa-level-mod-1-v4.c
tst-isa-level-mod-1.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-ldbl-nonnormal-printf.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-memchr-rtm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-memcmp-rtm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-memmove-rtm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-memrchr-rtm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-memset-rtm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-setjmp-cet.c
tst-stack-align.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-strcasecmp-rtm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-strchr-rtm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-strcmp-rtm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-strcpy-rtm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-string-rtm.h x86: Increase allowable TSX abort rate to 6%. 2025-11-14 08:18:36 -05:00
tst-strlen-rtm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-strncasecmp-rtm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-strncmp-rtm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-strrchr-rtm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-sysconf-cache-linesize-static.c
tst-sysconf-cache-linesize.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-tls23.c i386: Update ___tls_get_addr to preserve vector registers 2025-06-19 04:30:31 +08:00
tst-tls23.h i386: Update ___tls_get_addr to preserve vector registers 2025-06-19 04:30:31 +08:00
tst-wcscmp-rtm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
tst-wcsncmp-rtm.c Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
utmp-size.h