..InstructionOutput::default()
})
}
+
+pub fn cmprb_0(inputs: InstructionInput) -> InstructionResult {
+ let ra = inputs.try_get_ra()? as u8;
+ let rb: u64 = inputs.try_get_rb()?;
+ let eq = ra >= rb as u8 && ra <= (rb >> 8) as u8;
+ let cr0 = ConditionRegister {
+ lt: false,
+ gt: false,
+ eq,
+ so: false,
+ };
+ Ok(InstructionOutput {
+ cr0: Some(cr0),
+ ..InstructionOutput::default()
+ })
+}
fn cmplw(Ra, Rb, Overflow) -> (CR0) {
"cmplw"
}
+
+ // cmprb 0, 0, ..., ...
+ #[enumerant = CmpRB0]
+ fn cmprb_0(Ra, Rb) -> (CR0) {
+ "cmprb 0, 0,"
+ }
}
// must be after instrs macro call since it uses a macro definition
0x7FFF,
0x8000,
0x8001,
+ // picked for cmprb
+ 0xFFED_CBA9_8765_4321,
+ // last byte of next 12 tests limits of ranges for cmprb
+ 0x85AE_16A6_0C1A_0E1F,
+ 0xCF24_50C7_9E7E_DF20,
+ 0xD486_2724_930B_9021,
+ 0xDDBA_3880_8588_DF42,
+ 0x1F07_F322_68FE_5C43,
+ 0x739D_46C6_1E05_AE44,
+ 0xA131_E014_B201_9064,
+ 0xC70D_BC09_C48A_C665,
+ 0x1D61_5696_5920_E966,
+ 0x70F1_F260_8938_4486,
+ 0xEF25_5D74_1B45_CA87,
+ 0x3C54_DFA8_C006_5688,
];
const IMMED16_TEST_VALUES: &[u16] = &[