Switch signed/unsigned instructions when upcasting 32- to 64-bit integers, fixes #247

Matches C semantics now. Turns around some instructions in tests, especially libm, but doesn't break anything.
This commit is contained in:
dcodeIO
2018-09-10 14:25:33 +02:00
parent 9603c13fb7
commit 6949cf9f9e
17 changed files with 231 additions and 96 deletions

View File

@ -226,7 +226,7 @@
(f64.reinterpret/i64
(i64.shl
(i64.add
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $1)
)
(i64.const 1023)
@ -5448,7 +5448,7 @@
(f64.reinterpret/i64
(i64.shl
(i64.add
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $2)
)
(i64.const 1023)
@ -5515,7 +5515,7 @@
(i64.shl
(i64.sub
(i64.const 1023)
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $2)
)
)
@ -8705,7 +8705,7 @@
)
(i64.shl
(get_local $2)
(i64.extend_u/i32
(i64.extend_s/i32
(i32.sub
(i32.const 1)
(get_local $3)
@ -8761,7 +8761,7 @@
)
(i64.shl
(get_local $5)
(i64.extend_u/i32
(i64.extend_s/i32
(i32.sub
(i32.const 1)
(get_local $6)
@ -8882,7 +8882,7 @@
(i64.const 4503599627370496)
)
(i64.shl
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $3)
)
(i64.const 52)
@ -8890,7 +8890,7 @@
)
(i64.shr_u
(get_local $2)
(i64.extend_u/i32
(i64.extend_s/i32
(i32.sub
(i32.const 1)
(get_local $3)
@ -8900,7 +8900,7 @@
)
)
(i64.shl
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $8)
)
(i64.const 63)
@ -10054,7 +10054,7 @@
(i64.const 4294967295)
)
(i64.shl
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $5)
)
(i64.const 32)
@ -10089,7 +10089,7 @@
(tee_local $3
(f64.reinterpret/i64
(i64.shl
(i64.extend_u/i32
(i64.extend_s/i32
(i32.add
(i32.add
(i32.or
@ -10498,7 +10498,7 @@
(set_local $3
(f64.reinterpret/i64
(i64.shl
(i64.extend_u/i32
(i64.extend_s/i32
(i32.and
(get_local $7)
(i32.xor
@ -10700,7 +10700,7 @@
(i64.const 4294967295)
)
(i64.shl
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $8)
)
(i64.const 32)
@ -12598,7 +12598,7 @@
)
(i64.shl
(get_local $2)
(i64.extend_u/i32
(i64.extend_s/i32
(i32.sub
(i32.const 1)
(get_local $3)
@ -12653,7 +12653,7 @@
)
(i64.shl
(get_local $7)
(i64.extend_u/i32
(i64.extend_s/i32
(i32.sub
(i32.const 1)
(get_local $6)
@ -12813,7 +12813,7 @@
(i64.const 4503599627370496)
)
(i64.shl
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $3)
)
(i64.const 52)
@ -12821,7 +12821,7 @@
)
(i64.shr_u
(get_local $2)
(i64.extend_u/i32
(i64.extend_s/i32
(i32.sub
(i32.const 1)
(get_local $3)