aboutsummaryrefslogtreecommitdiff
path: root/src/analyzer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-19 11:06:23 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-19 11:06:23 -0700
commita00c76524c3e4ffc12eb309459b74c50a3da3ad7 (patch)
tree0c6122cd073bd0582de41c57b4f98d9a84afe16e /src/analyzer.js
parent8cbede32db41ef73f648936109b00df01d9c23bb (diff)
zext sign correction for bitcasting from <32 bits to i64
Diffstat (limited to 'src/analyzer.js')
-rw-r--r--src/analyzer.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index 8ded86f1..1453b22c 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -544,6 +544,10 @@ function analyzer(data, sidePass) {
params: [(signed && j + whole > sourceElements.length) ? signedKeepAlive : null],
type: 'i32',
};
+ if (j == 0 && isUnsignedOp(value.op) && sourceBits < 32) {
+ // zext sign correction
+ result.ident = makeSignOp(result.ident, 'i' + sourceBits, 'un', 1, 1);
+ }
if (fraction != 0) {
var other = {
intertype: 'value',