mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-03-10 10:56:27 +00:00
thumb32: Implement MUL
This commit is contained in:
23
src/frontend/A32/translate/impl/thumb32_multiply.cpp
Normal file
23
src/frontend/A32/translate/impl/thumb32_multiply.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2021 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
*/
|
||||
|
||||
#include "frontend/A32/translate/impl/translate_thumb.h"
|
||||
|
||||
namespace Dynarmic::A32 {
|
||||
|
||||
bool ThumbTranslatorVisitor::thumb32_MUL(Reg n, Reg d, Reg m) {
|
||||
if (d == Reg::PC || n == Reg::PC || m == Reg::PC) {
|
||||
return UnpredictableInstruction();
|
||||
}
|
||||
|
||||
const auto reg_m = ir.GetRegister(m);
|
||||
const auto reg_n = ir.GetRegister(n);
|
||||
const auto result = ir.Mul(reg_n, reg_m);
|
||||
|
||||
ir.SetRegister(d, result);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Dynarmic::A32
|
||||
@@ -128,6 +128,9 @@ struct ThumbTranslatorVisitor final {
|
||||
bool thumb32_REVSH(Reg n, Reg d, Reg m);
|
||||
bool thumb32_SEL(Reg n, Reg d, Reg m);
|
||||
|
||||
// thumb32 multiply instructions
|
||||
bool thumb32_MUL(Reg n, Reg d, Reg m);
|
||||
|
||||
// thumb32 parallel add/sub instructions
|
||||
bool thumb32_SADD8(Reg n, Reg d, Reg m);
|
||||
bool thumb32_SADD16(Reg n, Reg d, Reg m);
|
||||
|
||||
Reference in New Issue
Block a user