[NEON] Replace Ian's glyph-blitter with a better one.
authorJonathan Morton <jmorton@sd070.hel.movial.fi>
Tue, 16 Jun 2009 16:08:29 +0000 (12:08 -0400)
committerJeff Muizelaar <jrmuizel@jeff-desktop.(none)>
Tue, 16 Jun 2009 16:08:58 +0000 (12:08 -0400)
commit8eeeca993252edc39da9c5c57545b81215fafc81
treec5ffad510f40ed3740a60d18f5f6cd113e2eef41
parent1a7f25946b5b64aa604fab0f6d428bacb5296a4e
[NEON] Replace Ian's glyph-blitter with a better one.

Each scanline of the destination is bulk-loaded into a cached buffer on
the stack (using the QuadWordCopy routine) before being processed.  This
is the primary benefit on uncached framebuffers, since it is necessary
to minimise the number of accesses to such things and avoid
write-to-read turnarounds.

This also simplifies edge handling, since QuadWordCopy() can do a
precise writeback efficiently via the write-combiner, allowing the main
routine to "over-read" the scanline edge safely when required.  This is
why the glyph's mask data is also copied into a temporary buffer of
known size.

Each group of 8 pixels is then processed using fewer instructions,
taking advantage of the lower precision requirements of the 6-bit
destination (so a simpler pixel multiply can be used) and using a more
efficient bit-repacking method.

(As an aside, this patch removes nearly twice as much code as it
introduces.  Most of this is due to duplication of Ian's inner loop,
since he has to handle narrow cases separately.  RVCT support is of
course preserved.)

We measured the doubling of performance by rendering 96-pixel height
glyph strings, which are fillrate limited rather than latency/overhead
limited.  The performance is also improved, albeit by a smaller amount,
on the more usual smaller text, demonstrating that internal overhead is
not a problem.
pixman/pixman-arm-neon.c