Files
wasmtime/cranelift/filetests/filetests/verifier/bitcast.clif
Damian Heaton e786bda002 Vector bitcast support (AArch64 & Interpreter) (#4820)
* Vector bitcast support (AArch64 & Interpreter)

Implemented support for `bitcast` on vector values for AArch64 and the
interpreter.

Also corrected the verifier to ensure that the size, in bits, of the input and
output types match for a `bitcast`, per the docs.

Copyright (c) 2022 Arm Limited

* `I128` same-type bitcast support

Copyright (c) 2022 Arm Limited

* Directly return input for 64-bit GPR<=>GPR bitcast

Copyright (c) 2022 Arm Limited
2022-09-21 09:20:28 -07:00

24 lines
666 B
Plaintext

test verifier
; bitcast between two types of equal size is ok
function %valid_bitcast1(i32) -> f32 { ; Ok
block0(v0: i32):
v1 = bitcast.f32 v0
return v1
}
; bitcast to a type larger than the operand is not ok
function %valid_bitcast2(i32) -> i64 {
block0(v0: i32):
v1 = bitcast.i64 v0 ; error: The bitcast argument v0 has a lane type of 32 bits, which doesn't match an expected type of 64 bits
return v1
}
; bitcast to a smaller type is not ok
function %bad_bitcast(i64) -> i32 {
block0(v0: i64):
v1 = bitcast.i32 v0 ; error: The bitcast argument v0 has a lane type of 64 bits, which doesn't match an expected type of 32 bits
return v1
}