From 6db7ec51c76f22d2ec0a352cebd100598cb48278 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 12 Apr 2025 20:05:18 -0700 Subject: just... decoded predicated loads wrong... --- src/lib.rs | 2 +- tests/from_brain.rs | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index f681fb8..4d1a65c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4329,7 +4329,7 @@ fn decode_instruction< let dotnew = (inst >> 12) & 0b1 != 0; handler.inst_predicated(tt as u8, negated, dotnew)?; - handler.on_source_decoded(Operand::RegStoreAssign { base: xxxxx, addr: iiiiii as u16 })?; + handler.on_source_decoded(Operand::imm_u32(iiiiii as u32))?; if !wide { handler.on_dest_decoded(Operand::gpr(ddddd))?; } else { diff --git a/tests/from_brain.rs b/tests/from_brain.rs index 8104b13..ca3bbe4 100644 --- a/tests/from_brain.rs +++ b/tests/from_brain.rs @@ -1140,18 +1140,18 @@ fn inst_1001() { test_invalid(&0b1001_1111101_00010_11_1001_01000_10000u32.to_le_bytes(), DecodeError::InvalidOpcode); test_display(&0b1001_1111110_00010_11_1001_01000_10000u32.to_le_bytes(), "{ r17:16 = memd(r2++m1:brev) }"); - test_display(&0b1001_1111000_00010_11_1001_01100_10000u32.to_le_bytes(), "{ if (p2) r16 = memb(r2=#0x5) }"); - test_display(&0b1001_1111000_00010_11_1011_01100_10000u32.to_le_bytes(), "{ if (!p2) r16 = memb(r2=#0x5) }"); - test_display(&0b1001_1111000_00010_11_1101_01100_10000u32.to_le_bytes(), "{ if (p2.new) r16 = memb(r2=#0x5) }"); - test_display(&0b1001_1111000_00010_11_1111_01100_10000u32.to_le_bytes(), "{ if (!p2.new) r16 = memb(r2=#0x5) }"); - test_display(&0b1001_1111011_00010_11_1001_01100_10000u32.to_le_bytes(), "{ if (p2) r16 = memuh(r2=#0x5) }"); - test_display(&0b1001_1111011_00010_11_1011_01100_10000u32.to_le_bytes(), "{ if (!p2) r16 = memuh(r2=#0x5) }"); - test_display(&0b1001_1111011_00010_11_1101_01100_10000u32.to_le_bytes(), "{ if (p2.new) r16 = memuh(r2=#0x5) }"); - test_display(&0b1001_1111011_00010_11_1111_01100_10000u32.to_le_bytes(), "{ if (!p2.new) r16 = memuh(r2=#0x5) }"); - test_display(&0b1001_1111110_00010_11_1001_01100_10000u32.to_le_bytes(), "{ if (p2) r17:16 = memd(r2=#0x5) }"); - test_display(&0b1001_1111110_00010_11_1011_01100_10000u32.to_le_bytes(), "{ if (!p2) r17:16 = memd(r2=#0x5) }"); - test_display(&0b1001_1111110_00010_11_1101_01100_10000u32.to_le_bytes(), "{ if (p2.new) r17:16 = memd(r2=#0x5) }"); - test_display(&0b1001_1111110_00010_11_1111_01100_10000u32.to_le_bytes(), "{ if (!p2.new) r17:16 = memd(r2=#0x5) }"); + test_display(&0b1001_1111000_00010_11_1001_01100_10000u32.to_le_bytes(), "{ if (p2) r16 = memb(#5) }"); + test_display(&0b1001_1111000_00010_11_1011_01100_10000u32.to_le_bytes(), "{ if (!p2) r16 = memb(#5) }"); + test_display(&0b1001_1111000_00010_11_1101_01100_10000u32.to_le_bytes(), "{ if (p2.new) r16 = memb(#5) }"); + test_display(&0b1001_1111000_00010_11_1111_01100_10000u32.to_le_bytes(), "{ if (!p2.new) r16 = memb(#5) }"); + test_display(&0b1001_1111011_00010_11_1001_01100_10000u32.to_le_bytes(), "{ if (p2) r16 = memuh(#5) }"); + test_display(&0b1001_1111011_00010_11_1011_01100_10000u32.to_le_bytes(), "{ if (!p2) r16 = memuh(#5) }"); + test_display(&0b1001_1111011_00010_11_1101_01100_10000u32.to_le_bytes(), "{ if (p2.new) r16 = memuh(#5) }"); + test_display(&0b1001_1111011_00010_11_1111_01100_10000u32.to_le_bytes(), "{ if (!p2.new) r16 = memuh(#5) }"); + test_display(&0b1001_1111110_00010_11_1001_01100_10000u32.to_le_bytes(), "{ if (p2) r17:16 = memd(#5) }"); + test_display(&0b1001_1111110_00010_11_1011_01100_10000u32.to_le_bytes(), "{ if (!p2) r17:16 = memd(#5) }"); + test_display(&0b1001_1111110_00010_11_1101_01100_10000u32.to_le_bytes(), "{ if (p2.new) r17:16 = memd(#5) }"); + test_display(&0b1001_1111110_00010_11_1111_01100_10000u32.to_le_bytes(), "{ if (!p2.new) r17:16 = memd(#5) }"); } #[test] -- cgit v1.1