VFPU: Fix vrot with the angle in a destination lane

The cosine is then taken of what vrot wrote to that lane: the sine, or zero.
The IR looked at the sine lane instead of the lane holding the angle, and the
legacy JITs ignored the overlap. The assembler refuses such a vrot, so those
now leave it to the interpreter, and don't pair one with the vrot before it.

Covered by the new cpu/vfpu/vrot test.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-09-24 16:22:41 -06:00
1 parent 4ebf9ed037
commit 6fc4eb19df
6 files changed
+45 -6

No files matched your search

+13 -5
View File
@@ -2335,12 +2335,20 @@ namespace MIPSComp {
}
break;
case 'c':
if (IsOverlapSafe(n, dregs, 1, sreg))
if (IsOverlapSafe(n, dregs, 1, sreg)) {
ir.Write(IROp::FCos, dregs[i], sreg[0]);
else if (dregs[sineLane] == sreg[0])
ir.Write(IROp::FCos, dregs[i], IRVTEMP_0);
else
ir.WriteFC(IROp::SetConstF, dregs[i], 0, 0, 1.0f);
} else {
// The cosine is taken of what the source lane got: the sine, or zero.
int srcLane = 0;
while (dregs[srcLane] != sreg[0]) {
srcLane++;
}
if (broadcastSine || srcLane == sineLane) {
ir.Write(IROp::FCos, dregs[i], IRVTEMP_0);
} else {
ir.WriteFC(IROp::SetConstF, dregs[i], 0, 0, 1.0f);
}
}
break;
}
}