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