Improve support for freestanding_wasm32

This commit is contained in:
gingerBill
2021-11-07 16:19:27 +00:00
parent e9c903f1ea
commit dc2edd3e79
7 changed files with 123 additions and 37 deletions
+13 -2
View File
@@ -3,6 +3,17 @@ package runtime
@(link_name="__ashlti3", linkage="strong")
__ashlti3 :: proc "c" (a: i64, b: i32) -> i64 {
// TODO(bill): __ashlti3 on wasm32
return a
input: transmute([2]i32)a
result: [2]i32
if b & 32 != 0 {
result[0] = 0
result[1] = input[0] << (b - 32)
} else {
if b == 0 {
return a
}
result[0] = input[0]<<b
result[1] = (input[1]<<b) | (input[0]>>(32-b))
}
return transmute(i64)result
}