[cairo] New tessellator work and thoughts

M Joonas Pihlaja jpihlaja at cc.helsinki.fi
Mon Nov 20 21:03:37 PST 2006


On Mon, 20 Nov 2006, Daniel Amelang wrote:

> On 11/20/06, M Joonas Pihlaja <jpihlaja at cc.helsinki.fi> wrote:
>> (lots of stuff)
>> * Miscellany
>> 
>> About 40-50% of the time spent in the wideint division code is
>> taken up, according to callgrind, by the relatively mundane
>> problem of dealing with correct signs of the results.  Now, not
>
> Can you elaborate a bit more on this? Are you referring to all the 'if
> (num_neg) num = _cairo_int128_negate(num);' stuff?

Yes, that stuff.  Callgrind says for the world-map case, for 
example:

instruction
fetches (self)
  5,168,047    cairo-wideint.c:_cairo_int_96by64_32x64_divrem
    3,993,971    cairo-wideint.c:_cairo_uint_96by64_32x64_divrem
     3,325,527     ???:__umoddi3
     3,002,494     ???:__udivdi3

Which in percentages breaks _cairo_int_96by64_32x64_divrem() down 
as:

33 % _cairo_int_96by64_32x64_divrem
26 % _cairo_uint_96by64_32x64_divrem
21 % __umoddi3
19 % __udivdi3

Granted, 40-50 % was a tad too high, but I was going by mental 
subtraction 100 - 60 ~ 40.  Still, the uint_96by64 function has 
room for tweakage to make it so. :-} (Although, that's getting a 
little too low level for testing on just one machine, and the 
profile's likely different on newer processors.)

Joonas


More information about the cairo mailing list