2008/8/29 Michael Stefaniuc mstefani@redhat.com:
Wouldn't it make more sense to put the sane acos and asin implementations in libs/port and use them only if the system provided versions are broken? It should be possible to have configure check that. That way we can use the probably optimized versions on the sane systems.
Possibly, but compiling on a sane system doesn't necessarily mean you'll run on a sane system as well. In terms of performance it's all rather suboptimal either way though. Eg. in the case of C&C Generals you enter msvcrt through _CIacos() with a double in %st(0). We then pop that to CPU memory and pass it to MSVCRT_acos(), which passes it to acos(), which pushes it onto the FPU stack again. Performance wise it would make more sense to write our own implementation in asm inside _CIacos() and have MSVCRT_acos() call that.