From 5a5afda8beeaad009b1caf5d24e078ac40b02c3f Mon Sep 17 00:00:00 2001 From: AmauryBrodu <60550980+AmauryBrodu@users.noreply.github.com> Date: Thu, 10 Nov 2022 00:16:21 +0100 Subject: [PATCH] ajout des test des instructions opw --- src/print.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/print.rs b/src/print.rs index 750dc9b..9b5bede 100644 --- a/src/print.rs +++ b/src/print.rs @@ -326,6 +326,18 @@ mod test { assert_eq!("lwu x28, 1520(x17)", print::print(lwu, 0)); } + #[test] + fn test_opw() { + let addw: decode::Instruction = decode::decode(0b0000000_10000_10001_000_11100_0111011); + let sllw: decode::Instruction = decode::decode(0b0000000_10000_10001_001_11100_0111011); + let srlw: decode::Instruction = decode::decode(0b0000000_10000_10001_101_11100_0111011); + let sraw: decode::Instruction = decode::decode(0b0100000_10000_10001_101_11100_0111011); + + assert_eq!("addw x28, x17, x16", print::print(addw, 0)); + assert_eq!("sllw x28, x17, x16", print::print(sllw, 0)); + assert_eq!("srlw x28, x17, x16", print::print(srlw, 0)); + assert_eq!("sraw x28, x17, x16", print::print(sraw, 0)); + } } \ No newline at end of file