diff options
author | iximeow <me@iximeow.net> | 2025-04-12 20:05:18 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2025-04-12 20:05:18 -0700 |
commit | 6db7ec51c76f22d2ec0a352cebd100598cb48278 (patch) | |
tree | 89a2dd89d4471c394f2648294216f195b69b503c | |
parent | 4005a6fe024cda0049e828aa688e1e9a885036f6 (diff) |
just... decoded predicated loads wrong...
-rw-r--r-- | src/lib.rs | 2 | ||||
-rw-r--r-- | tests/from_brain.rs | 24 |
2 files changed, 13 insertions, 13 deletions
@@ -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] |