MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / decode_mul

Function decode_mul

crates/virtual-machine/tests/vm_decoder.rs:84–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

82
83#[test]
84fn decode_mul() {
85 let encoded = Mul::new(3, 1, 2).encode();
86 let decoded = decode(encoded).expect("should decode MUL");
87 if let DecodedInsn::Alu { funct7, funct3, .. } = decoded {
88 assert_eq!(funct7, 0x01, "MUL funct7 must be 0x01");
89 assert_eq!(funct3, 0);
90 } else {
91 panic!("expected DecodedInsn::Alu, got {decoded:?}");
92 }
93}
94
95#[test]
96fn decode_lw() {

Callers

nothing calls this directly

Calls 2

decodeFunction · 0.50
encodeMethod · 0.45

Tested by

no test coverage detected