summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2025-04-07 02:43:28 -0700
committeriximeow <me@iximeow.net>2025-04-07 02:43:28 -0700
commit9fcb6b30d6ccdd25d600e03ada84e6b17efffed7 (patch)
tree16b5b37c492564f6610c0df84716c94e71adad9b /src/lib.rs
parent31b97c00c38da0a2ad8995377ac36c9f7d0cbc60 (diff)
more test coverage, getting close..
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib.rs b/src/lib.rs
index fcffc1b..90c87e0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -5811,8 +5811,6 @@ fn decode_instruction<
handler.on_source_decoded(Operand::gpr(ttttt))?;
- eprintln!("opc: {:05b}", opc);
-
static OPCODES: [Option<Opcode>; 64] = [
Some(Mpy), Some(Cmpyi), Some(Cmpyr), None, None, None, None, None,
None, None, None, None, None, None, None, None,
@@ -6081,7 +6079,6 @@ fn decode_instruction<
handler.saturate()?;
}
- eprintln!("ok op_lo: {:02b}, opc: {:05b}", op_lo, opc);
if (op_lo & 0b11) == 0b00 {
handler.on_source_decoded(Operand::gprpair(ttttt)?)?;
handler.on_source_decoded(Operand::gprpair(sssss)?)?;
@@ -6444,6 +6441,8 @@ fn decode_instruction<
0b101 => {
handler.on_opcode_decoded(Opcode::Mpy)?;
handler.on_source_decoded(Operand::gpr_low(reg_b8(inst)))?;
+ handler.shift_left(1)?;
+ handler.saturate()?;
}
_ => {
opcode_check!(false);
@@ -6471,9 +6470,10 @@ fn decode_instruction<
}
0b110 => {
opcode_check!(op_hi & 0b001 == 0b001);
+ handler.on_opcode_decoded(Opcode::Cmpy)?;
handler.shift_left(op_hi >> 2)?;
if op_hi & 0b010 == 0 {
- handler.on_dest_decoded(Operand::gpr(reg_b8(inst)))?;
+ handler.on_source_decoded(Operand::gpr(reg_b8(inst)))?;
} else {
handler.on_source_decoded(Operand::gpr_conjugate(reg_b8(inst)))?;
}
@@ -6482,8 +6482,10 @@ fn decode_instruction<
}
0b111 => {
opcode_check!(op_hi & 0b011 == 0b001);
- handler.on_opcode_decoded(Opcode::Vcmpyh)?;
- handler.on_dest_decoded(Operand::gpr(reg_b8(inst)))?;
+ handler.on_opcode_decoded(Opcode::Vmpyh)?;
+ handler.shift_left(op_hi >> 2)?;
+ handler.on_dest_decoded(Operand::gpr(reg_b0(inst)))?;
+ handler.on_source_decoded(Operand::gpr(reg_b8(inst)))?;
handler.rounded(RoundingMode::Round)?;
handler.saturate()?;
}