[cairo] fixed_from_double speedup masking pixman traps problem
behdad at behdad.org
Wed Nov 29 12:56:01 PST 2006
On Wed, 2006-11-29 at 15:48 -0500, Bill Spitzak wrote:
> In the fast fixed-from-double code, overflow can be detected because
> "high word" of the resulting double after the math must be a
> If it is not the expected value then overflow occurred and you can
> use some slower code to do the conversion.
> I tried this here but the overhead of the if statement killed most of
> the speed advantage, also investigation of our code indicated that at
> least 90% or so of all calls to our float->int converter was from
> that already knew the number was in range. So I did not do this.
> it does appear to be the fastest way to make a flawless converter.
So, then adding a variant that returns a overflowed boolean and let the
caller deal with an overflow?
"Those who would give up Essential Liberty to purchase a little
Temporary Safety, deserve neither Liberty nor Safety."
-- Benjamin Franklin, 1759
More information about the cairo