Allow 64-bit vectors and implement for interpreter (#4509)

* Allow 64-bit vectors and implement for interpreter

The AArch64 backend already supports 64-bit vectors; this simply allows
instructions to make use of that.

Implemented support for 64-bit vectors within the interpreter to allow
interpret runtests to use them.

Copyright (c) 2022 Arm Limited

* Disable 64-bit SIMD `iaddpairwise` tests on s390x

Copyright (c) 2022 Arm Limited
This commit is contained in:
Damian Heaton
2022-07-25 21:00:43 +01:00
committed by GitHub
parent c5ddb4b803
commit 3ef89b7787
7 changed files with 119 additions and 48 deletions

View File

@@ -279,13 +279,25 @@ impl Value for DataValue {
}
fn vector(v: [u8; 16], ty: Type) -> ValueResult<Self> {
assert!(ty.is_vector() && ty.bytes() == 16);
Ok(DataValue::V128(v))
assert!(ty.is_vector() && [8, 16].contains(&ty.bytes()));
if ty.bytes() == 16 {
Ok(DataValue::V128(v))
} else if ty.bytes() == 8 {
let v64: [u8; 8] = v[..8].try_into().unwrap();
Ok(DataValue::V64(v64))
} else {
unimplemented!()
}
}
fn into_array(&self) -> ValueResult<[u8; 16]> {
match *self {
DataValue::V128(v) => Ok(v),
DataValue::V64(v) => {
let mut v128 = [0; 16];
v128[..8].clone_from_slice(&v);
Ok(v128)
}
_ => Err(ValueError::InvalidType(ValueTypeClass::Vector, self.ty())),
}
}