Bug 703531 - Fix ARMAssembler::getOp2RegScale on < ARMv5. r=cdleary
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 08 Dec 2011 09:13:12 +0100
changeset 82240 8cccdec3532b3c4f95bdd317fc6f8b362702d5cb
parent 82239 93bcebfb5d40870f1e3b0cf32954d0e22f83f730
child 82241 647b56f040f1ead84500f9bbdef54551e6be5a42
push id21587
push userbmo@edmorley.co.uk
push dateThu, 08 Dec 2011 15:13:43 +0000
treeherdermozilla-central@98db2311a44c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscdleary
bugs703531
milestone11.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 703531 - Fix ARMAssembler::getOp2RegScale on < ARMv5. r=cdleary
js/src/assembler/assembler/ARMAssembler.cpp
--- a/js/src/assembler/assembler/ARMAssembler.cpp
+++ b/js/src/assembler/assembler/ARMAssembler.cpp
@@ -107,20 +107,20 @@ ARMWord ARMAssembler::getOp2RegScale(Reg
 #if WTF_ARM_ARCH_AT_LEAST(5)
     asm (
     "   clz     %[lz], %[scale]\n"
     : [lz]      "=r"  (lz)
     : [scale]   "r"   (scale)
     : // No clobbers.
     );
 #else
-    ARMWord lz = 0; // Accumulate leading zeroes.
+    lz = 0; // Accumulate leading zeroes.
     for (ARMWord s = 16; s > 0; s /= 2) {
         ARMWord mask = 0xffffffff << (32-lz-s);
-        if ((x & mask) == 0) {
+        if ((scale & mask) == 0) {
             lz += s;
         }
     }
 #endif
     if (lz >= 32) {
         return INVALID_IMM;
     }
     shift = 31-lz;