mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-05 22:18:16 +01:00
A32: Implement ASIMD VABS
Very similar to VNEG in that the only thing that differs is the function called.
This commit is contained in:
parent
53422bec46
commit
6dd2c94095
3 changed files with 28 additions and 1 deletions
|
|
@ -73,6 +73,32 @@ bool ArmTranslatorVisitor::asimd_VCNT(bool D, size_t sz, size_t Vd, bool Q, bool
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ArmTranslatorVisitor::asimd_VABS(bool D, size_t sz, size_t Vd, bool F, bool Q, bool M, size_t Vm) {
|
||||
if (sz == 0b11 || (F && sz != 0b10)) {
|
||||
return UndefinedInstruction();
|
||||
}
|
||||
|
||||
if (Q && (Common::Bit<0>(Vd) || Common::Bit<0>(Vm))) {
|
||||
return UndefinedInstruction();
|
||||
}
|
||||
|
||||
const auto d = ToVector(Q, Vd, D);
|
||||
const auto m = ToVector(Q, Vm, M);
|
||||
const auto result = [this, F, m, sz] {
|
||||
const auto reg_m = ir.GetVector(m);
|
||||
|
||||
if (F) {
|
||||
return ir.FPVectorAbs(32, reg_m);
|
||||
}
|
||||
|
||||
const size_t esize = 8U << sz;
|
||||
return ir.VectorAbs(esize, reg_m);
|
||||
}();
|
||||
|
||||
ir.SetVector(d, result);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ArmTranslatorVisitor::asimd_VNEG(bool D, size_t sz, size_t Vd, bool F, bool Q, bool M, size_t Vm) {
|
||||
if (sz == 0b11 || (F && sz != 0b10)) {
|
||||
return UndefinedInstruction();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue