VFPU: Produce the PSP's NaNs in the single-lane ops, on every core

The VFPU never keeps a NaN's payload (cpu/vfpu/nan_gen): vadd and vsub
produce 0x7F800001, and vmul, vdiv, vscl and vcrs the same with the
sign of s ^ t. The cores returned whatever NaN the host made, which
differs between x86 and ARM64. Now all four cores on both hosts match
the PSP for these ops. The horizontal ops (vdot and friends) are left
for when they move to the accurate dot product.

The IR gets FVfpuNaN and FVfpuProductNaN, scalar and Vec4, run after
the arithmetic. The native backends check for a NaN and branch past
the fixup, which only runs when there is one. PurgeTemps no longer
renames the dest of an FPR op that also reads it, which the product
ops are the first to do.

vsat0 and vsat1 also keep a NaN's bits on ARM64 now, where FMIN/FMAX
quieted a signaling NaN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-31 21:28:07 +01:00
1 parent ac0530e7ca
commit 92e3957264
16 files changed
+441 -35

No files matched your search

+4
View File
@@ -348,6 +348,8 @@ void IRNativeBackend::CompileIRInst(IRInst inst) {
case IROp::FDiv:
case IROp::FSqrt:
case IROp::FNeg:
case IROp::FVfpuNaN:
case IROp::FVfpuProductNaN:
CompIR_FArith(inst);
break;
@@ -426,6 +428,8 @@ void IRNativeBackend::CompileIRInst(IRInst inst) {
case IROp::Vec4Slt:
case IROp::Vec4Sge:
case IROp::Vec4CvtScaledSW:
case IROp::Vec4VfpuNaN:
case IROp::Vec4VfpuProductNaN:
CompIR_VecArith(inst);
break;