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