summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/display.rs5
-rw-r--r--src/lib.rs9
-rw-r--r--tests/from_brain.rs4
3 files changed, 10 insertions, 8 deletions
diff --git a/src/display.rs b/src/display.rs
index 352ff3f..5ce3d80 100644
--- a/src/display.rs
+++ b/src/display.rs
@@ -146,6 +146,11 @@ impl fmt::Display for Instruction {
return write!(f, "{} = add(clb({}), {})", self.dest.as_ref().unwrap(),
self.sources[0], self.sources[1]);
}
+ Opcode::SfRecipa => {
+ return write!(f, "{}, {} = {}({}, {})",
+ self.dest.as_ref().unwrap(), self.alt_dest.as_ref().unwrap(),
+ self.opcode, self.sources[0], self.sources[1]);
+ }
Opcode::SfInvsqrta => {
return write!(f, "{}, {} = {}({})",
self.dest.as_ref().unwrap(), self.alt_dest.as_ref().unwrap(),
diff --git a/src/lib.rs b/src/lib.rs
index 90c87e0..2e1aa74 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -787,7 +787,6 @@ pub enum Opcode {
SfFixupr,
SfFixupn,
SfFixupd,
- SfRecipa,
Swiz,
Shuffeb,
Shuffob,
@@ -851,6 +850,7 @@ pub enum Opcode {
AddClb,
AddAdd,
AddSub,
+ SfRecipa,
SfInvsqrta,
Any8VcmpbEq,
@@ -6025,12 +6025,11 @@ fn decode_instruction<
handler.rounded(RoundingMode::Round)?;
}
0b1000 => {
- handler.on_opcode_decoded(Vmpywoh)?;
- handler.saturate()?;
- handler.rounded(RoundingMode::Round)?;
+ handler.on_opcode_decoded(Vrmpywoh)?;
}
0b1001 => {
- handler.on_opcode_decoded(Vrmpywoh)?;
+ handler.on_opcode_decoded(Vmpyweuh)?;
+ handler.saturate()?;
}
0b1010 => {
handler.on_opcode_decoded(Vcmpyi)?;
diff --git a/tests/from_brain.rs b/tests/from_brain.rs
index fdf52b4..3f26ad6 100644
--- a/tests/from_brain.rs
+++ b/tests/from_brain.rs
@@ -1563,7 +1563,6 @@ fn inst_1110() {
test_display(&0b1110_1000_101_10100_11_000110_100_10110u32.to_le_bytes(), "{ R23:22 = vrcmpys(R21:20, R7:6):<<1:sat:raw:hi }");
test_display(&0b1110_1000_111_10100_11_000110_100_10110u32.to_le_bytes(), "{ R23:22 = vrcmpys(R21:20, R7:6):<<1:sat:raw:lo }");
- /*
test_display(&0b1110_1000_000_10100_11_000110_100_10110u32.to_le_bytes(), "{ R23:22 = vdmpy(R21:20, R7:6):sat }");
test_display(&0b1110_1000_000_10100_11_000110_101_10110u32.to_le_bytes(), "{ R23:22 = vmpyweh(R21:20, R7:6):sat }");
test_display(&0b1110_1000_000_10100_11_000110_110_10110u32.to_le_bytes(), "{ R23:22 = vmpyeh(R21:20, R7:6):sat }");
@@ -1578,7 +1577,6 @@ fn inst_1110() {
test_display(&0b1110_1000_010_10100_11_000110_111_10110u32.to_le_bytes(), "{ R23:22 = vmpywouh(R21:20, R7:6):sat }");
test_display(&0b1110_1000_011_10100_11_000110_101_10110u32.to_le_bytes(), "{ R23:22 = vmpyweuh(R21:20, R7:6):rnd:sat }");
test_display(&0b1110_1000_011_10100_11_000110_111_10110u32.to_le_bytes(), "{ R23:22 = vmpywouh(R21:20, R7:6):rnd:sat }");
- */
test_invalid(&0b1110_1011_000_10100_11_000110_000_10110u32.to_le_bytes(), DecodeError::InvalidOpcode);
test_display(&0b1110_1011_000_10100_11_000110_001_10110u32.to_le_bytes(), "{ R22 = sfsub(R20, R6) }");
@@ -1588,7 +1586,7 @@ fn inst_1110() {
test_display(&0b1110_1011_100_10100_11_000110_001_10110u32.to_le_bytes(), "{ R22 = sfmin(R20, R6) }");
test_display(&0b1110_1011_110_10100_11_000110_000_10110u32.to_le_bytes(), "{ R22 = sffixupn(R20, R6) }");
test_display(&0b1110_1011_110_10100_11_000110_001_10110u32.to_le_bytes(), "{ R22 = sffixupd(R20, R6) }");
- test_display(&0b1110_1011_111_10100_11_000110_101_10110u32.to_le_bytes(), "{ R22,P1 = sfrecipa(R20, R6) }");
+ test_display(&0b1110_1011_111_10100_11_000110_101_10110u32.to_le_bytes(), "{ R22, P1 = sfrecipa(R20, R6) }");
test_display(&0b1110_1100_000_10100_11_000110_000_10110u32.to_le_bytes(), "{ R22 = mpy(R20.L, R6.L) }");
test_display(&0b1110_1100_000_10100_11_000110_001_10110u32.to_le_bytes(), "{ R22 = mpy(R20.L, R6.H) }");