i965: Split Gen4-5 and Gen6+ MATH instruction emitters.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 7 Jun 2014 08:56:12 +0000 (01:56 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 10 Jun 2014 23:38:26 +0000 (16:38 -0700)
commitde65ec2fdeb3a22d408db24535d738b39cc3402c
tree51ce940f5ced365db43a0b09d48059c8e57d7230
parent7b9cf797903a5ea70072a28c0486d3e99ee60645
i965: Split Gen4-5 and Gen6+ MATH instruction emitters.

Our existing functions, brw_math and brw_math2, had unclear roles:

Gen4-5 used brw_math for both unary and binary math functions; it never
used brw_math2.  Since operands are already in message registers, this
is reasonable.

Gen6+ used brw_math for unary math functions, and brw_math2 for binary
math functions, duplicating a lot of code.  The only real difference was
that brw_math used brw_null_reg() for src1.

This patch improves brw_math2's assertions to allow both unary and
binary operations, renames it to gen6_math(), and drops the Gen6+ code
out of brw_math().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_eu_emit.c
src/mesa/drivers/dri/i965/brw_fs_generator.cpp
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp