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.
68 lines
1.2 KiB
Plaintext
68 lines
1.2 KiB
Plaintext
; Test basic code generation for i64 arithmetic WebAssembly instructions
|
|
; on 32-bit platforms.
|
|
test compile
|
|
|
|
target i686 baseline
|
|
|
|
; Binary operations.
|
|
|
|
function %i64_div_s(i64, i64) -> i64 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = sdiv v0, v1
|
|
return v2
|
|
}
|
|
|
|
function %i64_div_u(i64, i64) -> i64 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = udiv v0, v1
|
|
return v2
|
|
}
|
|
|
|
function %i64_rem_s(i64, i64) -> i64 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = srem v0, v1
|
|
return v2
|
|
}
|
|
|
|
function %i64_rem_u(i64, i64) -> i64 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = urem v0, v1
|
|
return v2
|
|
}
|
|
|
|
function %i64_i32_shl(i64, i32) -> i64 {
|
|
block0(v0: i64, v1: i32):
|
|
v2 = ishl v0, v1
|
|
return v2
|
|
}
|
|
|
|
function %i64_i32_shr_u(i64, i32) -> i64 {
|
|
block0(v0: i64, v1: i32):
|
|
v2 = ushr v0, v1
|
|
return v2
|
|
}
|
|
|
|
function %i64_i32_shr_s(i64, i32) -> i64 {
|
|
block0(v0: i64, v1: i32):
|
|
v2 = sshr v0, v1
|
|
return v2
|
|
}
|
|
|
|
function %i64_i64_shl(i64, i64) -> i64 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = ishl v0, v1
|
|
return v2
|
|
}
|
|
|
|
function %i64_i64_shr_u(i64, i64) -> i64 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = ushr v0, v1
|
|
return v2
|
|
}
|
|
|
|
function %i64_i64_shr_s(i64, i64) -> i64 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = sshr v0, v1
|
|
return v2
|
|
}
|