Skip to contentSkip to conversation

Add builtins for identifying floating point support

PATCH In review Vineet Gupta 2 participants 2 messages Nov 5, 2019 – Nov 6, 2019 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add builtins for identifying floating point support

Currently for hard float we need to check for
__ARC_FPU_SP__ || __ARC_FPU_DP__ and for soft float inverse of that.
So define single convenience macros for either cases

gcc/
xxxx-xx-xx Vineet Gupta <vgupta@synopsyscom>

	* config/arc/arc-c.c (arc_cpu_cpp_builtins): Add
          __arc_hard_float__, __ARC_HARD_FLOAT__,
          __arc_soft_float__, __ARC_SOFT_FLOAT__
---
 gcc/ChangeLog          |  6 ++++++
 gcc/config/arc/arc-c.c | 10 ++++++++++
 2 files changed, 16 insertions(+)
gcc/ChangeLog +6 -0
index f3deffc701ff..9237e81aa011 100644
@@ -1,3 +1,9 @@
+2019-11-05  Vineet Gupta  <[email protected]>
+
+	* config/arc/arc-c.c (arc_cpu_cpp_builtins) : Add
+	__arc_hard_float__, __ARC_HARD_FLOAT__,
+	__arc_soft_float__, __ARC_SOFT_FLOAT__
+
 2019-11-05  Martin Sebor  <[email protected]>
 
 	PR middle-end/92333
gcc/config/arc/arc-c.c +10 -0
index cf3340d29c27..1a5ff3e88a67 100644
@@ -71,4 +71,14 @@ arc_cpu_cpp_builtins (cpp_reader * pfile)
   if (TARGET_BIG_ENDIAN)
     builtin_define ("__big_endian__");
 
+  if (TARGET_HARD_FLOAT)
+    {
+      builtin_define ("__arc_hard_float__");
+      builtin_define ("__ARC_HARD_FLOAT__");
+    }
+  else
+    {
+      builtin_define ("__arc_soft_float__");
+      builtin_define ("__ARC_SOFT_FLOAT__");
+    }
 }
Signature · 7 lines
2.20.1


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#1 lore raw

Ok, I'll push it asap.

Thank you for your help,
Claudiu

Quoted 52 lines · Vineet Gupta

Currently for hard float we need to check for
__ARC_FPU_SP__ || __ARC_FPU_DP__ and for soft float inverse of that.
So define single convenience macros for either cases

gcc/
xxxx-xx-xx Vineet Gupta <vgupta@synopsyscom>

        * config/arc/arc-c.c (arc_cpu_cpp_builtins): Add
          __arc_hard_float__, __ARC_HARD_FLOAT__,
          __arc_soft_float__, __ARC_SOFT_FLOAT__
---
 gcc/ChangeLog          |  6 ++++++
 gcc/config/arc/arc-c.c | 10 ++++++++++
 2 files changed, 16 insertions(+)
gcc/ChangeLog +6 -0
index f3deffc701ff..9237e81aa011 100644
@@ -1,3 +1,9 @@
+2019-11-05  Vineet Gupta  <[email protected]>
+
+       * config/arc/arc-c.c (arc_cpu_cpp_builtins) : Add
+       __arc_hard_float__, __ARC_HARD_FLOAT__,
+       __arc_soft_float__, __ARC_SOFT_FLOAT__
+
 2019-11-05  Martin Sebor  <[email protected]>
 
        PR middle-end/92333
gcc/config/arc/arc-c.c +10 -1
index cf3340d29c27..1a5ff3e88a67 100644
@@ -71,4 +71,14 @@ arc_cpu_cpp_builtins (cpp_reader * pfile)
   if (TARGET_BIG_ENDIAN)
     builtin_define ("__big_endian__");
 
+  if (TARGET_HARD_FLOAT)
+    {
+      builtin_define ("__arc_hard_float__");
+      builtin_define ("__ARC_HARD_FLOAT__");
+    }
+  else
+    {
+      builtin_define ("__arc_soft_float__");
+      builtin_define ("__ARC_SOFT_FLOAT__");
+    }
 }
--
Quoted 2 lines

2.20.1

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc