i965: Create a "brw_last_inst" convenience macro.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 28 May 2014 06:27:01 +0000 (23:27 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 2 Jun 2014 22:09:23 +0000 (15:09 -0700)
commit42c292006c94b0b84645448af958fdb6235acbfb
tree19155fd7ca317ce5d6369287a47626f809484722
parent8deb91b2e75a65b979bd9d70c8700d2c38443336
i965: Create a "brw_last_inst" convenience macro.

Often times, we want to emit an instruction, then set one field on it,
such as predication or a conditional modifier.  Normally, we'd have to
declare "struct brw_instruction *inst;" and then use "inst =
brw_FOO(...)" to emit the instruction, which can hurt readability.

The new "brw_last_inst" macro refers to the most recently emitted
instruction, so you can just do:

    brw_ADD(...)
    brw_last_inst->header.predicate_control = BRW_PREDICATE_NORMAL;

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_eu.h