From ad120206e5112bcb15ab58403dd09e5baa3ea9d5 Mon Sep 17 00:00:00 2001 From: iximeow Date: Fri, 31 Dec 2021 02:51:52 -0800 Subject: sshll is weird --- src/armv8/a64.rs | 13 ++++++++++++- test/armv8/a64.rs | 2 +- 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 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 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); -- cgit v1.1