Applies a binary double operation using `parse` to decode the instruction and `op` to compute the result.
(
&mut self,
instr: u32,
parse: fn(u32) -> (Register, Register, Register),
op: F,
)
| 484 | /// Applies a binary double operation using `parse` to decode the instruction and `op` to |
| 485 | /// compute the result. |
| 486 | fn do_binary_double_op<F>( |
| 487 | &mut self, |
| 488 | instr: u32, |
| 489 | parse: fn(u32) -> (Register, Register, Register), |
| 490 | op: F, |
| 491 | ) where |
| 492 | F: Fn(f64, f64) -> f64, |
| 493 | { |
| 494 | let (dest, src1, src2) = parse(instr); |
| 495 | let lhs = f64::from_bits(self.get_reg(src1)); |
| 496 | let rhs = f64::from_bits(self.get_reg(src2)); |
| 497 | self.set_reg(dest, op(lhs, rhs).to_bits()); |
| 498 | self.pc += 1; |
| 499 | } |
| 500 | |
| 501 | /// Applies a binary double predicate using `parse` to decode the instruction and `op` to |
| 502 | /// compute the result. |
no test coverage detected