Expand runtimes a bit more
This commit is contained in:
parent
ce54d834a5
commit
8d671b99e4
@ -24,6 +24,7 @@ do
|
|||||||
local sub = {}
|
local sub = {}
|
||||||
local mul = {}
|
local mul = {}
|
||||||
local div = {}
|
local div = {}
|
||||||
|
local neg = {}
|
||||||
|
|
||||||
local to_signed = bit.tobit
|
local to_signed = bit.tobit
|
||||||
|
|
||||||
@ -60,10 +61,15 @@ do
|
|||||||
return (i64(u64(lhs) / u64(rhs)))
|
return (i64(u64(lhs) / u64(rhs)))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function neg.num(num)
|
||||||
|
return -num
|
||||||
|
end
|
||||||
|
|
||||||
module.add = add
|
module.add = add
|
||||||
module.sub = sub
|
module.sub = sub
|
||||||
module.mul = mul
|
module.mul = mul
|
||||||
module.div = div
|
module.div = div
|
||||||
|
module.neg = neg
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
@ -200,6 +206,8 @@ do
|
|||||||
local trunc = {}
|
local trunc = {}
|
||||||
local extend = {}
|
local extend = {}
|
||||||
local convert = {}
|
local convert = {}
|
||||||
|
local promote = {}
|
||||||
|
local demote = {}
|
||||||
local reinterpret = {}
|
local reinterpret = {}
|
||||||
|
|
||||||
-- This would surely be an issue in a multi-thread environment...
|
-- This would surely be an issue in a multi-thread environment...
|
||||||
@ -267,6 +275,14 @@ do
|
|||||||
return (to_number(u64(num)))
|
return (to_number(u64(num)))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function demote.f32_f64(num)
|
||||||
|
return num
|
||||||
|
end
|
||||||
|
|
||||||
|
function promote.f64_f32(num)
|
||||||
|
return num
|
||||||
|
end
|
||||||
|
|
||||||
function reinterpret.i32_f32(num)
|
function reinterpret.i32_f32(num)
|
||||||
RE_INSTANCE.f32 = num
|
RE_INSTANCE.f32 = num
|
||||||
|
|
||||||
@ -295,6 +311,8 @@ do
|
|||||||
module.trunc = trunc
|
module.trunc = trunc
|
||||||
module.extend = extend
|
module.extend = extend
|
||||||
module.convert = convert
|
module.convert = convert
|
||||||
|
module.demote = demote
|
||||||
|
module.promote = promote
|
||||||
module.reinterpret = reinterpret
|
module.reinterpret = reinterpret
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ do
|
|||||||
local sub = {}
|
local sub = {}
|
||||||
local mul = {}
|
local mul = {}
|
||||||
local div = {}
|
local div = {}
|
||||||
|
local neg = {}
|
||||||
|
|
||||||
local assert = assert
|
local assert = assert
|
||||||
|
|
||||||
@ -76,10 +77,15 @@ do
|
|||||||
|
|
||||||
div.u64 = I64.divide_unsigned
|
div.u64 = I64.divide_unsigned
|
||||||
|
|
||||||
|
function neg.num(num)
|
||||||
|
return -num
|
||||||
|
end
|
||||||
|
|
||||||
module.add = add
|
module.add = add
|
||||||
module.sub = sub
|
module.sub = sub
|
||||||
module.mul = mul
|
module.mul = mul
|
||||||
module.div = div
|
module.div = div
|
||||||
|
module.neg = neg
|
||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
@ -228,6 +234,8 @@ do
|
|||||||
local trunc = {}
|
local trunc = {}
|
||||||
local extend = {}
|
local extend = {}
|
||||||
local convert = {}
|
local convert = {}
|
||||||
|
local demote = {}
|
||||||
|
local promote = {}
|
||||||
local reinterpret = {}
|
local reinterpret = {}
|
||||||
|
|
||||||
local math_ceil = math.ceil
|
local math_ceil = math.ceil
|
||||||
@ -323,6 +331,10 @@ do
|
|||||||
|
|
||||||
convert.f64_u64 = num_into_u64
|
convert.f64_u64 = num_into_u64
|
||||||
|
|
||||||
|
demote.f32_f64 = no_op
|
||||||
|
|
||||||
|
promote.f64_f32 = no_op
|
||||||
|
|
||||||
function reinterpret.i32_f32(num)
|
function reinterpret.i32_f32(num)
|
||||||
local packed = string_pack("f", num)
|
local packed = string_pack("f", num)
|
||||||
|
|
||||||
@ -353,6 +365,8 @@ do
|
|||||||
module.trunc = trunc
|
module.trunc = trunc
|
||||||
module.extend = extend
|
module.extend = extend
|
||||||
module.convert = convert
|
module.convert = convert
|
||||||
|
module.demote = demote
|
||||||
|
module.promote = promote
|
||||||
module.reinterpret = reinterpret
|
module.reinterpret = reinterpret
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user