From 611a375a524fcdee098ae7fae00c5498ff0d1465 Mon Sep 17 00:00:00 2001 From: iximeow Date: Wed, 29 Dec 2021 01:58:27 -0800 Subject: stxrb memory operand error --- src/armv8/a64.rs | 4 ++-- test/armv8/a64.rs | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/armv8/a64.rs b/src/armv8/a64.rs index 9d94c1a..8b96f60 100644 --- a/src/armv8/a64.rs +++ b/src/armv8/a64.rs @@ -6844,14 +6844,14 @@ impl Decoder for InstDecoder { inst.operands = [ Operand::Register(SizeCode::W, Rs), Operand::Register(SizeCode::W, Rt), - Operand::RegisterOrSP(SizeCode::X, Rn), + Operand::RegOffset(Rn, 0), Operand::Nothing, ]; } else if Lo1 == 0b10 { // load ops inst.operands = [ Operand::Register(SizeCode::W, Rt), - Operand::RegisterOrSP(SizeCode::X, Rn), + Operand::RegOffset(Rn, 0), Operand::Nothing, Operand::Nothing, ]; diff --git a/test/armv8/a64.rs b/test/armv8/a64.rs index be1f486..c7bddf7 100644 --- a/test/armv8/a64.rs +++ b/test/armv8/a64.rs @@ -4355,6 +4355,20 @@ fn test_weird_str() { } #[test] +fn test_mismatches() { + const TESTS: &[([u8; 4], &'static str)] = &[ + ([0x00, 0x00, 0x00, 0x08], "stxrb w0, w0, [x0]"), + ]; + let errs = run_tests(TESTS); + + for err in errs.iter() { + println!("{}", err); + } + + assert!(errs.is_empty()); +} + +#[test] fn test_cas() { const TESTS: &[([u8; 4], &'static str)] = &[ ([0x20, 0x7c, 0x20, 0x08], "casp w0, w1, w0, w1, [x1]"), -- cgit v1.1