mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-20 10:16:37 +00:00
Fix Math.imul and add tests (#432)
This commit is contained in:
@ -8002,7 +8002,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 40
|
||||
i32.const 959
|
||||
i32.const 970
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -8068,7 +8068,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 40
|
||||
i32.const 968
|
||||
i32.const 979
|
||||
i32.const 24
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -8115,7 +8115,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 40
|
||||
i32.const 2029
|
||||
i32.const 2040
|
||||
i32.const 24
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -9183,7 +9183,44 @@
|
||||
f32.const 0
|
||||
call $std/math/check<f32>
|
||||
)
|
||||
(func $~lib/math/ipow64 (; 145 ;) (type $IiI) (param $0 i64) (param $1 i32) (result i64)
|
||||
(func $~lib/math/NativeMath.imul (; 145 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64)
|
||||
(local $2 f64)
|
||||
get_local $0
|
||||
get_local $1
|
||||
f64.add
|
||||
tee_local $2
|
||||
get_local $2
|
||||
f64.sub
|
||||
f64.const 0
|
||||
f64.ne
|
||||
if
|
||||
f64.const 0
|
||||
return
|
||||
end
|
||||
get_local $0
|
||||
f64.const 4294967296
|
||||
get_local $0
|
||||
f64.const 2.3283064365386963e-10
|
||||
f64.mul
|
||||
f64.floor
|
||||
f64.mul
|
||||
f64.sub
|
||||
i64.trunc_s/f64
|
||||
i32.wrap/i64
|
||||
get_local $1
|
||||
f64.const 4294967296
|
||||
get_local $1
|
||||
f64.const 2.3283064365386963e-10
|
||||
f64.mul
|
||||
f64.floor
|
||||
f64.mul
|
||||
f64.sub
|
||||
i64.trunc_s/f64
|
||||
i32.wrap/i64
|
||||
i32.mul
|
||||
f64.convert_s/i32
|
||||
)
|
||||
(func $~lib/math/ipow64 (; 146 ;) (type $IiI) (param $0 i64) (param $1 i32) (result i64)
|
||||
(local $2 i64)
|
||||
(local $3 i32)
|
||||
i64.const 1
|
||||
@ -9379,7 +9416,7 @@
|
||||
end
|
||||
get_local $2
|
||||
)
|
||||
(func $start (; 146 ;) (type $v)
|
||||
(func $start (; 147 ;) (type $v)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
(local $2 f64)
|
||||
@ -37563,11 +37600,11 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 0
|
||||
i32.const 0
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
i64.ne
|
||||
f64.const 2
|
||||
f64.const 4
|
||||
call $~lib/math/NativeMath.imul
|
||||
f64.const 8
|
||||
f64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
@ -37576,11 +37613,11 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 0
|
||||
i32.const 1
|
||||
call $~lib/math/ipow64
|
||||
i64.const 0
|
||||
i64.ne
|
||||
f64.const -1
|
||||
f64.const 8
|
||||
call $~lib/math/NativeMath.imul
|
||||
f64.const -8
|
||||
f64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
@ -37589,11 +37626,11 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 0
|
||||
i32.const 2
|
||||
call $~lib/math/ipow64
|
||||
i64.const 0
|
||||
i64.ne
|
||||
f64.const -2
|
||||
f64.const -2
|
||||
call $~lib/math/NativeMath.imul
|
||||
f64.const 4
|
||||
f64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
@ -37602,11 +37639,11 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 0
|
||||
i32.const 3
|
||||
call $~lib/math/ipow64
|
||||
i64.const 0
|
||||
i64.ne
|
||||
f64.const 4294967295
|
||||
f64.const 5
|
||||
call $~lib/math/NativeMath.imul
|
||||
f64.const -5
|
||||
f64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
@ -37615,11 +37652,24 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 1
|
||||
i32.const 0
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
i64.ne
|
||||
f64.const 4294967294
|
||||
f64.const 5
|
||||
call $~lib/math/NativeMath.imul
|
||||
f64.const -10
|
||||
f64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3278
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
f64.const 1.e+60
|
||||
f64.const 1.e+60
|
||||
call $~lib/math/NativeMath.imul
|
||||
f64.const 0
|
||||
f64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
@ -37628,11 +37678,11 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 1
|
||||
i32.const 1
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
i64.ne
|
||||
f64.const 1.e+60
|
||||
f64.const -1.e+60
|
||||
call $~lib/math/NativeMath.imul
|
||||
f64.const 0
|
||||
f64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
@ -37641,11 +37691,11 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 1
|
||||
i32.const 2
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
i64.ne
|
||||
f64.const -1.e+60
|
||||
f64.const -1.e+60
|
||||
call $~lib/math/NativeMath.imul
|
||||
f64.const 0
|
||||
f64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
@ -37654,11 +37704,11 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 1
|
||||
i32.const 3
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
i64.ne
|
||||
f64.const 1.e+24
|
||||
f64.const 100
|
||||
call $~lib/math/NativeMath.imul
|
||||
f64.const -2147483648
|
||||
f64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
@ -37667,11 +37717,24 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 2
|
||||
i32.const 0
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
i64.ne
|
||||
f64.const nan:0x8000000000000
|
||||
f64.const 1
|
||||
call $~lib/math/NativeMath.imul
|
||||
f64.const 0
|
||||
f64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3283
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
f64.const 1
|
||||
f64.const inf
|
||||
call $~lib/math/NativeMath.imul
|
||||
f64.const 0
|
||||
f64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
@ -37680,11 +37743,11 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 2
|
||||
i32.const 1
|
||||
call $~lib/math/ipow64
|
||||
i64.const 2
|
||||
i64.ne
|
||||
f64.const 1797693134862315708145274e284
|
||||
f64.const 1797693134862315708145274e284
|
||||
call $~lib/math/NativeMath.imul
|
||||
f64.const 0
|
||||
f64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
@ -37693,33 +37756,7 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 2
|
||||
i32.const 2
|
||||
call $~lib/math/ipow64
|
||||
i64.const 4
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3286
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 2
|
||||
i32.const 3
|
||||
call $~lib/math/ipow64
|
||||
i64.const 8
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3287
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const -1
|
||||
i64.const 0
|
||||
i32.const 0
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
@ -37732,10 +37769,10 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const -1
|
||||
i64.const 0
|
||||
i32.const 1
|
||||
call $~lib/math/ipow64
|
||||
i64.const -1
|
||||
i64.const 0
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
@ -37745,10 +37782,10 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const -1
|
||||
i64.const 0
|
||||
i32.const 2
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
i64.const 0
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
@ -37758,10 +37795,10 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const -1
|
||||
i64.const 0
|
||||
i32.const 3
|
||||
call $~lib/math/ipow64
|
||||
i64.const -1
|
||||
i64.const 0
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
@ -37771,7 +37808,7 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const -2
|
||||
i64.const 1
|
||||
i32.const 0
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
@ -37784,6 +37821,162 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 1
|
||||
i32.const 1
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3295
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 1
|
||||
i32.const 2
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3296
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 1
|
||||
i32.const 3
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3297
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 2
|
||||
i32.const 0
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3299
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 2
|
||||
i32.const 1
|
||||
call $~lib/math/ipow64
|
||||
i64.const 2
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3300
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 2
|
||||
i32.const 2
|
||||
call $~lib/math/ipow64
|
||||
i64.const 4
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3301
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const 2
|
||||
i32.const 3
|
||||
call $~lib/math/ipow64
|
||||
i64.const 8
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3302
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const -1
|
||||
i32.const 0
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3304
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const -1
|
||||
i32.const 1
|
||||
call $~lib/math/ipow64
|
||||
i64.const -1
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3305
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const -1
|
||||
i32.const 2
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3306
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const -1
|
||||
i32.const 3
|
||||
call $~lib/math/ipow64
|
||||
i64.const -1
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3307
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const -2
|
||||
i32.const 0
|
||||
call $~lib/math/ipow64
|
||||
i64.const 1
|
||||
i64.ne
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3309
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i64.const -2
|
||||
i32.const 1
|
||||
call $~lib/math/ipow64
|
||||
@ -37792,7 +37985,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3295
|
||||
i32.const 3310
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -37805,7 +37998,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3296
|
||||
i32.const 3311
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -37818,7 +38011,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3297
|
||||
i32.const 3312
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -37831,7 +38024,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3299
|
||||
i32.const 3314
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -37844,7 +38037,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3300
|
||||
i32.const 3315
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -37857,7 +38050,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3301
|
||||
i32.const 3316
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -37870,7 +38063,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3302
|
||||
i32.const 3317
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -37883,7 +38076,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3303
|
||||
i32.const 3318
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -37896,7 +38089,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3304
|
||||
i32.const 3319
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -37909,7 +38102,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3305
|
||||
i32.const 3320
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -37926,13 +38119,13 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 8
|
||||
i32.const 3307
|
||||
i32.const 3322
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $null (; 147 ;) (type $v)
|
||||
(func $null (; 148 ;) (type $v)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user