on master help sign in
Merge pull request #4554 from imuli/javascript-right-shift

javascript backend: fix logical right shifts

commit80293ba0f8dbbbf3675747fbcbccbee92a696573 authorNiklas Larsson <metaniklas@gmail.com> dateSat 8 Sep 2018, 11:04 (8 years ago) parentfc34924f5085b9
1 file changed+4−4
src/IRTS/JavaScript/PrimOp.hs+4−4
src/IRTS/JavaScript/PrimOp.hs+4−4
@@ -103,10 +103,10 @@ primDB =
103103 , item (LSHL (ITFixed IT64)) True PTAny $
104104 \[l, r] -> JsForeign "%0.shiftLeft(%1).and(new $JSRTS.jsbn.BigInteger(%2))" [l,r, JsStr $ show 0xFFFFFFFFFFFFFFFF]
105105 , item (LSHL ITBig) True PTAny $ method "shiftLeft"
106− , item (LLSHR ITNative) False PTAny $ JsForeign "%0 >> %1 |0"
107− , item (LLSHR (ITFixed IT8)) False PTAny $ JsForeign "%0 >> %1"
108− , item (LLSHR (ITFixed IT16)) False PTAny $ JsForeign "%0 >> %1"
109− , item (LLSHR (ITFixed IT32)) False PTAny $ JsForeign "%0 >> %1|0"
106+ , item (LLSHR ITNative) False PTAny $ JsForeign "%0 >>> %1 |0"
107+ , item (LLSHR (ITFixed IT8)) False PTAny $ JsForeign "%0 >>> %1"
108+ , item (LLSHR (ITFixed IT16)) False PTAny $ JsForeign "%0 >>> %1"
109+ , item (LLSHR (ITFixed IT32)) False PTAny $ JsForeign "%0 >>> %1|0"
110110 , item (LLSHR (ITFixed IT64)) True PTAny $ JsForeign "%0.shiftRight(%1)"
111111 , item (LASHR ITNative) False PTAny $ JsForeign "%0 >> %1 |0"
112112 , item (LASHR (ITFixed IT8)) False PTAny $ JsForeign "%0 >> %1"