mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-03-14 18:36:27 +00:00
A64: Implement FABD in terms of existing IR instructions
Fixes NaN issue. Closes #306.
This commit is contained in:
@@ -173,12 +173,11 @@ bool TranslatorVisitor::CMTST_1(Imm<2> size, Vec Vm, Vec Vn, Vec Vd) {
|
||||
bool TranslatorVisitor::FABD_2(bool sz, Vec Vm, Vec Vn, Vec Vd) {
|
||||
const size_t esize = sz ? 64 : 32;
|
||||
|
||||
const IR::U128 operand1 = V(esize, Vn);
|
||||
const IR::U128 operand2 = V(esize, Vm);
|
||||
const IR::U128 difference = ir.FPVectorAbsoluteDifference(esize, operand1, operand2);
|
||||
const IR::U128 result = ir.VectorZeroUpper(difference);
|
||||
const IR::U32U64 operand1 = V_scalar(esize, Vn);
|
||||
const IR::U32U64 operand2 = V_scalar(esize, Vm);
|
||||
const IR::U32U64 result = ir.FPAbs(ir.FPSub(operand1, operand2, true));
|
||||
|
||||
V(128, Vd, result);
|
||||
V_scalar(esize, Vd, result);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -384,7 +384,7 @@ bool TranslatorVisitor::FABD_4(bool Q, bool sz, Vec Vm, Vec Vn, Vec Vd) {
|
||||
|
||||
const IR::U128 operand1 = V(datasize, Vn);
|
||||
const IR::U128 operand2 = V(datasize, Vm);
|
||||
const IR::U128 result = ir.FPVectorAbsoluteDifference(esize, operand1, operand2);
|
||||
const IR::U128 result = ir.FPVectorAbs(esize, ir.FPVectorSub(esize, operand1, operand2));
|
||||
|
||||
V(datasize, Vd, result);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user