diff options
author | James Greenhalgh <james.greenhalgh@arm.com> | 2016-11-25 09:25:31 +0000 |
---|---|---|
committer | James Greenhalgh <jgreenhalgh@gcc.gnu.org> | 2016-11-25 09:25:31 +0000 |
commit | 2dbe91cff11ddb92c27ca79c49c111941205c91f (patch) | |
tree | 08ab74096a44e91d69aa702943f8f9a31f23fc6c /gcc/config/i386/i386.c | |
parent | 5bcfb22cf6bea2ad30b4d31a14c94bce374c817b (diff) | |
download | gcc-2dbe91cff11ddb92c27ca79c49c111941205c91f.zip gcc-2dbe91cff11ddb92c27ca79c49c111941205c91f.tar.gz gcc-2dbe91cff11ddb92c27ca79c49c111941205c91f.tar.bz2 |
[Patch i386] PR78509 - TARGET_C_EXCESS_PRECISION should not return
"unpredictable" for EXCESS_PRECISION_TYPE_STANDARD
gcc/
PR target/78509
* config/i386/i386.c (i386_excess_precision): Do not return
FLT_EVAL_METHOD_UNPREDICTABLE when "type" is
EXCESS_PRECISION_TYPE_STANDARD.
* target.def (excess_precision): Document that targets should
not return FLT_EVAL_METHOD_UNPREDICTABLE when "type" is
EXCESS_PRECISION_TYPE_STANDARD or EXCESS_PRECISION_TYPE_FAST.
Fix typo in first sentence.
* doc/tm.texi: Regenerate.
From-SVN: r242866
Diffstat (limited to 'gcc/config/i386/i386.c')
-rw-r--r-- | gcc/config/i386/i386.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 0e8dda9..a96d597 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -51039,17 +51039,26 @@ ix86_excess_precision (enum excess_precision_type type) case EXCESS_PRECISION_TYPE_IMPLICIT: /* Otherwise, the excess precision we want when we are in a standards compliant mode, and the implicit precision we - provide can be identical. */ + provide would be identical were it not for the unpredictable + cases. */ if (!TARGET_80387) return FLT_EVAL_METHOD_PROMOTE_TO_FLOAT; - else if (TARGET_MIX_SSE_I387) - return FLT_EVAL_METHOD_UNPREDICTABLE; - else if (!TARGET_SSE_MATH) - return FLT_EVAL_METHOD_PROMOTE_TO_LONG_DOUBLE; - else if (TARGET_SSE2) - return FLT_EVAL_METHOD_PROMOTE_TO_FLOAT; - else - return FLT_EVAL_METHOD_UNPREDICTABLE; + else if (!TARGET_MIX_SSE_I387) + { + if (!TARGET_SSE_MATH) + return FLT_EVAL_METHOD_PROMOTE_TO_LONG_DOUBLE; + else if (TARGET_SSE2) + return FLT_EVAL_METHOD_PROMOTE_TO_FLOAT; + } + + /* If we are in standards compliant mode, but we know we will + calculate in unpredictable precision, return + FLT_EVAL_METHOD_FLOAT. There is no reason to introduce explicit + excess precision if the target can't guarantee it will honor + it. */ + return (type == EXCESS_PRECISION_TYPE_STANDARD + ? FLT_EVAL_METHOD_PROMOTE_TO_FLOAT + : FLT_EVAL_METHOD_UNPREDICTABLE); default: gcc_unreachable (); } |