[Linux/x86] Fix 64 bit shift inconsistencies (#17826)
authorKonstantin Baladurin <k.baladurin@partner.samsung.com>
Sat, 28 Apr 2018 12:22:38 +0000 (15:22 +0300)
committerJan Kotas <jkotas@microsoft.com>
Sat, 28 Apr 2018 12:22:38 +0000 (05:22 -0700)
Apply #15443 and #15949 for Linux/x86

src/vm/i386/jithelp.S

index dd3f804..f74039e 100644 (file)
@@ -441,6 +441,9 @@ LEAF_END JIT_PollGC_Nop, _TEXT
 //
 .align 16
 LEAF_ENTRY JIT_LLsh, _TEXT
+    // Reduce shift amount mod 64
+    and     ecx, 63
+
     cmp     ecx, 32
     jae     LOCAL_LABEL(LLshMORE32)
 
@@ -476,6 +479,9 @@ LEAF_END JIT_LLsh, _TEXT
 //
 .align 16
 LEAF_ENTRY JIT_LRsh, _TEXT
+    // Reduce shift amount mod 64
+    and     ecx, 63
+
     cmp     ecx, 32
     jae     LOCAL_LABEL(LRshMORE32)
 
@@ -510,6 +516,9 @@ LEAF_END JIT_LRsh, _TEXT
 //
 .align 16
 LEAF_ENTRY JIT_LRsz, _TEXT
+    // Reduce shift amount mod 64
+    and     ecx, 63
+
     cmp     ecx, 32
     jae     LOCAL_LABEL(LRszMORE32)