Applies a binary double predicate using `parse` to decode the instruction and `op` to compute the result.
(
&mut self,
instr: u32,
parse: fn(u32) -> (Register, Register, Register),
op: F,
)
| 501 | /// Applies a binary double predicate using `parse` to decode the instruction and `op` to |
| 502 | /// compute the result. |
| 503 | fn do_binary_double_predicate_op<F>( |
| 504 | &mut self, |
| 505 | instr: u32, |
| 506 | parse: fn(u32) -> (Register, Register, Register), |
| 507 | op: F, |
| 508 | ) where |
| 509 | F: Fn(f64, f64) -> bool, |
| 510 | { |
| 511 | let (dest, src1, src2) = parse(instr); |
| 512 | let lhs = f64::from_bits(self.get_reg(src1)); |
| 513 | let rhs = f64::from_bits(self.get_reg(src2)); |
| 514 | self.set_reg(dest, if op(lhs, rhs) { 1 } else { 0 }); |
| 515 | self.pc += 1; |
| 516 | } |
| 517 | |
| 518 | /// Applies a binary integer operation using `parse` to decode the instruction and `op` to |
| 519 | /// compute the result. `op` returns `Err` with a message on failure. |
no test coverage detected