add of the test function for opwi instructions

This commit is contained in:
AmauryBrodu 2022-11-10 00:39:11 +01:00
parent 5a5afda8be
commit 3b9a23948a

View File

@ -339,5 +339,15 @@ mod test {
assert_eq!("sraw x28, x17, x16", print::print(sraw, 0)); assert_eq!("sraw x28, x17, x16", print::print(sraw, 0));
} }
#[test]
fn test_opwi() {
let addwi: decode::Instruction =decode::decode(0b000000000000_10001_000_11100_0011011);
let sllwi: decode::Instruction = decode::decode(0b0000000_10000_10001_001_11100_0011011);
let srai: decode::Instruction = decode::decode(0b010000010001_10001_101_11100_0010011);
assert_eq!("addwi x28, x17, x0", print::print(addwi, 0));
assert_eq!("slli x28, x17, x16", print::print(sllwi, 0));
assert_eq!("srai x28, x17, 17", print::print(srai, 0));
}
} }