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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user