mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-23 03:31:44 +00:00
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:
@ -2683,7 +2683,7 @@
|
||||
(f64.reinterpret/i64
|
||||
(i64.shl
|
||||
(i64.add
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $2)
|
||||
)
|
||||
(i64.const 1023)
|
||||
@ -2750,7 +2750,7 @@
|
||||
(i64.shl
|
||||
(i64.sub
|
||||
(i64.const 1023)
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $2)
|
||||
)
|
||||
)
|
||||
@ -2900,7 +2900,7 @@
|
||||
(f64.reinterpret/i64
|
||||
(i64.shl
|
||||
(i64.add
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $1)
|
||||
)
|
||||
(i64.const 1023)
|
||||
@ -4954,7 +4954,7 @@
|
||||
(i64.const 4294967295)
|
||||
)
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $5)
|
||||
)
|
||||
(i64.const 32)
|
||||
@ -4989,7 +4989,7 @@
|
||||
(tee_local $3
|
||||
(f64.reinterpret/i64
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(i32.add
|
||||
(i32.add
|
||||
(i32.or
|
||||
@ -5398,7 +5398,7 @@
|
||||
(set_local $3
|
||||
(f64.reinterpret/i64
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(i32.and
|
||||
(get_local $7)
|
||||
(i32.xor
|
||||
@ -5600,7 +5600,7 @@
|
||||
(i64.const 4294967295)
|
||||
)
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $8)
|
||||
)
|
||||
(i64.const 32)
|
||||
|
@ -3120,7 +3120,7 @@
|
||||
(i64.shl
|
||||
(i64.add
|
||||
(i64.const 1023)
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
@ -3189,7 +3189,7 @@
|
||||
(i64.shl
|
||||
(i64.sub
|
||||
(i64.const 1023)
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
@ -3347,7 +3347,7 @@
|
||||
(i64.shl
|
||||
(i64.add
|
||||
(i64.const 1023)
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
@ -5651,7 +5651,7 @@
|
||||
(i64.const 4294967295)
|
||||
)
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $7)
|
||||
)
|
||||
(i64.const 32)
|
||||
@ -5703,7 +5703,7 @@
|
||||
(set_local $30
|
||||
(f64.reinterpret/i64
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(i32.add
|
||||
(i32.add
|
||||
(i32.or
|
||||
@ -6180,7 +6180,7 @@
|
||||
(set_local $20
|
||||
(f64.reinterpret/i64
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(i32.and
|
||||
(get_local $25)
|
||||
(i32.xor
|
||||
@ -6398,7 +6398,7 @@
|
||||
(i64.const 4294967295)
|
||||
)
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $24)
|
||||
)
|
||||
(i64.const 32)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -181,7 +181,7 @@
|
||||
)
|
||||
(i64.shl
|
||||
(get_local $2)
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(i32.sub
|
||||
(i32.const 1)
|
||||
(get_local $3)
|
||||
@ -237,7 +237,7 @@
|
||||
)
|
||||
(i64.shl
|
||||
(get_local $5)
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(i32.sub
|
||||
(i32.const 1)
|
||||
(get_local $6)
|
||||
@ -358,7 +358,7 @@
|
||||
(i64.const 4503599627370496)
|
||||
)
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $3)
|
||||
)
|
||||
(i64.const 52)
|
||||
@ -366,7 +366,7 @@
|
||||
)
|
||||
(i64.shr_u
|
||||
(get_local $2)
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(i32.sub
|
||||
(i32.const 1)
|
||||
(get_local $3)
|
||||
@ -376,7 +376,7 @@
|
||||
)
|
||||
)
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $8)
|
||||
)
|
||||
(i64.const 63)
|
||||
|
@ -190,7 +190,7 @@
|
||||
(set_local $2
|
||||
(i64.shl
|
||||
(get_local $2)
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(i32.const 0)
|
||||
@ -264,7 +264,7 @@
|
||||
(set_local $3
|
||||
(i64.shl
|
||||
(get_local $3)
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(i32.add
|
||||
(i32.sub
|
||||
(i32.const 0)
|
||||
@ -430,7 +430,7 @@
|
||||
(i64.or
|
||||
(get_local $2)
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $4)
|
||||
)
|
||||
(i64.const 52)
|
||||
@ -441,7 +441,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)
|
||||
@ -457,7 +457,7 @@
|
||||
(i64.or
|
||||
(get_local $2)
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $6)
|
||||
)
|
||||
(i64.const 63)
|
||||
|
@ -399,7 +399,7 @@
|
||||
(f64.reinterpret/i64
|
||||
(i64.shl
|
||||
(i64.add
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $1)
|
||||
)
|
||||
(i64.const 1023)
|
||||
@ -1160,7 +1160,7 @@
|
||||
(i64.const 4294967295)
|
||||
)
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $5)
|
||||
)
|
||||
(i64.const 32)
|
||||
@ -1195,7 +1195,7 @@
|
||||
(tee_local $3
|
||||
(f64.reinterpret/i64
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(i32.add
|
||||
(i32.add
|
||||
(i32.or
|
||||
@ -1604,7 +1604,7 @@
|
||||
(set_local $3
|
||||
(f64.reinterpret/i64
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(i32.and
|
||||
(get_local $7)
|
||||
(i32.xor
|
||||
@ -1806,7 +1806,7 @@
|
||||
(i64.const 4294967295)
|
||||
)
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $8)
|
||||
)
|
||||
(i64.const 32)
|
||||
|
@ -444,7 +444,7 @@
|
||||
(i64.shl
|
||||
(i64.add
|
||||
(i64.const 1023)
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
@ -1253,7 +1253,7 @@
|
||||
(i64.const 4294967295)
|
||||
)
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $7)
|
||||
)
|
||||
(i64.const 32)
|
||||
@ -1305,7 +1305,7 @@
|
||||
(set_local $30
|
||||
(f64.reinterpret/i64
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(i32.add
|
||||
(i32.add
|
||||
(i32.or
|
||||
@ -1782,7 +1782,7 @@
|
||||
(set_local $20
|
||||
(f64.reinterpret/i64
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(i32.and
|
||||
(get_local $25)
|
||||
(i32.xor
|
||||
@ -2000,7 +2000,7 @@
|
||||
(i64.const 4294967295)
|
||||
)
|
||||
(i64.shl
|
||||
(i64.extend_u/i32
|
||||
(i64.extend_s/i32
|
||||
(get_local $24)
|
||||
)
|
||||
(i64.const 32)
|
||||
|
Reference in New Issue
Block a user