ajout des test des instructions opw

This commit is contained in:
AmauryBrodu 2022-11-10 00:16:21 +01:00
parent c1e188df22
commit 5a5afda8be

View File

@ -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));
}
}