Addresses #3809: when we are asked to create a Cranelift backend with shared flags that indicate support for SIMD, we should check that the ISA level needed for our SIMD lowerings is present.
33 lines
835 B
Plaintext
33 lines
835 B
Plaintext
test interpret
|
|
test run
|
|
target aarch64
|
|
set enable_simd
|
|
target x86_64 has_sse3 has_ssse3 has_sse41
|
|
|
|
function %smulhi_i16(i16, i16) -> i16 {
|
|
block0(v0: i16, v1: i16):
|
|
v2 = smulhi v0, v1
|
|
return v2
|
|
}
|
|
; run: %smulhi_i16(-2, -4) == 0
|
|
; run: %smulhi_i16(2, -4) == -1
|
|
; run: %smulhi_i16(32767, 32767) == 16383
|
|
|
|
function %smulhi_i32(i32, i32) -> i32 {
|
|
block0(v0: i32, v1: i32):
|
|
v2 = smulhi v0, v1
|
|
return v2
|
|
}
|
|
; run: %smulhi_i32(-500, -700) == 0
|
|
; run: %smulhi_i32(500, -700) == -1
|
|
; run: %smulhi_i32(2147483647, 2147483647) == 1073741823
|
|
|
|
function %smulhi_i64(i64, i64) -> i64 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = smulhi v0, v1
|
|
return v2
|
|
}
|
|
; run: %smulhi_i64(-4294967295, -4294967295) == 0
|
|
; run: %smulhi_i64(4294967295, -4294967295) == -1
|
|
; run: %smulhi_i64(9223372036854775807, 9223372036854775807) == 4611686018427387903
|