Bug 670323 - Fixes for nanojit on ARMv4T. r=jbramley
authorMike Hommey <mh+mozilla@glandium.org>
Sat, 09 Jul 2011 09:56:27 +0200
changeset 77102 cd22ad96188785a55e28ed172c70e1ce867f991a
parent 77101 c5bfe6edc445d9dca60489eaeeae37d09715aaab
child 77103 806abed2a8f77dbaa627688b60647f75c4665af1
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjbramley
bugs670323
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 670323 - Fixes for nanojit on ARMv4T. r=jbramley
js/src/nanojit/NativeARM.cpp
js/src/nanojit/njconfig.cpp
--- a/js/src/nanojit/NativeARM.cpp
+++ b/js/src/nanojit/NativeARM.cpp
@@ -124,20 +124,26 @@ Assembler::CountLeadingZeroes(uint32_t d
 #elif defined(__GNUC__)
     // GCC can use inline assembler to insert a CLZ instruction.
     if (ARM_ARCH_AT_LEAST(5)) {
         __asm (
 #if defined(ANDROID) && (NJ_COMPILER_ARM_ARCH < 7)
         // On Android gcc compiler, the clz instruction is not supported with a
         // target smaller than armv7, despite it being legal for armv5+.
             "   .arch armv7-a\n"
+        // Force the object to be tagged as armv4t to avoid it bumping the final
+        // binary target.
+            "   .object_arch armv4t\n"
 #elif (NJ_COMPILER_ARM_ARCH < 5)
         // Targetting armv5t allows a toolchain with armv4t target to still build
         // with clz, and clz to be used when appropriate at runtime.
             "   .arch armv5t\n"
+        // Force the object file to be tagged as armv4t to avoid it bumping the
+        // final binary target.
+            "   .object_arch armv4t\n"
 #endif
             "   clz     %0, %1  \n"
             :   "=r"    (leading_zeroes)
             :   "r"     (data)
         );
     } else {
         leading_zeroes = CountLeadingZeroesSlow(data);
     }
--- a/js/src/nanojit/njconfig.cpp
+++ b/js/src/nanojit/njconfig.cpp
@@ -91,17 +91,17 @@ namespace nanojit
         i386_sse2 = (features & (1<<26)) != 0;
         i386_use_cmov = (features & (1<<15)) != 0;
         i386_fixed_esp = false;
 #endif
         harden_function_alignment = false;
         harden_nop_insertion = false;
 
 #if defined(NANOJIT_ARM)
-        NanoStaticAssert(NJ_COMPILER_ARM_ARCH >= 5 && NJ_COMPILER_ARM_ARCH <= 7);
+        NanoStaticAssert(NJ_COMPILER_ARM_ARCH >= 4 && NJ_COMPILER_ARM_ARCH <= 7);
         arm_arch = NJ_COMPILER_ARM_ARCH;
         arm_vfp = (arm_arch >= 7);
 
     #if defined(DEBUG) || defined(_DEBUG)
         arm_show_stats = true;
     #else
         arm_show_stats = false;
     #endif