Remove unused runtime functions

This commit is contained in:
Rerumu 2022-04-29 23:33:04 -04:00
parent 7913dd507a
commit a40335ee69

View File

@ -25,23 +25,19 @@ do
local mul = {} local mul = {}
local div = {} local div = {}
local num_meta = debug.getmetatable(i64)
local to_signed = bit.tobit local to_signed = bit.tobit
function add.i32(a, b) function add.i32(a, b)
return (to_signed(a + b)) return (to_signed(a + b))
end end
add.i64 = num_meta.__add
function sub.i32(a, b) function sub.i32(a, b)
return (to_signed(a - b)) return (to_signed(a - b))
end end
sub.i64 = num_meta.__sub
function mul.i32(a, b) function mul.i32(a, b)
return (to_signed(a * b)) return (to_signed(a * b))
end end
mul.i64 = num_meta.__mul
function div.i32(lhs, rhs) function div.i32(lhs, rhs)
assert(rhs ~= 0, "division by zero") assert(rhs ~= 0, "division by zero")