i965: Replace the subroutine-skipping jump in VS with a NOP if it's a NOP.
authorEric Anholt <eric@anholt.net>
Fri, 7 Aug 2009 21:20:56 +0000 (14:20 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 8 Aug 2009 01:33:08 +0000 (18:33 -0700)
This showed a 1.9% (+/-.3%, n=3) improvement in OA performance with high
geometry settings.

src/mesa/drivers/dri/i965/brw_vs_emit.c

index f56e9862e4c2b8e85e82df134500a5a8872acb4f..83167b9258ee427aa1ae2ecef2d35ce914e0394a 100644 (file)
@@ -1262,7 +1262,11 @@ post_vs_emit( struct brw_vs_compile *c,
 
    /* patch up the END code to jump past subroutines, etc */
    offset = last_inst - end_inst;
-   brw_set_src1(end_inst, brw_imm_d(offset * 16));
+   if (offset > 1) {
+      brw_set_src1(end_inst, brw_imm_d(offset * 16));
+   } else {
+      end_inst->header.opcode = BRW_OPCODE_NOP;
+   }
 }
 
 static uint32_t