}
}
+create_instr_variants_ov_cr!(subf, subfo, subf_, subfo_, i64);
+
+pub fn subfo(inputs: InstructionInput) -> InstructionResult {
+ let ra = inputs.ra as i64;
+ let rb = inputs.rb as i64;
+ let (result, ov) = rb.overflowing_sub(ra);
+ let result = result as u64;
+ let ov32 = (rb as i32).overflowing_sub(ra as i32).1;
+ InstructionResult {
+ rt: Some(result),
+ overflow: Some(OverflowFlags { so: ov, ov, ov32 }),
+ ..InstructionResult::default()
+ }
+}
+
create_instr_variants_ov_cr!(divde, divdeo, divde_, divdeo_, i64);
pub fn divdeo(inputs: InstructionInput) -> InstructionResult {
"addo."
}
+ // subf
+ #[enumerant = SubF]
+ fn subf(ra, rb) -> (rt) {
+ "subf"
+ }
+ #[enumerant = SubFO]
+ fn subfo(ra, rb) -> (rt, ov) {
+ "subfo"
+ }
+ #[enumerant = SubF_]
+ fn subf_(ra, rb) -> (rt, cr0) {
+ "subf."
+ }
+ #[enumerant = SubFO_]
+ fn subfo_(ra, rb) -> (rt, ov, cr0) {
+ "subfo."
+ }
+
// divde
#[enumerant = DivDE]
fn divde(ra, rb) -> (rt) {