diff mbox

[8/11] Make _Float16 available if HFmode is available

Message ID 1475254617-10825-6-git-send-email-james.greenhalgh@arm.com
State New
Headers show

Commit Message

James Greenhalgh Sept. 30, 2016, 4:56 p.m. UTC
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.

OK?

Thanks,
James

---
2016-09-30  James Greenhalgh  <james.greenhalgh@arm.com>

	* targhooks.c (default_floatn_mode): Enable _Float16 if a target
	provides HFmode.

Comments

Jeff Law Sept. 30, 2016, 5:29 p.m. UTC | #1
On 09/30/2016 10:56 AM, James Greenhalgh wrote:
>
> 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.
>
> OK?
>
> Thanks,
> James
>
> ---
> 2016-09-30  James Greenhalgh  <james.greenhalgh@arm.com>
>
> 	* targhooks.c (default_floatn_mode): Enable _Float16 if a target
> 	provides HFmode.
OK when prereqs are approved.

jeff
diff mbox

Patch

diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 08d0b35..bf94b2a 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -513,10 +513,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: