mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-14 21:10:19 +00:00
56ede9ed59
Bug 20787 reports that, while float_t and double_t for 32-bit x86 properly respect -mfpmath=sse, for x86_64 they fail to reflect -mfpmath=387, which is valid if unusual and results in FLT_EVAL_METHOD being 2. This patch fixes the definitions to respect __FLT_EVAL_METHOD__ in that case, arranging for the test that the types correspond with FLT_EVAL_METHOD to be run with both -mfpmath=387 and -mfpmath=sse. Note: this patch will also have the effect of making float_t and double_t be long double for x86_64 with -mfpmath=sse+387, when FLT_EVAL_METHOD is -1. It seems reasonable for x86_64 to be consistent with 32-bit x86 in this case (and that definition is conservatively safe, in that it makes the types correspond to the widest evaluation format that might be used). Tested for x86-64 and x86. [BZ #20787] * sysdeps/x86/bits/mathdef.h (float_t): Do not define to float if [__x86_64__] when __FLT_EVAL_METHOD__ is nonzero. (double_t): Do not define to double if [__x86_64__] when __FLT_EVAL_METHOD__ is nonzero. * sysdeps/x86/fpu/test-flt-eval-method-387.c: New file. * sysdeps/x86/fpu/test-flt-eval-method-sse.c: Likewise. * sysdeps/x86/fpu/Makefile [$(subdir) = math] (tests): Add test-flt-eval-method-387 and test-flt-eval-method-sse. [$(subdir) = math] (CFLAGS-test-flt-eval-method-387.c): New variable. [$(subdir) = math] (CFLAGS-test-flt-eval-method-sse.c): Likewise.
12 lines
503 B
Makefile
12 lines
503 B
Makefile
ifeq ($(subdir),math)
|
|
libm-support += powl_helper
|
|
tests += test-fenv-sse test-fenv-clear-sse test-fenv-x87 test-fenv-sse-2 \
|
|
test-flt-eval-method-387 test-flt-eval-method-sse
|
|
CFLAGS-test-fenv-sse.c += -msse2 -mfpmath=sse
|
|
CFLAGS-test-fenv-clear-sse.c += -msse2 -mfpmath=sse
|
|
CFLAGS-test-fenv-sse-2.c += -msse2 -mfpmath=sse
|
|
CFLAGS-test-flt-eval-method-387.c += -fexcess-precision=standard -mfpmath=387
|
|
CFLAGS-test-flt-eval-method-sse.c += -fexcess-precision=standard -msse2 \
|
|
-mfpmath=sse
|
|
endif
|