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,20 +10,8 @@
namespace Dynarmic::A64 {
static boost::optional<size_t> GetDataSize(Imm<2> type) {
switch (type.ZeroExtend()) {
case 0b00:
return 32;
case 0b01:
return 64;
case 0b11:
return 16;
}
return boost::none;
}
bool TranslatorVisitor::FCSEL_float(Imm<2> type, Vec Vm, Cond cond, Vec Vn, Vec Vd) {
const auto datasize = GetDataSize(type);
const auto datasize = FPGetDataSize(type);
if (!datasize || *datasize == 16) {
return UnallocatedEncoding();
}