cranelift: add i64.{ishl,ushr,ashr} libcalls.
These libcalls are useful for 32-bit platforms.
On x86_32 in particular, commit 4ec16fa0 added support for legalizing
64-bit shifts through SIMD operations. However, that legalization
requires SIMD to be enabled and SSE 4.1 to be supported, which is not
acceptable as a hard requirement.
This commit is contained in:
@@ -50,6 +50,9 @@ fn apply_reloc(
|
||||
SdivI64 => wasmtime_i64_sdiv as usize,
|
||||
UremI64 => wasmtime_i64_urem as usize,
|
||||
SremI64 => wasmtime_i64_srem as usize,
|
||||
IshlI64 => wasmtime_i64_ishl as usize,
|
||||
UshrI64 => wasmtime_i64_ushr as usize,
|
||||
SshrI64 => wasmtime_i64_sshr as usize,
|
||||
CeilF32 => wasmtime_f32_ceil as usize,
|
||||
FloorF32 => wasmtime_f32_floor as usize,
|
||||
TruncF32 => wasmtime_f32_trunc as usize,
|
||||
|
||||
@@ -98,6 +98,21 @@ pub extern "C" fn wasmtime_i64_srem(x: i64, y: i64) -> i64 {
|
||||
x % y
|
||||
}
|
||||
|
||||
/// Implementation of i64.ishl
|
||||
pub extern "C" fn wasmtime_i64_ishl(x: i64, y: i64) -> i64 {
|
||||
x << y
|
||||
}
|
||||
|
||||
/// Implementation of i64.ushr
|
||||
pub extern "C" fn wasmtime_i64_ushr(x: u64, y: i64) -> u64 {
|
||||
x >> y
|
||||
}
|
||||
|
||||
/// Implementation of i64.sshr
|
||||
pub extern "C" fn wasmtime_i64_sshr(x: i64, y: i64) -> i64 {
|
||||
x >> y
|
||||
}
|
||||
|
||||
/// Implementation of f64.ceil
|
||||
pub extern "C" fn wasmtime_f64_ceil(x: f64) -> f64 {
|
||||
x.ceil()
|
||||
|
||||
Reference in New Issue
Block a user