mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-01 04:10:07 +00:00
Improve support for freestanding_wasm32
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user