Revision: 2898
Author: [email protected]
Date: Wed Sep 16 01:48:17 2009
Log: Clean up the ifdefs on ARM.
Ensure that we use ARMv5 instructions on ARMv6 and ARMv7 CPUs.
Review URL: http://codereview.chromium.org/206012
http://code.google.com/p/v8/source/detail?r=2898

Modified:
  /branches/bleeding_edge/src/arm/codegen-arm.cc
  /branches/bleeding_edge/src/arm/constants-arm.h
  /branches/bleeding_edge/src/arm/macro-assembler-arm.cc

=======================================
--- /branches/bleeding_edge/src/arm/codegen-arm.cc      Mon Sep 14 02:00:21 2009
+++ /branches/bleeding_edge/src/arm/codegen-arm.cc      Wed Sep 16 01:48:17 2009
@@ -4335,7 +4335,7 @@
      Register source,
      Register scratch,
      Register zeros) {
-#ifdef __ARM_ARCH_5__
+#ifdef CAN_USE_ARMV5_INSTRUCTIONS
    __ clz(zeros, source);  // This instruction is only supported after ARM5.
  #else
    __ mov(zeros, Operand(0));
=======================================
--- /branches/bleeding_edge/src/arm/constants-arm.h     Wed Sep  9 00:01:20 2009
+++ /branches/bleeding_edge/src/arm/constants-arm.h     Wed Sep 16 01:48:17 2009
@@ -43,10 +43,30 @@
  # define USE_THUMB_INTERWORK 1
  #endif

+#if defined(__ARM_ARCH_5T__) || \
+    defined(__ARM_ARCH_5TE__) || \
+    defined(__ARM_ARCH_6__) || \
+    defined(__ARM_ARCH_7A__) || \
+    defined(__ARM_ARCH_7__)
+# define CAN_USE_ARMV5_INSTRUCTIONS 1
+# define CAN_USE_THUMB_INSTRUCTIONS 1
+#endif
+
+#if defined(__ARM_ARCH_6__) || \
+    defined(__ARM_ARCH_7A__) || \
+    defined(__ARM_ARCH_7__)
+# define CAN_USE_ARMV6_INSTRUCTIONS 1
+#endif
+
+#if defined(__ARM_ARCH_7A__) || \
+    defined(__ARM_ARCH_7__)
+# define CAN_USE_ARMV7_INSTRUCTIONS 1
+#endif
+
  // Simulator should support ARM5 instructions.
  #if !defined(__arm__)
-# define __ARM_ARCH_5__ 1
-# define __ARM_ARCH_5T__ 1
+# define CAN_USE_ARMV5_INSTRUCTIONS 1
+# define CAN_USE_THUMB_INSTRUCTIONS 1
  #endif

  namespace assembler {
=======================================
--- /branches/bleeding_edge/src/arm/macro-assembler-arm.cc      Sun Sep 13  
23:57:24 2009
+++ /branches/bleeding_edge/src/arm/macro-assembler-arm.cc      Wed Sep 16  
01:48:17 2009
@@ -52,21 +52,15 @@


  // We do not support thumb inter-working with an arm architecture not  
supporting
-// the blx instruction (below v5t)
-#if defined(USE_THUMB_INTERWORK)
-#if !defined(__ARM_ARCH_5T__) && \
-  !defined(__ARM_ARCH_5TE__) &&  \
-  !defined(__ARM_ARCH_6__) &&  \
-  !defined(__ARM_ARCH_7A__) &&   \
-  !defined(__ARM_ARCH_7__)
-// add tests for other versions above v5t as required
-#error "for thumb inter-working we require architecture v5t or above"
+// the blx instruction (below v5t).  If you know what CPU you are  
compiling for
+// you can use -march=armv7 or similar.
+#if defined(USE_THUMB_INTERWORK) && !defined(CAN_USE_THUMB_INSTRUCTIONS)
+# error "For thumb inter-working we require an architecture which supports  
blx"
  #endif
-#endif


  // Using blx may yield better code, so use it when required or when  
available
-#if defined(USE_THUMB_INTERWORK) || defined(__ARM_ARCH_5__)
+#if defined(USE_THUMB_INTERWORK) || defined(CAN_USE_ARMV5_INSTRUCTIONS)
  #define USE_BLX 1
  #endif


--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to