[jit] Trucate the shift amount in the long shift emulation functions to better mirror...
authorZoltan Varga <vargaz@gmail.com>
Wed, 25 Mar 2015 16:39:18 +0000 (12:39 -0400)
committerZoltan Varga <vargaz@gmail.com>
Wed, 25 Mar 2015 16:39:30 +0000 (12:39 -0400)
mono/mini/jit-icalls.c

index 318bd067a4cd5015fb843ac1e46824894b73d959..3328d51bf2d66324c74263aa00dc9607101d910f 100644 (file)
@@ -296,7 +296,7 @@ mono_lshl (guint64 a, gint32 shamt)
 {
        guint64 res;
 
-       res = a << shamt;
+       res = a << (shamt & 0x7f);
 
        /*printf ("TESTL %lld << %d = %lld\n", a, shamt, res);*/
 
@@ -308,7 +308,7 @@ mono_lshr_un (guint64 a, gint32 shamt)
 {
        guint64 res;
 
-       res = a >> shamt;
+       res = a >> (shamt & 0x7f);
 
        /*printf ("TESTR %lld >> %d = %lld\n", a, shamt, res);*/
 
@@ -320,7 +320,7 @@ mono_lshr (gint64 a, gint32 shamt)
 {
        gint64 res;
 
-       res = a >> shamt;
+       res = a >> (shamt & 0x7f);
 
        /*printf ("TESTR %lld >> %d = %lld\n", a, shamt, res);*/