Bug 1549667 - [mips] Fix unaligned load with sign/zero extend. r=lth
authorYu Yin <yuyin-hf@loongson.cn>
Fri, 10 May 2019 10:07:37 +0300
changeset 532175 2b44ebc6ee1717f138d801513af4c2e6e50c4087
parent 532174 3c7878ad3840fbf8c2aee6df01f24e8e650f5fc3
child 532176 418adda2c4ce23d9f4f37bc969dc284f1baee287
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslth
bugs1549667
milestone68.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 1549667 - [mips] Fix unaligned load with sign/zero extend. r=lth Reviewers: jandem, lth Reviewed By: lth Subscribers: jandem Bug #: 1549667 Differential Revision: https://phabricator.services.mozilla.com/D30337
js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
--- a/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
+++ b/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
@@ -491,29 +491,29 @@ void MacroAssemblerMIPSShared::ma_load_u
     base = ScratchRegister;
     lowOffset = Imm16(0).encode();
     hiOffset = Imm16(size / 8 - 1).encode();
   }
 
   BufferOffset load;
   switch (size) {
     case SizeHalfWord:
-      if (extension != ZeroExtend) {
+      if (extension == ZeroExtend) {
         load = as_lbu(temp, base, hiOffset);
       } else {
         load = as_lb(temp, base, hiOffset);
       }
       as_lbu(dest, base, lowOffset);
       ma_ins(dest, temp, 8, 24);
       break;
     case SizeWord:
       load = as_lwl(dest, base, hiOffset);
       as_lwr(dest, base, lowOffset);
 #ifdef JS_CODEGEN_MIPS64
-      if (extension != ZeroExtend) {
+      if (extension == ZeroExtend) {
         as_dext(dest, dest, 0, 32);
       }
 #endif
       break;
 #ifdef JS_CODEGEN_MIPS64
     case SizeDouble:
       load = as_ldl(dest, base, hiOffset);
       as_ldr(dest, base, lowOffset);