rs6000-c.c (rs6000_cpu_cpp_builtins): Provide builtin define __VEC_ELEMENT_REG_ORDER__.
authorBill Schmidt <wschmidt@vnet.ibm.com>
Wed, 20 Aug 2014 16:59:45 +0000 (16:59 +0000)
committerWilliam Schmidt <wschmidt@gcc.gnu.org>
Wed, 20 Aug 2014 16:59:45 +0000 (16:59 +0000)
2014-08-20  Bill Schmidt  <wschmidt@vnet.ibm.com>

* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Provide
builtin define __VEC_ELEMENT_REG_ORDER__.

From-SVN: r214236

gcc/ChangeLog
gcc/config/rs6000/rs6000-c.c

index 8f9b113..7742b84 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-20  Bill Schmidt  <wschmidt@vnet.ibm.com>
+
+       * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Provide
+       builtin define __VEC_ELEMENT_REG_ORDER__.
+
 2014-08-20  Martin Jambor  <mjambor@suse.cz>
            Wei Mi  <wmi@google.com>
 
index 2b9cf7a..40a17e2 100644 (file)
@@ -497,6 +497,12 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile)
       break;
     }
 
+  /* Vector element order.  */
+  if (BYTES_BIG_ENDIAN || (rs6000_altivec_element_order == 2))
+    builtin_define ("__VEC_ELEMENT_REG_ORDER__=__ORDER_BIG_ENDIAN__");
+  else
+    builtin_define ("__VEC_ELEMENT_REG_ORDER__=__ORDER_LITTLE_ENDIAN__");
+
   /* Let the compiled code know if 'f' class registers will not be available.  */
   if (TARGET_SOFT_FLOAT || !TARGET_FPRS)
     builtin_define ("__NO_FPRS__");