Files
wasmtime/cranelift/filetests/filetests/runtests/bitcast-ref64.clif
Ulrich Weigand 961107ec63 Merge raw_bitcast and bitcast (#5175)
- Allow bitcast for vectors with differing lane widths
- Remove raw_bitcast IR instruction
- Change all users of raw_bitcast to bitcast
- Implement support for no-op bitcast cases across backends

This implements the second step of the plan outlined here:
https://github.com/bytecodealliance/wasmtime/issues/4566#issuecomment-1234819394
2022-11-02 10:16:27 -07:00

28 lines
635 B
Plaintext

test run
target aarch64
target x86_64
target s390x
; the interpreter does not support bitcasting to/from references
function %bitcast_ir64(i64) -> i8 {
block0(v0: i64):
v1 = bitcast.r64 v0
v2 = is_null v1
return v2
}
; run: %bitcast_ir64(0) == 1
; run: %bitcast_ir64(18446744073709551615) == 0
; run: %bitcast_ir64(-1) == 0
; run: %bitcast_ir64(127) == 0
function %bitcast_ri64(i64) -> i64 {
block0(v0: i64):
v1 = bitcast.r64 v0
v2 = bitcast.i64 v1
return v2
}
; run: %bitcast_ri64(0) == 0
; run: %bitcast_ri64(18446744073709551615) == 18446744073709551615
; run: %bitcast_ri64(-1) == -1
; run: %bitcast_ri64(127) == 127