A64: Move SDIV and UDIV out of data_processing_multiply.cpp

This commit is contained in:
Lioncash 2018-02-06 19:29:53 -05:00 committed by MerryMage
parent 35a29a9665
commit 4e33629b0e
2 changed files with 24 additions and 24 deletions

View file

@ -98,28 +98,4 @@ bool TranslatorVisitor::UMULH(Reg Rm, Reg Rn, Reg Rd) {
return true; return true;
} }
bool TranslatorVisitor::UDIV(bool sf, Reg Rm, Reg Rn, Reg Rd) {
const size_t datasize = sf ? 64 : 32;
const IR::U32U64 m = X(datasize, Rm);
const IR::U32U64 n = X(datasize, Rn);
const IR::U32U64 result = ir.UnsignedDiv(n,m);
X(datasize, Rd, result);
return true;
}
bool TranslatorVisitor::SDIV(bool sf, Reg Rm, Reg Rn, Reg Rd) {
const size_t datasize = sf ? 64 : 32;
const IR::U32U64 m = X(datasize, Rm);
const IR::U32U64 n = X(datasize, Rn);
const IR::U32U64 result = ir.SignedDiv(n,m);
X(datasize, Rd, result);
return true;
}
} // namespace Dynarmic::A64 } // namespace Dynarmic::A64

View file

@ -112,4 +112,28 @@ bool TranslatorVisitor::REV16_int(bool sf, Reg Rn, Reg Rd) {
return true; return true;
} }
bool TranslatorVisitor::UDIV(bool sf, Reg Rm, Reg Rn, Reg Rd) {
const size_t datasize = sf ? 64 : 32;
const IR::U32U64 m = X(datasize, Rm);
const IR::U32U64 n = X(datasize, Rn);
const IR::U32U64 result = ir.UnsignedDiv(n,m);
X(datasize, Rd, result);
return true;
}
bool TranslatorVisitor::SDIV(bool sf, Reg Rm, Reg Rn, Reg Rd) {
const size_t datasize = sf ? 64 : 32;
const IR::U32U64 m = X(datasize, Rm);
const IR::U32U64 n = X(datasize, Rn);
const IR::U32U64 result = ir.SignedDiv(n,m);
X(datasize, Rd, result);
return true;
}
} // namespace Dynarmic::A64 } // namespace Dynarmic::A64