From 1cd10e3214c14a8f4c834748f322599c6185608f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 7 Feb 2021 12:27:40 -0500 Subject: [PATCH 01/11] thumb32: Implement SMULXY --- src/frontend/A32/decoder/thumb32.inc | 2 +- .../A32/translate/impl/thumb32_multiply.cpp | 17 +++++++++++++++++ .../A32/translate/impl/translate_thumb.h | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/frontend/A32/decoder/thumb32.inc b/src/frontend/A32/decoder/thumb32.inc index 63b1942b..b4f21d61 100644 --- a/src/frontend/A32/decoder/thumb32.inc +++ b/src/frontend/A32/decoder/thumb32.inc @@ -264,7 +264,7 @@ INST(thumb32_CLZ, "CLZ", "111110101011nnnn1111dd INST(thumb32_MUL, "MUL", "111110110000nnnn1111dddd0000mmmm") INST(thumb32_MLA, "MLA", "111110110000nnnnaaaadddd0000mmmm") INST(thumb32_MLS, "MLS", "111110110000nnnnaaaadddd0001mmmm") -//INST(thumb32_SMULXY, "SMULXY", "111110110001----1111----00------") +INST(thumb32_SMULXY, "SMULXY", "111110110001nnnn1111dddd00NMmmmm") //INST(thumb32_SMLAXY, "SMLAXY", "111110110001------------00------") //INST(thumb32_SMUAD, "SMUAD", "111110110010----1111----000-----") //INST(thumb32_SMLAD, "SMLAD", "111110110010------------000-----") diff --git a/src/frontend/A32/translate/impl/thumb32_multiply.cpp b/src/frontend/A32/translate/impl/thumb32_multiply.cpp index ecaee5a7..b83493e6 100644 --- a/src/frontend/A32/translate/impl/thumb32_multiply.cpp +++ b/src/frontend/A32/translate/impl/thumb32_multiply.cpp @@ -48,6 +48,23 @@ bool ThumbTranslatorVisitor::thumb32_MUL(Reg n, Reg d, Reg m) { return true; } +bool ThumbTranslatorVisitor::thumb32_SMULXY(Reg n, Reg d, bool N, bool M, Reg m) { + if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { + return UnpredictableInstruction(); + } + + const auto n32 = ir.GetRegister(n); + const auto m32 = ir.GetRegister(m); + const auto n16 = N ? ir.ArithmeticShiftRight(n32, ir.Imm8(16), ir.Imm1(0)).result + : ir.SignExtendHalfToWord(ir.LeastSignificantHalf(n32)); + const auto m16 = M ? ir.ArithmeticShiftRight(m32, ir.Imm8(16), ir.Imm1(0)).result + : ir.SignExtendHalfToWord(ir.LeastSignificantHalf(m32)); + const auto result = ir.Mul(n16, m16); + + ir.SetRegister(d, result); + return true; +} + bool ThumbTranslatorVisitor::thumb32_USAD8(Reg n, Reg d, Reg m) { if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); diff --git a/src/frontend/A32/translate/impl/translate_thumb.h b/src/frontend/A32/translate/impl/translate_thumb.h index 0e61f58c..3cd40693 100644 --- a/src/frontend/A32/translate/impl/translate_thumb.h +++ b/src/frontend/A32/translate/impl/translate_thumb.h @@ -132,6 +132,7 @@ struct ThumbTranslatorVisitor final { bool thumb32_MLA(Reg n, Reg a, Reg d, Reg m); bool thumb32_MLS(Reg n, Reg a, Reg d, Reg m); bool thumb32_MUL(Reg n, Reg d, Reg m); + bool thumb32_SMULXY(Reg n, Reg d, bool N, bool M, Reg m); bool thumb32_USAD8(Reg n, Reg d, Reg m); bool thumb32_USADA8(Reg n, Reg a, Reg d, Reg m); From 1e0623157542ba7269ac7283e4c1964f564a9c6f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 7 Feb 2021 12:36:18 -0500 Subject: [PATCH 02/11] thumb32: Implement SMLAXY --- src/frontend/A32/decoder/thumb32.inc | 2 +- .../A32/translate/impl/thumb32_multiply.cpp | 25 ++++++++++++++++--- .../A32/translate/impl/translate_thumb.h | 1 + 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/frontend/A32/decoder/thumb32.inc b/src/frontend/A32/decoder/thumb32.inc index b4f21d61..1dfb48c5 100644 --- a/src/frontend/A32/decoder/thumb32.inc +++ b/src/frontend/A32/decoder/thumb32.inc @@ -265,7 +265,7 @@ INST(thumb32_MUL, "MUL", "111110110000nnnn1111dd INST(thumb32_MLA, "MLA", "111110110000nnnnaaaadddd0000mmmm") INST(thumb32_MLS, "MLS", "111110110000nnnnaaaadddd0001mmmm") INST(thumb32_SMULXY, "SMULXY", "111110110001nnnn1111dddd00NMmmmm") -//INST(thumb32_SMLAXY, "SMLAXY", "111110110001------------00------") +INST(thumb32_SMLAXY, "SMLAXY", "111110110001nnnnaaaadddd00NMmmmm") //INST(thumb32_SMUAD, "SMUAD", "111110110010----1111----000-----") //INST(thumb32_SMLAD, "SMLAD", "111110110010------------000-----") //INST(thumb32_SMULWY, "SMULWY", "111110110011----1111----000-----") diff --git a/src/frontend/A32/translate/impl/thumb32_multiply.cpp b/src/frontend/A32/translate/impl/thumb32_multiply.cpp index b83493e6..e34c5780 100644 --- a/src/frontend/A32/translate/impl/thumb32_multiply.cpp +++ b/src/frontend/A32/translate/impl/thumb32_multiply.cpp @@ -8,7 +8,7 @@ namespace Dynarmic::A32 { bool ThumbTranslatorVisitor::thumb32_MLA(Reg n, Reg a, Reg d, Reg m) { - if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { + if (d == Reg::PC || n == Reg::PC || m == Reg::PC || a == Reg::PC) { return UnpredictableInstruction(); } @@ -22,7 +22,7 @@ bool ThumbTranslatorVisitor::thumb32_MLA(Reg n, Reg a, Reg d, Reg m) { } bool ThumbTranslatorVisitor::thumb32_MLS(Reg n, Reg a, Reg d, Reg m) { - if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { + if (d == Reg::PC || n == Reg::PC || m == Reg::PC || a == Reg::PC) { return UnpredictableInstruction(); } @@ -48,6 +48,25 @@ bool ThumbTranslatorVisitor::thumb32_MUL(Reg n, Reg d, Reg m) { return true; } +bool ThumbTranslatorVisitor::thumb32_SMLAXY(Reg n, Reg a, Reg d, bool N, bool M, Reg m) { + if (d == Reg::PC || n == Reg::PC || m == Reg::PC || a == Reg::PC) { + return UnpredictableInstruction(); + } + + const IR::U32 n32 = ir.GetRegister(n); + const IR::U32 m32 = ir.GetRegister(m); + const IR::U32 n16 = N ? ir.ArithmeticShiftRight(n32, ir.Imm8(16), ir.Imm1(0)).result + : ir.SignExtendHalfToWord(ir.LeastSignificantHalf(n32)); + const IR::U32 m16 = M ? ir.ArithmeticShiftRight(m32, ir.Imm8(16), ir.Imm1(0)).result + : ir.SignExtendHalfToWord(ir.LeastSignificantHalf(m32)); + const IR::U32 product = ir.Mul(n16, m16); + const auto result_overflow = ir.AddWithCarry(product, ir.GetRegister(a), ir.Imm1(0)); + + ir.SetRegister(d, result_overflow.result); + ir.OrQFlag(result_overflow.overflow); + return true; +} + bool ThumbTranslatorVisitor::thumb32_SMULXY(Reg n, Reg d, bool N, bool M, Reg m) { if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); @@ -79,7 +98,7 @@ bool ThumbTranslatorVisitor::thumb32_USAD8(Reg n, Reg d, Reg m) { } bool ThumbTranslatorVisitor::thumb32_USADA8(Reg n, Reg a, Reg d, Reg m) { - if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { + if (d == Reg::PC || n == Reg::PC || m == Reg::PC || a == Reg::PC) { return UnpredictableInstruction(); } diff --git a/src/frontend/A32/translate/impl/translate_thumb.h b/src/frontend/A32/translate/impl/translate_thumb.h index 3cd40693..86fce434 100644 --- a/src/frontend/A32/translate/impl/translate_thumb.h +++ b/src/frontend/A32/translate/impl/translate_thumb.h @@ -132,6 +132,7 @@ struct ThumbTranslatorVisitor final { bool thumb32_MLA(Reg n, Reg a, Reg d, Reg m); bool thumb32_MLS(Reg n, Reg a, Reg d, Reg m); bool thumb32_MUL(Reg n, Reg d, Reg m); + bool thumb32_SMLAXY(Reg n, Reg a, Reg d, bool N, bool M, Reg m); bool thumb32_SMULXY(Reg n, Reg d, bool N, bool M, Reg m); bool thumb32_USAD8(Reg n, Reg d, Reg m); bool thumb32_USADA8(Reg n, Reg a, Reg d, Reg m); From 4d9a7308ac0b5a883b7f9451b3c78fd00bfd1d0a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 7 Feb 2021 13:04:18 -0500 Subject: [PATCH 03/11] thumb32: Implement SMUAD --- src/frontend/A32/decoder/thumb32.inc | 2 +- .../A32/translate/impl/thumb32_multiply.cpp | 25 +++++++++++++++++++ .../A32/translate/impl/translate_thumb.h | 1 + 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/frontend/A32/decoder/thumb32.inc b/src/frontend/A32/decoder/thumb32.inc index 1dfb48c5..f08efe2d 100644 --- a/src/frontend/A32/decoder/thumb32.inc +++ b/src/frontend/A32/decoder/thumb32.inc @@ -266,7 +266,7 @@ INST(thumb32_MLA, "MLA", "111110110000nnnnaaaadd INST(thumb32_MLS, "MLS", "111110110000nnnnaaaadddd0001mmmm") INST(thumb32_SMULXY, "SMULXY", "111110110001nnnn1111dddd00NMmmmm") INST(thumb32_SMLAXY, "SMLAXY", "111110110001nnnnaaaadddd00NMmmmm") -//INST(thumb32_SMUAD, "SMUAD", "111110110010----1111----000-----") +INST(thumb32_SMUAD, "SMUAD", "111110110010nnnn1111dddd000Mmmmm") //INST(thumb32_SMLAD, "SMLAD", "111110110010------------000-----") //INST(thumb32_SMULWY, "SMULWY", "111110110011----1111----000-----") //INST(thumb32_SMLAWY, "SMLAWY", "111110110011------------000-----") diff --git a/src/frontend/A32/translate/impl/thumb32_multiply.cpp b/src/frontend/A32/translate/impl/thumb32_multiply.cpp index e34c5780..e8a383c8 100644 --- a/src/frontend/A32/translate/impl/thumb32_multiply.cpp +++ b/src/frontend/A32/translate/impl/thumb32_multiply.cpp @@ -67,6 +67,31 @@ bool ThumbTranslatorVisitor::thumb32_SMLAXY(Reg n, Reg a, Reg d, bool N, bool M, return true; } +bool ThumbTranslatorVisitor::thumb32_SMUAD(Reg n, Reg d, bool M, Reg m) { + if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { + return UnpredictableInstruction(); + } + + const IR::U32 n32 = ir.GetRegister(n); + const IR::U32 m32 = ir.GetRegister(m); + const IR::U32 n_lo = ir.SignExtendHalfToWord(ir.LeastSignificantHalf(n32)); + const IR::U32 n_hi = ir.ArithmeticShiftRight(n32, ir.Imm8(16), ir.Imm1(0)).result; + + IR::U32 m_lo = ir.SignExtendHalfToWord(ir.LeastSignificantHalf(m32)); + IR::U32 m_hi = ir.ArithmeticShiftRight(m32, ir.Imm8(16), ir.Imm1(0)).result; + if (M) { + std::swap(m_lo, m_hi); + } + + const IR::U32 product_lo = ir.Mul(n_lo, m_lo); + const IR::U32 product_hi = ir.Mul(n_hi, m_hi); + const auto result_overflow = ir.AddWithCarry(product_lo, product_hi, ir.Imm1(0)); + + ir.SetRegister(d, result_overflow.result); + ir.OrQFlag(result_overflow.overflow); + return true; +} + bool ThumbTranslatorVisitor::thumb32_SMULXY(Reg n, Reg d, bool N, bool M, Reg m) { if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); diff --git a/src/frontend/A32/translate/impl/translate_thumb.h b/src/frontend/A32/translate/impl/translate_thumb.h index 86fce434..18c178c4 100644 --- a/src/frontend/A32/translate/impl/translate_thumb.h +++ b/src/frontend/A32/translate/impl/translate_thumb.h @@ -133,6 +133,7 @@ struct ThumbTranslatorVisitor final { bool thumb32_MLS(Reg n, Reg a, Reg d, Reg m); bool thumb32_MUL(Reg n, Reg d, Reg m); bool thumb32_SMLAXY(Reg n, Reg a, Reg d, bool N, bool M, Reg m); + bool thumb32_SMUAD(Reg n, Reg d, bool M, Reg m); bool thumb32_SMULXY(Reg n, Reg d, bool N, bool M, Reg m); bool thumb32_USAD8(Reg n, Reg d, Reg m); bool thumb32_USADA8(Reg n, Reg a, Reg d, Reg m); From 44f4f437a7f0290a70dfd3d9f8313f6c9f6eacfb Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 7 Feb 2021 13:07:07 -0500 Subject: [PATCH 04/11] thumb32: Implement SMUSD --- src/frontend/A32/decoder/thumb32.inc | 2 +- .../A32/translate/impl/thumb32_multiply.cpp | 24 +++++++++++++++++++ .../A32/translate/impl/translate_thumb.h | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/frontend/A32/decoder/thumb32.inc b/src/frontend/A32/decoder/thumb32.inc index f08efe2d..0eab526a 100644 --- a/src/frontend/A32/decoder/thumb32.inc +++ b/src/frontend/A32/decoder/thumb32.inc @@ -270,7 +270,7 @@ INST(thumb32_SMUAD, "SMUAD", "111110110010nnnn1111dd //INST(thumb32_SMLAD, "SMLAD", "111110110010------------000-----") //INST(thumb32_SMULWY, "SMULWY", "111110110011----1111----000-----") //INST(thumb32_SMLAWY, "SMLAWY", "111110110011------------000-----") -//INST(thumb32_SMUSD, "SMUSD", "111110110100----1111----000-----") +INST(thumb32_SMUSD, "SMUSD", "111110110100nnnn1111dddd000Mmmmm") //INST(thumb32_SMLSD, "SMLSD", "111110110100------------000-----") //INST(thumb32_SMMUL, "SMMUL", "111110110101----1111----000-----") //INST(thumb32_SMMLA, "SMMLA", "111110110101------------000-----") diff --git a/src/frontend/A32/translate/impl/thumb32_multiply.cpp b/src/frontend/A32/translate/impl/thumb32_multiply.cpp index e8a383c8..5110353d 100644 --- a/src/frontend/A32/translate/impl/thumb32_multiply.cpp +++ b/src/frontend/A32/translate/impl/thumb32_multiply.cpp @@ -92,6 +92,30 @@ bool ThumbTranslatorVisitor::thumb32_SMUAD(Reg n, Reg d, bool M, Reg m) { return true; } +bool ThumbTranslatorVisitor::thumb32_SMUSD(Reg n, Reg d, bool M, Reg m) { + if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { + return UnpredictableInstruction(); + } + + const IR::U32 n32 = ir.GetRegister(n); + const IR::U32 m32 = ir.GetRegister(m); + const IR::U32 n_lo = ir.SignExtendHalfToWord(ir.LeastSignificantHalf(n32)); + const IR::U32 n_hi = ir.ArithmeticShiftRight(n32, ir.Imm8(16), ir.Imm1(0)).result; + + IR::U32 m_lo = ir.SignExtendHalfToWord(ir.LeastSignificantHalf(m32)); + IR::U32 m_hi = ir.ArithmeticShiftRight(m32, ir.Imm8(16), ir.Imm1(0)).result; + if (M) { + std::swap(m_lo, m_hi); + } + + const IR::U32 product_lo = ir.Mul(n_lo, m_lo); + const IR::U32 product_hi = ir.Mul(n_hi, m_hi); + const IR::U32 result = ir.Sub(product_lo, product_hi); + + ir.SetRegister(d, result); + return true; +} + bool ThumbTranslatorVisitor::thumb32_SMULXY(Reg n, Reg d, bool N, bool M, Reg m) { if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); diff --git a/src/frontend/A32/translate/impl/translate_thumb.h b/src/frontend/A32/translate/impl/translate_thumb.h index 18c178c4..115ebd3b 100644 --- a/src/frontend/A32/translate/impl/translate_thumb.h +++ b/src/frontend/A32/translate/impl/translate_thumb.h @@ -134,6 +134,7 @@ struct ThumbTranslatorVisitor final { bool thumb32_MUL(Reg n, Reg d, Reg m); bool thumb32_SMLAXY(Reg n, Reg a, Reg d, bool N, bool M, Reg m); bool thumb32_SMUAD(Reg n, Reg d, bool M, Reg m); + bool thumb32_SMUSD(Reg n, Reg d, bool M, Reg m); bool thumb32_SMULXY(Reg n, Reg d, bool N, bool M, Reg m); bool thumb32_USAD8(Reg n, Reg d, Reg m); bool thumb32_USADA8(Reg n, Reg a, Reg d, Reg m); From b6add0ddf445afcb3c53f50b640c6e068bdddf8a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 7 Feb 2021 13:11:25 -0500 Subject: [PATCH 05/11] thumb32: Implement SMMUL{R} --- src/frontend/A32/decoder/thumb32.inc | 2 +- .../A32/translate/impl/thumb32_multiply.cpp | 18 ++++++++++++++++++ .../A32/translate/impl/translate_thumb.h | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/frontend/A32/decoder/thumb32.inc b/src/frontend/A32/decoder/thumb32.inc index 0eab526a..37e0cc88 100644 --- a/src/frontend/A32/decoder/thumb32.inc +++ b/src/frontend/A32/decoder/thumb32.inc @@ -272,7 +272,7 @@ INST(thumb32_SMUAD, "SMUAD", "111110110010nnnn1111dd //INST(thumb32_SMLAWY, "SMLAWY", "111110110011------------000-----") INST(thumb32_SMUSD, "SMUSD", "111110110100nnnn1111dddd000Mmmmm") //INST(thumb32_SMLSD, "SMLSD", "111110110100------------000-----") -//INST(thumb32_SMMUL, "SMMUL", "111110110101----1111----000-----") +INST(thumb32_SMMUL, "SMMUL", "111110110101nnnn1111dddd000Mmmmm") //INST(thumb32_SMMLA, "SMMLA", "111110110101------------000-----") //INST(thumb32_SMMLS, "SMMLS", "111110110110------------000-----") INST(thumb32_USAD8, "USAD8", "111110110111nnnn1111dddd0000mmmm") diff --git a/src/frontend/A32/translate/impl/thumb32_multiply.cpp b/src/frontend/A32/translate/impl/thumb32_multiply.cpp index 5110353d..ab071ba9 100644 --- a/src/frontend/A32/translate/impl/thumb32_multiply.cpp +++ b/src/frontend/A32/translate/impl/thumb32_multiply.cpp @@ -67,6 +67,24 @@ bool ThumbTranslatorVisitor::thumb32_SMLAXY(Reg n, Reg a, Reg d, bool N, bool M, return true; } +bool ThumbTranslatorVisitor::thumb32_SMMUL(Reg n, Reg d, bool R, Reg m) { + if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { + return UnpredictableInstruction(); + } + + const auto n64 = ir.SignExtendWordToLong(ir.GetRegister(n)); + const auto m64 = ir.SignExtendWordToLong(ir.GetRegister(m)); + const auto product = ir.Mul(n64, m64); + const auto result_carry = ir.MostSignificantWord(product); + auto result = result_carry.result; + if (R) { + result = ir.AddWithCarry(result, ir.Imm32(0), result_carry.carry).result; + } + + ir.SetRegister(d, result); + return true; +} + bool ThumbTranslatorVisitor::thumb32_SMUAD(Reg n, Reg d, bool M, Reg m) { if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); diff --git a/src/frontend/A32/translate/impl/translate_thumb.h b/src/frontend/A32/translate/impl/translate_thumb.h index 115ebd3b..f68568dd 100644 --- a/src/frontend/A32/translate/impl/translate_thumb.h +++ b/src/frontend/A32/translate/impl/translate_thumb.h @@ -133,6 +133,7 @@ struct ThumbTranslatorVisitor final { bool thumb32_MLS(Reg n, Reg a, Reg d, Reg m); bool thumb32_MUL(Reg n, Reg d, Reg m); bool thumb32_SMLAXY(Reg n, Reg a, Reg d, bool N, bool M, Reg m); + bool thumb32_SMMUL(Reg n, Reg d, bool R, Reg m); bool thumb32_SMUAD(Reg n, Reg d, bool M, Reg m); bool thumb32_SMUSD(Reg n, Reg d, bool M, Reg m); bool thumb32_SMULXY(Reg n, Reg d, bool N, bool M, Reg m); From 0c542777b0a6fc8c2fb83dba0d8d6f1fa4d2c534 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 7 Feb 2021 13:14:47 -0500 Subject: [PATCH 06/11] thumb32: Implement SMMLA{R} --- src/frontend/A32/decoder/thumb32.inc | 4 ++-- .../A32/translate/impl/thumb32_multiply.cpp | 19 +++++++++++++++++++ .../A32/translate/impl/translate_thumb.h | 1 + 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/frontend/A32/decoder/thumb32.inc b/src/frontend/A32/decoder/thumb32.inc index 37e0cc88..00701a33 100644 --- a/src/frontend/A32/decoder/thumb32.inc +++ b/src/frontend/A32/decoder/thumb32.inc @@ -272,8 +272,8 @@ INST(thumb32_SMUAD, "SMUAD", "111110110010nnnn1111dd //INST(thumb32_SMLAWY, "SMLAWY", "111110110011------------000-----") INST(thumb32_SMUSD, "SMUSD", "111110110100nnnn1111dddd000Mmmmm") //INST(thumb32_SMLSD, "SMLSD", "111110110100------------000-----") -INST(thumb32_SMMUL, "SMMUL", "111110110101nnnn1111dddd000Mmmmm") -//INST(thumb32_SMMLA, "SMMLA", "111110110101------------000-----") +INST(thumb32_SMMUL, "SMMUL", "111110110101nnnn1111dddd000Rmmmm") +INST(thumb32_SMMLA, "SMMLA", "111110110101nnnnaaaadddd000Rmmmm") //INST(thumb32_SMMLS, "SMMLS", "111110110110------------000-----") INST(thumb32_USAD8, "USAD8", "111110110111nnnn1111dddd0000mmmm") INST(thumb32_USADA8, "USADA8", "111110110111nnnnaaaadddd0000mmmm") diff --git a/src/frontend/A32/translate/impl/thumb32_multiply.cpp b/src/frontend/A32/translate/impl/thumb32_multiply.cpp index ab071ba9..7d5f4e52 100644 --- a/src/frontend/A32/translate/impl/thumb32_multiply.cpp +++ b/src/frontend/A32/translate/impl/thumb32_multiply.cpp @@ -67,6 +67,25 @@ bool ThumbTranslatorVisitor::thumb32_SMLAXY(Reg n, Reg a, Reg d, bool N, bool M, return true; } +bool ThumbTranslatorVisitor::thumb32_SMMLA(Reg n, Reg a, Reg d, bool R, Reg m) { + if (d == Reg::PC || n == Reg::PC || m == Reg::PC || a == Reg::PC) { + return UnpredictableInstruction(); + } + + const auto n64 = ir.SignExtendWordToLong(ir.GetRegister(n)); + const auto m64 = ir.SignExtendWordToLong(ir.GetRegister(m)); + const auto a64 = ir.Pack2x32To1x64(ir.Imm32(0), ir.GetRegister(a)); + const auto temp = ir.Add(a64, ir.Mul(n64, m64)); + const auto result_carry = ir.MostSignificantWord(temp); + auto result = result_carry.result; + if (R) { + result = ir.AddWithCarry(result, ir.Imm32(0), result_carry.carry).result; + } + + ir.SetRegister(d, result); + return true; +} + bool ThumbTranslatorVisitor::thumb32_SMMUL(Reg n, Reg d, bool R, Reg m) { if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); diff --git a/src/frontend/A32/translate/impl/translate_thumb.h b/src/frontend/A32/translate/impl/translate_thumb.h index f68568dd..13d4be39 100644 --- a/src/frontend/A32/translate/impl/translate_thumb.h +++ b/src/frontend/A32/translate/impl/translate_thumb.h @@ -133,6 +133,7 @@ struct ThumbTranslatorVisitor final { bool thumb32_MLS(Reg n, Reg a, Reg d, Reg m); bool thumb32_MUL(Reg n, Reg d, Reg m); bool thumb32_SMLAXY(Reg n, Reg a, Reg d, bool N, bool M, Reg m); + bool thumb32_SMMLA(Reg n, Reg a, Reg d, bool R, Reg m); bool thumb32_SMMUL(Reg n, Reg d, bool R, Reg m); bool thumb32_SMUAD(Reg n, Reg d, bool M, Reg m); bool thumb32_SMUSD(Reg n, Reg d, bool M, Reg m); From 53f1a52be9cf665242766923a808f1964b22d6b2 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 7 Feb 2021 13:23:19 -0500 Subject: [PATCH 07/11] thumb32: Implement SMMLS{R} --- src/frontend/A32/decoder/thumb32.inc | 2 +- .../A32/translate/impl/thumb32_multiply.cpp | 19 +++++++++++++++++++ .../A32/translate/impl/translate_thumb.h | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/frontend/A32/decoder/thumb32.inc b/src/frontend/A32/decoder/thumb32.inc index 00701a33..62d83ef3 100644 --- a/src/frontend/A32/decoder/thumb32.inc +++ b/src/frontend/A32/decoder/thumb32.inc @@ -274,7 +274,7 @@ INST(thumb32_SMUSD, "SMUSD", "111110110100nnnn1111dd //INST(thumb32_SMLSD, "SMLSD", "111110110100------------000-----") INST(thumb32_SMMUL, "SMMUL", "111110110101nnnn1111dddd000Rmmmm") INST(thumb32_SMMLA, "SMMLA", "111110110101nnnnaaaadddd000Rmmmm") -//INST(thumb32_SMMLS, "SMMLS", "111110110110------------000-----") +INST(thumb32_SMMLS, "SMMLS", "111110110110nnnnaaaadddd000Rmmmm") INST(thumb32_USAD8, "USAD8", "111110110111nnnn1111dddd0000mmmm") INST(thumb32_USADA8, "USADA8", "111110110111nnnnaaaadddd0000mmmm") diff --git a/src/frontend/A32/translate/impl/thumb32_multiply.cpp b/src/frontend/A32/translate/impl/thumb32_multiply.cpp index 7d5f4e52..fd7e32ef 100644 --- a/src/frontend/A32/translate/impl/thumb32_multiply.cpp +++ b/src/frontend/A32/translate/impl/thumb32_multiply.cpp @@ -86,6 +86,25 @@ bool ThumbTranslatorVisitor::thumb32_SMMLA(Reg n, Reg a, Reg d, bool R, Reg m) { return true; } +bool ThumbTranslatorVisitor::thumb32_SMMLS(Reg n, Reg a, Reg d, bool R, Reg m) { + if (d == Reg::PC || n == Reg::PC || m == Reg::PC || a == Reg::PC) { + return UnpredictableInstruction(); + } + + const auto n64 = ir.SignExtendWordToLong(ir.GetRegister(n)); + const auto m64 = ir.SignExtendWordToLong(ir.GetRegister(m)); + const auto a64 = ir.Pack2x32To1x64(ir.Imm32(0), ir.GetRegister(a)); + const auto temp = ir.Sub(a64, ir.Mul(n64, m64)); + const auto result_carry = ir.MostSignificantWord(temp); + auto result = result_carry.result; + if (R) { + result = ir.AddWithCarry(result, ir.Imm32(0), result_carry.carry).result; + } + + ir.SetRegister(d, result); + return true; +} + bool ThumbTranslatorVisitor::thumb32_SMMUL(Reg n, Reg d, bool R, Reg m) { if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); diff --git a/src/frontend/A32/translate/impl/translate_thumb.h b/src/frontend/A32/translate/impl/translate_thumb.h index 13d4be39..c8092ffd 100644 --- a/src/frontend/A32/translate/impl/translate_thumb.h +++ b/src/frontend/A32/translate/impl/translate_thumb.h @@ -134,6 +134,7 @@ struct ThumbTranslatorVisitor final { bool thumb32_MUL(Reg n, Reg d, Reg m); bool thumb32_SMLAXY(Reg n, Reg a, Reg d, bool N, bool M, Reg m); bool thumb32_SMMLA(Reg n, Reg a, Reg d, bool R, Reg m); + bool thumb32_SMMLS(Reg n, Reg a, Reg d, bool R, Reg m); bool thumb32_SMMUL(Reg n, Reg d, bool R, Reg m); bool thumb32_SMUAD(Reg n, Reg d, bool M, Reg m); bool thumb32_SMUSD(Reg n, Reg d, bool M, Reg m); From ef3b77f8ae114b7b91431ce0af525c9210a7736e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 7 Feb 2021 13:26:53 -0500 Subject: [PATCH 08/11] thumb32: Implement SMLAD{X} --- src/frontend/A32/decoder/thumb32.inc | 2 +- .../A32/translate/impl/thumb32_multiply.cpp | 29 +++++++++++++++++++ .../A32/translate/impl/translate_thumb.h | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/frontend/A32/decoder/thumb32.inc b/src/frontend/A32/decoder/thumb32.inc index 62d83ef3..1840f993 100644 --- a/src/frontend/A32/decoder/thumb32.inc +++ b/src/frontend/A32/decoder/thumb32.inc @@ -267,7 +267,7 @@ INST(thumb32_MLS, "MLS", "111110110000nnnnaaaadd INST(thumb32_SMULXY, "SMULXY", "111110110001nnnn1111dddd00NMmmmm") INST(thumb32_SMLAXY, "SMLAXY", "111110110001nnnnaaaadddd00NMmmmm") INST(thumb32_SMUAD, "SMUAD", "111110110010nnnn1111dddd000Mmmmm") -//INST(thumb32_SMLAD, "SMLAD", "111110110010------------000-----") +INST(thumb32_SMLAD, "SMLAD", "111110110010nnnnaaaadddd000Xmmmm") //INST(thumb32_SMULWY, "SMULWY", "111110110011----1111----000-----") //INST(thumb32_SMLAWY, "SMLAWY", "111110110011------------000-----") INST(thumb32_SMUSD, "SMUSD", "111110110100nnnn1111dddd000Mmmmm") diff --git a/src/frontend/A32/translate/impl/thumb32_multiply.cpp b/src/frontend/A32/translate/impl/thumb32_multiply.cpp index fd7e32ef..8fbbac2c 100644 --- a/src/frontend/A32/translate/impl/thumb32_multiply.cpp +++ b/src/frontend/A32/translate/impl/thumb32_multiply.cpp @@ -48,6 +48,35 @@ bool ThumbTranslatorVisitor::thumb32_MUL(Reg n, Reg d, Reg m) { return true; } +bool ThumbTranslatorVisitor::thumb32_SMLAD(Reg n, Reg a, Reg d, bool X, Reg m) { + if (d == Reg::PC || n == Reg::PC || m == Reg::PC || a == Reg::PC) { + return UnpredictableInstruction(); + } + + const IR::U32 n32 = ir.GetRegister(n); + const IR::U32 m32 = ir.GetRegister(m); + const IR::U32 n_lo = ir.SignExtendHalfToWord(ir.LeastSignificantHalf(n32)); + const IR::U32 n_hi = ir.ArithmeticShiftRight(n32, ir.Imm8(16), ir.Imm1(0)).result; + + IR::U32 m_lo = ir.SignExtendHalfToWord(ir.LeastSignificantHalf(m32)); + IR::U32 m_hi = ir.ArithmeticShiftRight(m32, ir.Imm8(16), ir.Imm1(0)).result; + if (X) { + std::swap(m_lo, m_hi); + } + + const IR::U32 product_lo = ir.Mul(n_lo, m_lo); + const IR::U32 product_hi = ir.Mul(n_hi, m_hi); + const IR::U32 addend = ir.GetRegister(a); + + auto result_overflow = ir.AddWithCarry(product_lo, product_hi, ir.Imm1(0)); + ir.OrQFlag(result_overflow.overflow); + result_overflow = ir.AddWithCarry(result_overflow.result, addend, ir.Imm1(0)); + + ir.SetRegister(d, result_overflow.result); + ir.OrQFlag(result_overflow.overflow); + return true; +} + bool ThumbTranslatorVisitor::thumb32_SMLAXY(Reg n, Reg a, Reg d, bool N, bool M, Reg m) { if (d == Reg::PC || n == Reg::PC || m == Reg::PC || a == Reg::PC) { return UnpredictableInstruction(); diff --git a/src/frontend/A32/translate/impl/translate_thumb.h b/src/frontend/A32/translate/impl/translate_thumb.h index c8092ffd..3aa86c02 100644 --- a/src/frontend/A32/translate/impl/translate_thumb.h +++ b/src/frontend/A32/translate/impl/translate_thumb.h @@ -132,6 +132,7 @@ struct ThumbTranslatorVisitor final { bool thumb32_MLA(Reg n, Reg a, Reg d, Reg m); bool thumb32_MLS(Reg n, Reg a, Reg d, Reg m); bool thumb32_MUL(Reg n, Reg d, Reg m); + bool thumb32_SMLAD(Reg n, Reg a, Reg d, bool X, Reg m); bool thumb32_SMLAXY(Reg n, Reg a, Reg d, bool N, bool M, Reg m); bool thumb32_SMMLA(Reg n, Reg a, Reg d, bool R, Reg m); bool thumb32_SMMLS(Reg n, Reg a, Reg d, bool R, Reg m); From 8a22bdff43b941c2e15673eefaef8c0401837a81 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 7 Feb 2021 13:29:20 -0500 Subject: [PATCH 09/11] thumb32: Implement SMLSD{X} --- src/frontend/A32/decoder/thumb32.inc | 2 +- .../A32/translate/impl/thumb32_multiply.cpp | 27 +++++++++++++++++++ .../A32/translate/impl/translate_thumb.h | 1 + 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/frontend/A32/decoder/thumb32.inc b/src/frontend/A32/decoder/thumb32.inc index 1840f993..4cf49efe 100644 --- a/src/frontend/A32/decoder/thumb32.inc +++ b/src/frontend/A32/decoder/thumb32.inc @@ -271,7 +271,7 @@ INST(thumb32_SMLAD, "SMLAD", "111110110010nnnnaaaadd //INST(thumb32_SMULWY, "SMULWY", "111110110011----1111----000-----") //INST(thumb32_SMLAWY, "SMLAWY", "111110110011------------000-----") INST(thumb32_SMUSD, "SMUSD", "111110110100nnnn1111dddd000Mmmmm") -//INST(thumb32_SMLSD, "SMLSD", "111110110100------------000-----") +INST(thumb32_SMLSD, "SMLSD", "111110110100nnnnaaaadddd000Xmmmm") INST(thumb32_SMMUL, "SMMUL", "111110110101nnnn1111dddd000Rmmmm") INST(thumb32_SMMLA, "SMMLA", "111110110101nnnnaaaadddd000Rmmmm") INST(thumb32_SMMLS, "SMMLS", "111110110110nnnnaaaadddd000Rmmmm") diff --git a/src/frontend/A32/translate/impl/thumb32_multiply.cpp b/src/frontend/A32/translate/impl/thumb32_multiply.cpp index 8fbbac2c..46c36a0f 100644 --- a/src/frontend/A32/translate/impl/thumb32_multiply.cpp +++ b/src/frontend/A32/translate/impl/thumb32_multiply.cpp @@ -77,6 +77,33 @@ bool ThumbTranslatorVisitor::thumb32_SMLAD(Reg n, Reg a, Reg d, bool X, Reg m) { return true; } +bool ThumbTranslatorVisitor::thumb32_SMLSD(Reg n, Reg a, Reg d, bool X, Reg m) { + if (d == Reg::PC || n == Reg::PC || m == Reg::PC || a == Reg::PC) { + return UnpredictableInstruction(); + } + + const IR::U32 n32 = ir.GetRegister(n); + const IR::U32 m32 = ir.GetRegister(m); + const IR::U32 n_lo = ir.SignExtendHalfToWord(ir.LeastSignificantHalf(n32)); + const IR::U32 n_hi = ir.ArithmeticShiftRight(n32, ir.Imm8(16), ir.Imm1(0)).result; + + IR::U32 m_lo = ir.SignExtendHalfToWord(ir.LeastSignificantHalf(m32)); + IR::U32 m_hi = ir.ArithmeticShiftRight(m32, ir.Imm8(16), ir.Imm1(0)).result; + if (X) { + std::swap(m_lo, m_hi); + } + + const IR::U32 product_lo = ir.Mul(n_lo, m_lo); + const IR::U32 product_hi = ir.Mul(n_hi, m_hi); + const IR::U32 addend = ir.GetRegister(a); + const IR::U32 product = ir.Sub(product_lo, product_hi); + auto result_overflow = ir.AddWithCarry(product, addend, ir.Imm1(0)); + + ir.SetRegister(d, result_overflow.result); + ir.OrQFlag(result_overflow.overflow); + return true; +} + bool ThumbTranslatorVisitor::thumb32_SMLAXY(Reg n, Reg a, Reg d, bool N, bool M, Reg m) { if (d == Reg::PC || n == Reg::PC || m == Reg::PC || a == Reg::PC) { return UnpredictableInstruction(); diff --git a/src/frontend/A32/translate/impl/translate_thumb.h b/src/frontend/A32/translate/impl/translate_thumb.h index 3aa86c02..e62d2fbe 100644 --- a/src/frontend/A32/translate/impl/translate_thumb.h +++ b/src/frontend/A32/translate/impl/translate_thumb.h @@ -134,6 +134,7 @@ struct ThumbTranslatorVisitor final { bool thumb32_MUL(Reg n, Reg d, Reg m); bool thumb32_SMLAD(Reg n, Reg a, Reg d, bool X, Reg m); bool thumb32_SMLAXY(Reg n, Reg a, Reg d, bool N, bool M, Reg m); + bool thumb32_SMLSD(Reg n, Reg a, Reg d, bool X, Reg m); bool thumb32_SMMLA(Reg n, Reg a, Reg d, bool R, Reg m); bool thumb32_SMMLS(Reg n, Reg a, Reg d, bool R, Reg m); bool thumb32_SMMUL(Reg n, Reg d, bool R, Reg m); From 96895d2eb5c9146027e5cfaa933baeda52e3e768 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 7 Feb 2021 13:32:39 -0500 Subject: [PATCH 10/11] thumb32: Implement SMULWY --- src/frontend/A32/decoder/thumb32.inc | 2 +- .../A32/translate/impl/thumb32_multiply.cpp | 17 +++++++++++++++++ .../A32/translate/impl/translate_thumb.h | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/frontend/A32/decoder/thumb32.inc b/src/frontend/A32/decoder/thumb32.inc index 4cf49efe..6a42ca01 100644 --- a/src/frontend/A32/decoder/thumb32.inc +++ b/src/frontend/A32/decoder/thumb32.inc @@ -268,7 +268,7 @@ INST(thumb32_SMULXY, "SMULXY", "111110110001nnnn1111dd INST(thumb32_SMLAXY, "SMLAXY", "111110110001nnnnaaaadddd00NMmmmm") INST(thumb32_SMUAD, "SMUAD", "111110110010nnnn1111dddd000Mmmmm") INST(thumb32_SMLAD, "SMLAD", "111110110010nnnnaaaadddd000Xmmmm") -//INST(thumb32_SMULWY, "SMULWY", "111110110011----1111----000-----") +INST(thumb32_SMULWY, "SMULWY", "111110110011nnnn1111dddd000Mmmmm") //INST(thumb32_SMLAWY, "SMLAWY", "111110110011------------000-----") INST(thumb32_SMUSD, "SMUSD", "111110110100nnnn1111dddd000Mmmmm") INST(thumb32_SMLSD, "SMLSD", "111110110100nnnnaaaadddd000Xmmmm") diff --git a/src/frontend/A32/translate/impl/thumb32_multiply.cpp b/src/frontend/A32/translate/impl/thumb32_multiply.cpp index 46c36a0f..c15190ff 100644 --- a/src/frontend/A32/translate/impl/thumb32_multiply.cpp +++ b/src/frontend/A32/translate/impl/thumb32_multiply.cpp @@ -245,6 +245,23 @@ bool ThumbTranslatorVisitor::thumb32_SMULXY(Reg n, Reg d, bool N, bool M, Reg m) return true; } +bool ThumbTranslatorVisitor::thumb32_SMULWY(Reg n, Reg d, bool M, Reg m) { + if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { + return UnpredictableInstruction(); + } + + const IR::U64 n32 = ir.SignExtendWordToLong(ir.GetRegister(n)); + IR::U32 m32 = ir.GetRegister(m); + if (M) { + m32 = ir.LogicalShiftRight(m32, ir.Imm8(16), ir.Imm1(0)).result; + } + const IR::U64 m16 = ir.SignExtendWordToLong(ir.SignExtendHalfToWord(ir.LeastSignificantHalf(m32))); + const auto result = ir.LogicalShiftRight(ir.Mul(n32, m16), ir.Imm8(16)); + + ir.SetRegister(d, ir.LeastSignificantWord(result)); + return true; +} + bool ThumbTranslatorVisitor::thumb32_USAD8(Reg n, Reg d, Reg m) { if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); diff --git a/src/frontend/A32/translate/impl/translate_thumb.h b/src/frontend/A32/translate/impl/translate_thumb.h index e62d2fbe..6aee5355 100644 --- a/src/frontend/A32/translate/impl/translate_thumb.h +++ b/src/frontend/A32/translate/impl/translate_thumb.h @@ -141,6 +141,7 @@ struct ThumbTranslatorVisitor final { bool thumb32_SMUAD(Reg n, Reg d, bool M, Reg m); bool thumb32_SMUSD(Reg n, Reg d, bool M, Reg m); bool thumb32_SMULXY(Reg n, Reg d, bool N, bool M, Reg m); + bool thumb32_SMULWY(Reg n, Reg d, bool M, Reg m); bool thumb32_USAD8(Reg n, Reg d, Reg m); bool thumb32_USADA8(Reg n, Reg a, Reg d, Reg m); From b58cd3a9969e36a312f73322bad883d4e91a38d4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 7 Feb 2021 13:34:56 -0500 Subject: [PATCH 11/11] thumb32: Implement SMLAWY --- src/frontend/A32/decoder/thumb32.inc | 2 +- .../A32/translate/impl/thumb32_multiply.cpp | 19 +++++++++++++++++++ .../A32/translate/impl/translate_thumb.h | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/frontend/A32/decoder/thumb32.inc b/src/frontend/A32/decoder/thumb32.inc index 6a42ca01..d7b8b953 100644 --- a/src/frontend/A32/decoder/thumb32.inc +++ b/src/frontend/A32/decoder/thumb32.inc @@ -269,7 +269,7 @@ INST(thumb32_SMLAXY, "SMLAXY", "111110110001nnnnaaaadd INST(thumb32_SMUAD, "SMUAD", "111110110010nnnn1111dddd000Mmmmm") INST(thumb32_SMLAD, "SMLAD", "111110110010nnnnaaaadddd000Xmmmm") INST(thumb32_SMULWY, "SMULWY", "111110110011nnnn1111dddd000Mmmmm") -//INST(thumb32_SMLAWY, "SMLAWY", "111110110011------------000-----") +INST(thumb32_SMLAWY, "SMLAWY", "111110110011nnnnaaaadddd000Mmmmm") INST(thumb32_SMUSD, "SMUSD", "111110110100nnnn1111dddd000Mmmmm") INST(thumb32_SMLSD, "SMLSD", "111110110100nnnnaaaadddd000Xmmmm") INST(thumb32_SMMUL, "SMMUL", "111110110101nnnn1111dddd000Rmmmm") diff --git a/src/frontend/A32/translate/impl/thumb32_multiply.cpp b/src/frontend/A32/translate/impl/thumb32_multiply.cpp index c15190ff..13143949 100644 --- a/src/frontend/A32/translate/impl/thumb32_multiply.cpp +++ b/src/frontend/A32/translate/impl/thumb32_multiply.cpp @@ -245,6 +245,25 @@ bool ThumbTranslatorVisitor::thumb32_SMULXY(Reg n, Reg d, bool N, bool M, Reg m) return true; } +bool ThumbTranslatorVisitor::thumb32_SMLAWY(Reg n, Reg a, Reg d, bool M, Reg m) { + if (d == Reg::PC || n == Reg::PC || m == Reg::PC || a == Reg::PC) { + return UnpredictableInstruction(); + } + + const IR::U64 n32 = ir.SignExtendWordToLong(ir.GetRegister(n)); + IR::U32 m32 = ir.GetRegister(m); + if (M) { + m32 = ir.LogicalShiftRight(m32, ir.Imm8(16), ir.Imm1(0)).result; + } + const IR::U64 m16 = ir.SignExtendWordToLong(ir.SignExtendHalfToWord(ir.LeastSignificantHalf(m32))); + const auto product = ir.LeastSignificantWord(ir.LogicalShiftRight(ir.Mul(n32, m16), ir.Imm8(16))); + const auto result_overflow = ir.AddWithCarry(product, ir.GetRegister(a), ir.Imm1(0)); + + ir.SetRegister(d, result_overflow.result); + ir.OrQFlag(result_overflow.overflow); + return true; +} + bool ThumbTranslatorVisitor::thumb32_SMULWY(Reg n, Reg d, bool M, Reg m) { if (d == Reg::PC || n == Reg::PC || m == Reg::PC) { return UnpredictableInstruction(); diff --git a/src/frontend/A32/translate/impl/translate_thumb.h b/src/frontend/A32/translate/impl/translate_thumb.h index 6aee5355..24b449cc 100644 --- a/src/frontend/A32/translate/impl/translate_thumb.h +++ b/src/frontend/A32/translate/impl/translate_thumb.h @@ -134,6 +134,7 @@ struct ThumbTranslatorVisitor final { bool thumb32_MUL(Reg n, Reg d, Reg m); bool thumb32_SMLAD(Reg n, Reg a, Reg d, bool X, Reg m); bool thumb32_SMLAXY(Reg n, Reg a, Reg d, bool N, bool M, Reg m); + bool thumb32_SMLAWY(Reg n, Reg a, Reg d, bool M, Reg m); bool thumb32_SMLSD(Reg n, Reg a, Reg d, bool X, Reg m); bool thumb32_SMMLA(Reg n, Reg a, Reg d, bool R, Reg m); bool thumb32_SMMLS(Reg n, Reg a, Reg d, bool R, Reg m);