aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Greenhalgh <james.greenhalgh@arm.com>2016-11-23 17:25:41 +0000
committerJames Greenhalgh <jgreenhalgh@gcc.gnu.org>2016-11-23 17:25:41 +0000
commit3479b7af5e95a662664dbc0835436fc4d63d9551 (patch)
tree189e92e5419619eb28193e52a7944087be9ff890
parent8f23c89a5fd677301137917b2658e564f770acd5 (diff)
downloadgcc-3479b7af5e95a662664dbc0835436fc4d63d9551.zip
gcc-3479b7af5e95a662664dbc0835436fc4d63d9551.tar.gz
gcc-3479b7af5e95a662664dbc0835436fc4d63d9551.tar.bz2
[Patch 8/17] Make _Float16 available if HFmode is available
gcc/ * targhooks.c (default_floatn_mode): Enable _Float16 if a target provides HFmode. From-SVN: r242778
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/targhooks.c10
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 963f022..5a19b60 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2016-11-23 James Greenhalgh <james.greenhalgh@arm.com>
+ * targhooks.c (default_floatn_mode): Enable _Float16 if a target
+ provides HFmode.
+
+2016-11-23 James Greenhalgh <james.greenhalgh@arm.com>
+
* config/s390/s390.h (TARGET_FLT_EVAL_METHOD): Delete.
* config/m68k/m68k.h (TARGET_FLT_EVAL_METHOD): Delete.
* config/i386/i386.h (TARGET_FLT_EVAL_METHOD): Delete.
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 73e1c25..a80b301 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -514,10 +514,12 @@ default_floatn_mode (int n, bool extended)
switch (n)
{
case 16:
- /* We do not use HFmode for _Float16 by default because the
- required excess precision support is not present and the
- interactions with promotion of the older __fp16 need to
- be worked out. */
+ /* Always enable _Float16 if we have basic support for the mode.
+ Targets can control the range and precision of operations on
+ the _Float16 type using TARGET_C_EXCESS_PRECISION. */
+#ifdef HAVE_HFmode
+ cand = HFmode;
+#endif
break;
case 32: