[PATCH] [ARC] Add builtins for identifying floating point support
authorVineet Gupta <vgupta@synopsys.com>
Wed, 6 Nov 2019 12:28:25 +0000 (12:28 +0000)
committerClaudiu Zissulescu <claziss@gcc.gnu.org>
Wed, 6 Nov 2019 12:28:25 +0000 (13:28 +0100)
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__

From-SVN: r277878

gcc/ChangeLog
gcc/config/arc/arc-c.c

index e74c57aaf13a8e657021ffa6555c649b03c37c7f..6c33a80cec7761d4b297cf07eac81a201ea15ed4 100644 (file)
@@ -1,3 +1,9 @@
+2019-11-06  Vineet Gupta  <vgupta@synopsys.com>
+
+       * config/arc/arc-c.c (arc_cpu_cpp_builtins) : Add
+       __arc_hard_float__, __ARC_HARD_FLOAT__,
+       __arc_soft_float__, __ARC_SOFT_FLOAT__
+
 2019-11-06  Andre Vieira  <andre.simoesdiasvieira@arm.com>
 
        PR tree-optimization/92317
index cf3340d29c273b5fe806ea3fbd221dcb2de3a813..1a5ff3e88a67630f443141708215a0f651eba60e 100644 (file)
@@ -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__");
+    }
 }