This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch 8/17] Make _Float16 available if HFmode is available
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: <nd at arm dot com>, <joseph at codesourcery dot com>, <law at redhat dot com>
- Date: Fri, 11 Nov 2016 15:37:25 +0000
- Subject: [Patch 8/17] Make _Float16 available if HFmode is available
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 217.140.96.140) smtp.mailfrom=arm.com; codesourcery.com; dkim=none (message not signed) header.d=none;codesourcery.com; dmarc=bestguesspass action=none header.from=arm.com;
- Nodisclaimer: True
- References: <1475254617-10825-1-git-send-email-james.greenhalgh@arm.com> <1478878647-22547-1-git-send-email-james.greenhalgh@arm.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
---
This patch was approved:
https://gcc.gnu.org/ml/gcc-patches/2016-09/msg02403.html
---
Hi,
Now that we've worked on -fexcess-precision, the comment in targhooks.c
no longer holds. We can now permit _Float16 on any target which provides
HFmode and supports HFmode in libgcc.
Bootstrapped and tested on x86-64, and in series on AArch64.
Thanks,
James
---
2016-11-09 James Greenhalgh <james.greenhalgh@arm.com>
* targhooks.c (default_floatn_mode): Enable _Float16 if a target
provides HFmode.
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: