glibc/sysdeps
Joseph Myers 56ede9ed59 Fix x86_64 -mfpmath=387 float_t, double_t (bug 20787).
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.
2016-11-23 17:56:31 +00:00
..
aarch64 Regenerate ULPs for aarch64 2016-11-10 16:52:35 +05:30
alpha Fix alpha sqrt fegetenv namespace (bug 20768). 2016-11-04 17:19:13 +00:00
arm nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
generic Refactor some libm type-generic macros. 2016-11-10 21:41:56 +00:00
gnu Define wordsize.h macros everywhere 2016-11-04 09:37:44 -07:00
hppa nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
i386 Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139). 2016-11-04 16:49:06 +00:00
ia64 nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
ieee754 Add setpayload, setpayloadf, setpayloadl. 2016-11-19 00:16:28 +00:00
init_array Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
m68k nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
mach Fix hurd __access_noerrno implementation. 2016-11-18 16:49:08 -02:00
microblaze nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
mips MIPS: Add `.insn' to ensure a text label is defined as code not data 2016-11-18 12:44:04 +00:00
nacl Add setpayload, setpayloadf, setpayloadl. 2016-11-19 00:16:28 +00:00
nios2 nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
nptl Installed-header hygiene (BZ#20366): time.h types. 2016-09-23 08:43:56 -04:00
posix hurd: fix fcntl visibility 2016-09-18 23:48:55 +02:00
powerpc Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139). 2016-11-04 16:49:06 +00:00
pthread Installed-header hygiene (BZ#20366): time.h types. 2016-09-23 08:43:56 -04:00
s390 s390x: Add hidden definition for __sigsetjmp 2016-11-15 15:51:01 +01:00
sh nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
sparc nptl: Document the reason why __kind in pthread_mutex_t is part of the ABI 2016-11-07 20:24:32 +01:00
tile tile: create new math-tests.h header 2016-11-18 13:34:47 -05:00
unix Allow [f]statfs64 to alias [f]statfs 2016-11-22 09:59:12 -08:00
wordsize-32 Define wordsize.h macros everywhere 2016-11-04 09:37:44 -07:00
wordsize-64 Define wordsize.h macros everywhere 2016-11-04 09:37:44 -07:00
x86 Fix x86_64 -mfpmath=387 float_t, double_t (bug 20787). 2016-11-23 17:56:31 +00:00
x86_64 Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139). 2016-11-04 16:49:06 +00:00