msvcrt: Don't depend on the system's implementation of acos () & asin().

Henri Verbeet hverbeet at gmail.com
Fri Aug 29 13:15:20 CDT 2008


2008/8/29 Michael Stefaniuc <mstefani at 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.



More information about the wine-devel mailing list