Files
wasmtime/cranelift/filetests/filetests/runtests/smulhi.clif
Ulrich Weigand dd40bf075a s390x: Enable more runtests, and fix a few bugs (#4516)
This enables more runtests to be executed on s390x.  Doing so
uncovered a two back-end bugs, which are fixed as well:

- The result of cls was always off by one.
- The result of popcnt.i16 has uninitialized high bits.

In addition, I found a bug in the load-op-store.clif test case:
     v3 = heap_addr.i64 heap0, v1, 4
     v4 = iconst.i64 42
     store.i32 v4, v3
This was clearly intended to perform a 32-bit store, but
actually performs a 64-bit store (it seems the type annotation
of the store opcode is ignored, and the type of the operand
is used instead).  That bug did not show any noticable symptoms
on little-endian architectures, but broke on big-endian.
2022-07-25 12:37:06 -07:00

34 lines
848 B
Plaintext

test interpret
test run
target aarch64
target s390x
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