mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
IR: Let vrot's FSinCos write straight into an [s, c] pair
When the cosine lane follows the sine lane, FSinCos can write both in place instead of going through a temp and two FMovs. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
498511fd51
commit
1cdc432d6a
1 file changed
+11
@@ -2318,6 +2318,17 @@ namespace MIPSComp {
|
||||
hasCosine = hasCosine || d[i] == 'c';
|
||||
}
|
||||
if (hasSine && hasCosine && IsOverlapSafe(n, dregs, 1, sreg)) {
|
||||
if (!broadcastSine && dregs[cosineLane] == dregs[sineLane] + 1 && (dregs[sineLane] & 1) == 0) {
|
||||
// The pair is in place (and aligned, as a Vec2), so write it directly.
|
||||
ir.Write(IROp::FSinCos, dregs[sineLane], sreg[0]);
|
||||
if (negSin)
|
||||
ir.Write(IROp::FNeg, dregs[sineLane], dregs[sineLane]);
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (d[i] == '0')
|
||||
ir.WriteFC(IROp::SetConstF, dregs[i], 0, 0, 0.0f);
|
||||
}
|
||||
return;
|
||||
}
|
||||
ir.Write(IROp::FSinCos, IRVTEMP_0, sreg[0]);
|
||||
if (negSin)
|
||||
ir.Write(IROp::FNeg, IRVTEMP_0, IRVTEMP_0);
|
||||
|
||||
Reference in new issue
Block a user