glibc/sysdeps/x86/fpu
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
..
bits Add femode_t functions. 2016-09-07 16:40:09 +00:00
include/bits Installed header hygiene (BZ#20366): Test of installed headers. 2016-09-23 08:43:56 -04:00
fix-fp-int-compare-invalid.h Add iseqsig. 2016-10-06 22:19:38 +00:00
Makefile Fix x86_64 -mfpmath=387 float_t, double_t (bug 20787). 2016-11-23 17:56:31 +00:00
powl_helper.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-fenv-clear-sse.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-fenv-sse-2.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-fenv-sse.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-fenv-x87.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
test-flt-eval-method-387.c Fix x86_64 -mfpmath=387 float_t, double_t (bug 20787). 2016-11-23 17:56:31 +00:00
test-flt-eval-method-sse.c Fix x86_64 -mfpmath=387 float_t, double_t (bug 20787). 2016-11-23 17:56:31 +00:00
test-math-vector-sincos.h Fixed wrong vector sincos/sincosf ABI to have it compatible with 2016-07-01 14:15:38 +03:00