Using sincos (was Re: [cairo] Questions and optimizations in
ds at schleef.org
Mon Aug 22 15:53:53 PDT 2005
On Mon, Aug 22, 2005 at 05:43:08PM -0400, Owen Taylor wrote:
> The AC_CHECK_FUNCS call doesn't use header files, so it doesn't
> need the define.
> +AC_CHECK_FUNCS(vasnprintf, sincos)
> I'd put the sincos check after the libm check ... I'm not sure how
> it is working before without libm in LIBS so I don't trust it to
> stay working.
I'm going to toss out a suggestion: don't use sincos(). The sincos()
function is an uninteresting optimization that is merely causing
developers to spend time on getting it right. Yes, it's slightly
faster. No, it is not used in any place where it makes a difference.
And no, it's not nearly as fast as inlining an fsincos instruction.
(Which, btw, gcc-4.0 does automatically if you let it.) And if it
ever does matter, liboil has an array-based function that actually
makes sin/cos calculations fast.
Big Kitten LLC (http://www.bigkitten.com/) -- data acquisition on Linux
More information about the cairo