From 2b0930355d87d7f195a7ff05d18b09b61a5ea490 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 16 Mar 2024 23:35:23 +0000 Subject: ldrab and ldraa tests, fix immediate decoding --- src/armv8/a64.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/armv8/a64.rs b/src/armv8/a64.rs index cdee6d5..de7a743 100644 --- a/src/armv8/a64.rs +++ b/src/armv8/a64.rs @@ -9105,8 +9105,10 @@ impl Decoder for InstDecoder { // V==0 let w = (word >> 11) & 1; let imm9 = ((word >> 12) & 0b1_1111_1111) as i16; - let imm9 = ((imm9 << 7) >> 7) as i32; - let imm9 = imm9 << 3; // `simm` is stored as a multiple of 8 + let S = ((word >> 22) & 1) as i16; + let imm10 = imm9 | (S << 9); + let imm10 = imm10 << 3; // `simm` is stored as a multiple of 8 + let imm10 = ((imm10 << 3) >> 3) as i32; let m = (word >> 23) & 1; let size = (word >> 30) & 0b11; if size != 0b11 { @@ -9122,9 +9124,9 @@ impl Decoder for InstDecoder { inst.operands = [ Operand::Register(SizeCode::X, Rt), if w == 0 { - Operand::RegPreIndex(Rn, imm9, false) + Operand::RegPreIndex(Rn, imm10, false) } else { - Operand::RegPreIndex(Rn, imm9, true) + Operand::RegPreIndex(Rn, imm10, true) }, Operand::Nothing, Operand::Nothing, -- cgit v1.1