mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-01-07 06:58:15 +01:00
A64: Implement FCMGT, FCMGE (register) vector double and single precision variants
This commit is contained in:
parent
350bc70be8
commit
24e3299276
2 changed files with 43 additions and 13 deletions
|
|
@ -96,6 +96,40 @@ bool RoundingHalvingAdd(TranslatorVisitor& v, bool Q, Imm<2> size, Vec Vm, Vec V
|
|||
v.V(datasize, Vd, result);
|
||||
return true;
|
||||
}
|
||||
|
||||
enum class ComparisonType {
|
||||
EQ,
|
||||
GE,
|
||||
GT
|
||||
};
|
||||
|
||||
bool FPCompareRegister(TranslatorVisitor& v, bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd, ComparisonType type) {
|
||||
if (sz && !Q) {
|
||||
return v.ReservedValue();
|
||||
}
|
||||
|
||||
const size_t esize = sz ? 64 : 32;
|
||||
const size_t datasize = Q ? 128 : 64;
|
||||
|
||||
const IR::U128 operand1 = v.V(datasize, Vn);
|
||||
const IR::U128 operand2 = v.V(datasize, Vm);
|
||||
const IR::U128 result = [&] {
|
||||
switch (type) {
|
||||
case ComparisonType::EQ:
|
||||
return v.ir.FPVectorEqual(esize, operand1, operand2);
|
||||
case ComparisonType::GE:
|
||||
return v.ir.FPVectorGreaterEqual(esize, operand1, operand2);
|
||||
case ComparisonType::GT:
|
||||
return v.ir.FPVectorGreater(esize, operand1, operand2);
|
||||
}
|
||||
|
||||
UNREACHABLE();
|
||||
return IR::U128{};
|
||||
}();
|
||||
|
||||
v.V(datasize, Vd, result);
|
||||
return true;
|
||||
}
|
||||
} // Anonymous namespace
|
||||
|
||||
bool TranslatorVisitor::CMGT_reg_2(bool Q, Imm<2> size, Vec Vm, Vec Vn, Vec Vd) {
|
||||
|
|
@ -345,19 +379,15 @@ bool TranslatorVisitor::FADD_2(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) {
|
|||
}
|
||||
|
||||
bool TranslatorVisitor::FCMEQ_reg_4(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) {
|
||||
if (sz && !Q) {
|
||||
return ReservedValue();
|
||||
}
|
||||
return FPCompareRegister(*this, Q, sz, Vm, Vn, Vd, ComparisonType::EQ);
|
||||
}
|
||||
|
||||
const size_t esize = sz ? 64 : 32;
|
||||
const size_t datasize = Q ? 128 : 64;
|
||||
bool TranslatorVisitor::FCMGE_reg_4(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) {
|
||||
return FPCompareRegister(*this, Q, sz, Vm, Vn, Vd, ComparisonType::GE);
|
||||
}
|
||||
|
||||
const IR::U128 operand1 = V(datasize, Vn);
|
||||
const IR::U128 operand2 = V(datasize, Vm);
|
||||
const IR::U128 result = ir.FPVectorEqual(esize, operand1, operand2);
|
||||
|
||||
V(datasize, Vd, result);
|
||||
return true;
|
||||
bool TranslatorVisitor::FCMGT_reg_4(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) {
|
||||
return FPCompareRegister(*this, Q, sz, Vm, Vn, Vd, ComparisonType::GT);
|
||||
}
|
||||
|
||||
bool TranslatorVisitor::AND_asimd(bool Q, Vec Vm, Vec Vn, Vec Vd) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue