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

@ -265,7 +265,7 @@
(i64.shl
(i64.add
(i64.const 1023)
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $1)
)
)
@ -6337,7 +6337,7 @@
(i64.shl
(i64.add
(i64.const 1023)
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $3)
)
)
@ -6406,7 +6406,7 @@
(i64.shl
(i64.sub
(i64.const 1023)
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $3)
)
)
@ -10061,7 +10061,7 @@
(set_local $2
(i64.shl
(get_local $2)
(i64.extend_u/i32
(i64.extend_s/i32
(i32.add
(i32.sub
(i32.const 0)
@ -10135,7 +10135,7 @@
(set_local $3
(i64.shl
(get_local $3)
(i64.extend_u/i32
(i64.extend_s/i32
(i32.add
(i32.sub
(i32.const 0)
@ -10301,7 +10301,7 @@
(i64.or
(get_local $2)
(i64.shl
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $4)
)
(i64.const 52)
@ -10312,7 +10312,7 @@
(set_local $2
(i64.shr_u
(get_local $2)
(i64.extend_u/i32
(i64.extend_s/i32
(i32.add
(i32.sub
(i32.const 0)
@ -10328,7 +10328,7 @@
(i64.or
(get_local $2)
(i64.shl
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $6)
)
(i64.const 63)
@ -11614,7 +11614,7 @@
(i64.const 4294967295)
)
(i64.shl
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $7)
)
(i64.const 32)
@ -11666,7 +11666,7 @@
(set_local $30
(f64.reinterpret/i64
(i64.shl
(i64.extend_u/i32
(i64.extend_s/i32
(i32.add
(i32.add
(i32.or
@ -12143,7 +12143,7 @@
(set_local $20
(f64.reinterpret/i64
(i64.shl
(i64.extend_u/i32
(i64.extend_s/i32
(i32.and
(get_local $25)
(i32.xor
@ -12361,7 +12361,7 @@
(i64.const 4294967295)
)
(i64.shl
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $24)
)
(i64.const 32)
@ -14464,7 +14464,7 @@
(set_local $9
(i64.shl
(get_local $9)
(i64.extend_u/i32
(i64.extend_s/i32
(i32.add
(i32.sub
(i32.const 0)
@ -14542,7 +14542,7 @@
(set_local $3
(i64.shl
(get_local $3)
(i64.extend_u/i32
(i64.extend_s/i32
(i32.add
(i32.sub
(i32.const 0)
@ -14749,7 +14749,7 @@
(i64.or
(get_local $9)
(i64.shl
(i64.extend_u/i32
(i64.extend_s/i32
(get_local $4)
)
(i64.const 52)
@ -14760,7 +14760,7 @@
(set_local $9
(i64.shr_u
(get_local $9)
(i64.extend_u/i32
(i64.extend_s/i32
(i32.add
(i32.sub
(i32.const 0)