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

Dan Kegel dank at kegel.com
Fri Aug 29 16:10:30 CDT 2008


On Fri, Aug 29, 2008 at 11:15 AM, Henri Verbeet <hverbeet at gmail.com> wrote:
> 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.

How performance-critical is this stuff?  Supporting our own
trig routines is a difficult undertaking, not to be taken lightly...



More information about the wine-devel mailing list