llvmpipe: use some local vars to index step arrays
authorBrian Paul <brianp@vmware.com>
Fri, 22 Jan 2010 02:09:59 +0000 (19:09 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 22 Jan 2010 02:10:03 +0000 (19:10 -0700)
Saves a few more cycles.

src/gallium/drivers/llvmpipe/lp_rast_tri.c

index e9d15727a7ba7bc57ef39413c9b3c608c4f211e7..3f76f159df1f7e06b87aad3fafcd0626e04e3bbf 100644 (file)
@@ -153,16 +153,18 @@ do_block_16( struct lp_rasterizer_task *rast_task,
    const int eo1 = tri->eo1 * 4;
    const int eo2 = tri->eo2 * 4;
    const int eo3 = tri->eo3 * 4;
-
+   const int *step0 = tri->inputs.step[0];
+   const int *step1 = tri->inputs.step[1];
+   const int *step2 = tri->inputs.step[2];
    int i;
 
    assert(x % 16 == 0);
    assert(y % 16 == 0);
 
    for (i = 0; i < 16; i++) {
-      int cx1 = c1 + (tri->inputs.step[0][i] * 4);
-      int cx2 = c2 + (tri->inputs.step[1][i] * 4);
-      int cx3 = c3 + (tri->inputs.step[2][i] * 4);
+      int cx1 = c1 + step0[i] * 4;
+      int cx2 = c2 + step1[i] * 4;
+      int cx3 = c3 + step2[i] * 4;
 
       if (cx1 + eo1 < 0 ||
           cx2 + eo2 < 0 ||