translate: Deduplicate GetDataSize() functions

Avoids defining the same function multiple times in different files.
This commit is contained in:
Lioncash
2018-07-29 00:53:13 -04:00
committed by MerryMage
parent f83cd2da9a
commit 5ebf496d4e
9 changed files with 54 additions and 140 deletions

View File

@@ -10,22 +10,9 @@
namespace Dynarmic::A64 {
namespace {
boost::optional<size_t> GetDataSize(Imm<2> type) {
switch (type.ZeroExtend()) {
case 0b00:
return 32;
case 0b01:
return 64;
case 0b11:
// FP16Ext, unimplemented.
return boost::none;
}
return boost::none;
}
bool FPCompare(TranslatorVisitor& v, Imm<2> type, Vec Vm, Vec Vn, bool exc_on_qnan, bool cmp_with_zero) {
const auto datasize = GetDataSize(type);
if (!datasize) {
const auto datasize = FPGetDataSize(type);
if (!datasize || *datasize == 16) {
return v.UnallocatedEncoding();
}