aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2021-12-31 02:51:52 -0800
committeriximeow <me@iximeow.net>2021-12-31 02:51:52 -0800
commitad120206e5112bcb15ab58403dd09e5baa3ea9d5 (patch)
treeafa7a95ef163cac435d9e51f0c1daff509f1420b
parent7dd687d42293b75685fadda21ffafad1925a52de (diff)
sshll is weird
-rw-r--r--src/armv8/a64.rs13
-rw-r--r--test/armv8/a64.rs2
2 files changed, 13 insertions, 2 deletions
diff --git a/src/armv8/a64.rs b/src/armv8/a64.rs
index f6b6f0a..2d89d3c 100644
--- a/src/armv8/a64.rs
+++ b/src/armv8/a64.rs
@@ -3146,6 +3146,17 @@ impl Decoder<ARMv8> for InstDecoder {
(datasize, T)
};
+ let (datasize, T, shift) = if opcode == Opcode::SSHLL {
+ let new_t = match T {
+ SIMDSizeCode::B => SIMDSizeCode::H,
+ SIMDSizeCode::H => SIMDSizeCode::S,
+ _ /* SIMDSizeCode::S */ => SIMDSizeCode::D,
+ };
+ (SIMDSizeCode::Q, new_t, shift)
+ } else {
+ (datasize, T, shift)
+ };
+
if Q == 1 {
if inst.opcode == Opcode::RSHRN {
inst.opcode = Opcode::RSHRN2;
@@ -4583,7 +4594,7 @@ impl Decoder<ARMv8> for InstDecoder {
// u == 1, op == 0b00000
];
- let (opc, (datasize_a, elemsize_a, datasize_b, elemsize_b)) = if opcode == 0b00101 && U == 1{
+ let (opc, (datasize_a, elemsize_a, datasize_b, elemsize_b)) = if opcode == 0b00101 && U == 1 {
let vecsize = if q == 0 {
SIMDSizeCode::D
} else {
diff --git a/test/armv8/a64.rs b/test/armv8/a64.rs
index 2b43284..25e0906 100644
--- a/test/armv8/a64.rs
+++ b/test/armv8/a64.rs
@@ -4725,7 +4725,7 @@ fn test_fcmla() {
#[test]
fn test_vec_shift() {
const TESTS: &[([u8; 4], &'static str)] = &[
- ([0x00, 0xe8, 0x21, 0x2e], "shll v0.8h, v0.8h, #0x8"),
+ ([0x00, 0xa4, 0x08, 0x0f], "sshll v0.8h, v0.8b, #0x0"),
];
let errs = run_tests(TESTS);