[cairo] Re: Trivial patch reducing fp mults in pango-cairo

Behdad Esfahbod behdad at behdad.org
Wed Dec 13 15:27:30 PST 2006

On Wed, 2006-12-13 at 15:20 -0800, Daniel Amelang wrote:
> On 12/13/06, Behdad Esfahbod <behdad at behdad.org> wrote:
> > Well, this is kinda hitting the limit.  You are basically rewriting soft
> > float routines.  First, I'm not sure it's much faster (ok, you can skip
> > some details, so it's got to be faster), second, you are mostly shifting
> > time from __mul to library functions.  I'll rather leave these to the
> > compiler.  Has anyone tested compiling recent pango+cairo with
> > softfloats on small systems?
> I'm going to guess that you haven't looked over the softfloat source
> code very carefully :)

I've not :).

>  What I'm proposing is so much simpiler, and
> will pipeline so much better that to say that I'm "basically rewriting
> soft float routines" is a stretch. This is pretty similar to what I
> did with cairo_lround, and I saw a 5x speedup on ARM for that function
> alone after I converted it to use an approach similar to the one
> above.

Right, but that was not compared to softfloat, was it?

>  Usually, you get a bunch of simple integer instructions w/ few
> little branches, if any, which is really fast on most systems. Either
> way, we can't say for sure until someone codes it up :)
> > > Once that is done, pangocairo should be pretty much FP free for the
> > > typical code paths that I would expect to see on the 770. On
> > > timetext.c or the torturer's GtkTextView, I don't think you'll see
> > > _that_ much improvement (percentage-wise) from this change until you
> > > get Xan's XRender glyph optimization into cairo, as that is a bigger
> > > bottleneck ATM, I think.
> >
> > Yeah, if you compare the overall profiles with pangocairo ones,
> > pangocairo is taking like less than 5% of the time (possibly much less).
> > Nothing to be gained here.
> Here, I totally agree with you. This is why I haven't bother to code
> it up yet. But since Jorn was looking into eliminating FP from
> pangocairo, I thought I'd share what I think is the best way to do so,
> given that's what you want.

I went on and coded my two ideas however.  Slightly improves performance
on my laptop, but hardly measurable.  Attaching to see if they are worth

> Dan

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pangocairo-less-double-1.patch
Type: text/x-patch
Size: 2025 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20061213/3cda4ce5/pangocairo-less-double-1.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pangocairo-less-double-2.patch
Type: text/x-patch
Size: 3455 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20061213/3cda4ce5/pangocairo-less-double-2.bin

More information about the cairo mailing list