..InstructionOutput::default()
})
}
+
+pub fn cmpldi(inputs: InstructionInput) -> InstructionResult {
+ let ra = inputs.try_get_ra()? as u64;
+ let immediate = inputs.try_get_immediate_u16()? as u64;
+ let so = inputs.try_get_overflow()?.so;
+ let cr0 = ConditionRegister::from_ordering(ra.cmp(&immediate), so);
+ Ok(InstructionOutput {
+ cr0: Some(cr0),
+ ..InstructionOutput::default()
+ })
+}
+
+pub fn cmplwi(inputs: InstructionInput) -> InstructionResult {
+ let ra = inputs.try_get_ra()? as u32;
+ let immediate = inputs.try_get_immediate_u16()? as u32;
+ let so = inputs.try_get_overflow()?.so;
+ let cr0 = ConditionRegister::from_ordering(ra.cmp(&immediate), so);
+ Ok(InstructionOutput {
+ cr0: Some(cr0),
+ ..InstructionOutput::default()
+ })
+}
fn cmpwi(Ra, ImmediateS16, Overflow) -> (CR0) {
"cmpwi"
}
+
+ // cmpli
+ #[enumerant = CmpLDI]
+ fn cmpldi(Ra, ImmediateU16, Overflow) -> (CR0) {
+ "cmpldi"
+ }
+ #[enumerant = CmpLWI]
+ fn cmplwi(Ra, ImmediateU16, Overflow) -> (CR0) {
+ "cmplwi"
+ }
}
// must be after instrs macro call since it uses a macro definition