hrydgard/ppsspp — pull request #3760 by unknownbrackets (2013-09-14 05:41:44+00:00)
Title: Fix fpu non-finite rounding on x86

The PSP's fpu seems to round INFINITY/NAN/-NAN to INT_MAX, and -INFINITY to INT_MIN. x86 always uses 0x8000000 (to signal an invalid conversion.)

This simply checks for that condition. There may be a small performance hit, but I don't think I've seen these instructions show up in profiles anyway. I like speed, but also accuracy, making cake, and eating cake too, after all. It's not super likely any game depends on this, but INFINITY becoming negative does seem slightly dangerous.

It shouldn't affect Android (where the compares I think are broken anyway), since it implements each instruction in jit.

Maybe an exception trap would be faster but I have no idea how to use those.

With these changes, cpu/fpu/fpu passes on x86.

-[Unknown]