irjit: Implement vsge/vslt.
These are not ideal especially for SIMD, but they do work. Improves performance in Silent Hill on RISC-V by like 20%.
This commit is contained in:
parent
5d20f2aabd
commit
23c79f8e7f
1 changed files with 19 additions and 1 deletions
|
@ -837,6 +837,11 @@ namespace MIPSComp {
|
|||
return;
|
||||
}
|
||||
|
||||
if (type == VecDo3Op::VSGE || type == VecDo3Op::VSLT) {
|
||||
// TODO: Consider a dedicated op? For now, we abuse FpCond a bit.
|
||||
ir.Write(IROp::FpCondToReg, IRTEMP_0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < n; ++i) {
|
||||
switch (type) {
|
||||
case VecDo3Op::VADD: // d[i] = s[i] + t[i]; break; //vadd
|
||||
|
@ -858,12 +863,25 @@ namespace MIPSComp {
|
|||
ir.Write(IROp::FMax, tempregs[i], sregs[i], tregs[i]);
|
||||
break;
|
||||
case VecDo3Op::VSGE: // vsge
|
||||
ir.Write(IROp::FCmp, (int)IRFpCompareMode::LessUnordered, sregs[i], tregs[i]);
|
||||
ir.Write(IROp::FpCondToReg, IRTEMP_1);
|
||||
ir.Write(IROp::XorConst, IRTEMP_1, IRTEMP_1, ir.AddConstant(1));
|
||||
ir.Write(IROp::FMovFromGPR, tempregs[i], IRTEMP_1);
|
||||
ir.Write(IROp::FCvtSW, tempregs[i], tempregs[i]);
|
||||
break;
|
||||
case VecDo3Op::VSLT: // vslt
|
||||
DISABLE;
|
||||
ir.Write(IROp::FCmp, (int)IRFpCompareMode::LessOrdered, sregs[i], tregs[i]);
|
||||
ir.Write(IROp::FpCondToReg, IRTEMP_1);
|
||||
ir.Write(IROp::FMovFromGPR, tempregs[i], IRTEMP_1);
|
||||
ir.Write(IROp::FCvtSW, tempregs[i], tempregs[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (type == VecDo3Op::VSGE || type == VecDo3Op::VSLT) {
|
||||
ir.Write(IROp::FpCondFromReg, IRTEMP_0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (dregs[i] != tempregs[i]) {
|
||||
ir.Write(IROp::FMov, dregs[i], tempregs[i]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue