[cairo] Patches for speeding up _cairo_fixed_from_double

Carl Worth cworth at cworth.org
Mon Nov 6 16:13:36 PST 2006

On Mon, 6 Nov 2006 15:28:44 -0800, "Daniel Amelang" wrote:
> I think that there is only one scenario where it would fail (autoconf
> requires grep, so absence of grep shouldn't be a reason to fail): the
> platform doesn't use IEEE-754 to store its floats and we already
> decided not to worry about those systems here:

Yes, that was the other situation I wondered about.

> So I vote to just break the build at that point and say "Cairo
> requires floats to be stored in IEEE-754 format".

Yes, exactly.

>                                                   If in the future,
> some bizarre system appears that doesn't, and we want to support it,
> we can go back and add a new check and a new flag
> (IEEE754_FLOAT_FORMAT?) and add guards to the code that uses
> FLOAT_WORDS_BIGENDIAN and provide a non-IEEE path.

Yes, perfect. If someone actually tries to build cairo on such a
system then they will have the reason and the motivation to fix.

> I was aware of this problem (and the bug report), and had forgotten to
> include my rationale for going ahead despite this in the original
> email with the patch. I'll include that now:

... [snip detailed rationale] ...

>                                             So my proposal is to
> clearly document that cairo doesn't function properly in
> single-precision mode, explicitly instructing DirectX users to set the
> The only alternatives I see are 1)leaving out the optimization or
> 2)leaving it out just on Win32, or 3)setting the precision mode
> ourselves (in cairo_create for example). I'm not too thrilled about
> any of those, but who am I to say.

I don't have an immediate objection to the above, (thanks for
providing such a detailed explanation). I think that there have been a
few different complaints about breakage of cairo under
single-precision mode in the past. I know that some were inspired by
Direct3D silently changing the FPU on users. I don't know if any have
been for any other reasons.

Does anybody have a good reason that cairo should work with the FPU in
single-precision mode?

Until someone speaks up there, I suggest we eliminate the current
comment and replace it with a sentence in the manual and in NEWS (for
sake of the next release) officially making single-precision mode

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20061106/ffa7091d/attachment.pgp

More information about the cairo mailing list