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
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
test verifier
|
||||
|
||||
; bitcast between two types of equal size if ok
|
||||
; 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 ok
|
||||
function %valid_bitcast2(i32) -> i64 { ; Ok
|
||||
; bitcast to a type larger than the operand is not ok
|
||||
function %valid_bitcast2(i32) -> i64 {
|
||||
block0(v0: i32):
|
||||
v1 = bitcast.i64 v0
|
||||
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 doesn't fit in a type of 32 bits
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user