OSDN Git Service

cell: unroll inner loop of spu_render.c:cmd_render()
authorJonathan Adamczewski <jadamcze@utas.edu.au>
Thu, 21 May 2009 14:18:03 +0000 (08:18 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 21 May 2009 14:18:03 +0000 (08:18 -0600)
commitb4824520ecf453cd8de90e57e839cb11a698d9c0
tree2ec3bd7a633fd704c9b04e6acf9f6760bc4418da
parent5b27b4ad37bd992d2d3a6fd9d407277113544f30
cell: unroll inner loop of spu_render.c:cmd_render()

It was taking approximately 50 cycles to extract the vertex indices,
calculate the vertex_header pointers and call tri_draw() for each
three vertices - .

Unrolled, it takes less than 100 cycles to extract, unpack,
calculate pointers and call tri_draw() eight times.  It does have a
nasty jump-tabled switch.  I'm sure that there's a better way...

Code size of spu_render.o gets larger due to the extra constants and
work in the inner loop, there are extra stack saves and loads
because there are more registers in use, and an assert.  spu_tri.o
gets a little smaller.
src/gallium/drivers/cell/spu/spu_render.c
src/gallium/drivers/cell/spu/spu_tri.c
src/gallium/drivers/cell/spu/spu_tri.h