Implement SaddSat and SsubSat for the interpreter

Implemented `SaddSat` and `SsubSat` to add and subtract signed vector
values, saturating at the type boundaries rather than overflowing.

Changed the parser to allow signed `i8` immediates in vectors as part of
this work; fixes #3276.

Copyright (c) 2021, Arm Limited.
This commit is contained in:
dheaton-arm
2021-09-03 11:35:39 +01:00
parent dd71acd7e3
commit 8f057e0482
7 changed files with 93 additions and 3 deletions

View File

@@ -26,6 +26,12 @@ impl IntoBytes for u8 {
}
}
impl IntoBytes for i8 {
fn into_bytes(self) -> Vec<u8> {
vec![self as u8]
}
}
impl IntoBytes for i16 {
fn into_bytes(self) -> Vec<u8> {
self.to_le_bytes().to_vec()