()
| 82 | |
| 83 | #[test] |
| 84 | fn 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] |
| 96 | fn decode_lw() { |