()
| 71 | |
| 72 | #[test] |
| 73 | fn decode_sub() { |
| 74 | let encoded = Sub::new(3, 1, 2).encode(); |
| 75 | let decoded = decode(encoded).expect("should decode SUB"); |
| 76 | if let DecodedInsn::Alu { funct7, .. } = decoded { |
| 77 | assert_eq!(funct7, 0x20, "SUB funct7 must be 0x20"); |
| 78 | } else { |
| 79 | panic!("expected DecodedInsn::Alu, got {decoded:?}"); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | #[test] |
| 84 | fn decode_mul() { |