aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 774293d0..bc83e4ea 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -931,10 +931,17 @@ function processMathop(item) { with(item) {
}
}
*/
+ if (bits > 32) return ident1 + '*Math.pow(2,' + ident2 + ')';
return ident1 + ' << ' + ident2;
}
- case 'ashr': return ident1 + ' >> ' + ident2;
- case 'lshr': return ident1 + ' >>> ' + ident2;
+ case 'ashr': {
+ if (bits > 32) return ident1 + '/Math.pow(2,' + ident2 + ')';
+ return ident1 + ' >> ' + ident2;
+ }
+ case 'lshr': {
+ if (bits > 32) return ident1 + '/Math.pow(2,' + ident2 + ')';
+ return ident1 + ' >>> ' + ident2;
+ }
// basic float ops
case 'fadd': return ident1 + ' + ' + ident2;
case 'fsub': return ident1 + ' - ' + ident2;