[Mesa-dev] [PATCH 5/6] i965/fs: Drop the generate_math[12]_gen7 methods.
Kenneth Graunke
kenneth at whitecape.org
Sat Jun 7 11:47:42 PDT 2014
These functions are basically identical, so we should combine them.
However, they're so trivial, we may as well just fold them into their
only call sites.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/brw_fs.h | 7 -------
src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 28 +++++---------------------
2 files changed, 5 insertions(+), 30 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index d91b966..bf30508 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -622,13 +622,6 @@ private:
void generate_linterp(fs_inst *inst, struct brw_reg dst,
struct brw_reg *src);
void generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src);
- void generate_math1_gen7(fs_inst *inst,
- struct brw_reg dst,
- struct brw_reg src);
- void generate_math2_gen7(fs_inst *inst,
- struct brw_reg dst,
- struct brw_reg src0,
- struct brw_reg src1);
void generate_math1_gen6(fs_inst *inst,
struct brw_reg dst,
struct brw_reg src);
diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
index 06c8fdb..5dda8c9 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp
@@ -255,25 +255,6 @@ fs_generator::generate_linterp(fs_inst *inst,
}
void
-fs_generator::generate_math1_gen7(fs_inst *inst,
- struct brw_reg dst,
- struct brw_reg src0)
-{
- assert(inst->mlen == 0);
- gen6_math(p, dst, brw_math_function(inst->opcode), src0, brw_null_reg());
-}
-
-void
-fs_generator::generate_math2_gen7(fs_inst *inst,
- struct brw_reg dst,
- struct brw_reg src0,
- struct brw_reg src1)
-{
- assert(inst->mlen == 0);
- gen6_math(p, dst, brw_math_function(inst->opcode), src0, src1);
-}
-
-void
fs_generator::generate_math1_gen6(fs_inst *inst,
struct brw_reg dst,
struct brw_reg src0)
@@ -300,8 +281,6 @@ fs_generator::generate_math2_gen6(fs_inst *inst,
{
int op = brw_math_function(inst->opcode);
- assert(inst->mlen == 0);
-
brw_set_default_compression_control(p, BRW_COMPRESSION_NONE);
gen6_math(p, dst, op, src0, src1);
@@ -1587,8 +1566,10 @@ fs_generator::generate_code(exec_list *instructions)
case SHADER_OPCODE_LOG2:
case SHADER_OPCODE_SIN:
case SHADER_OPCODE_COS:
+ assert(brw->gen < 6 || inst->mlen == 0);
if (brw->gen >= 7) {
- generate_math1_gen7(inst, dst, src[0]);
+ gen6_math(p, dst, brw_math_function(inst->opcode), src[0],
+ brw_null_reg());
} else if (brw->gen == 6) {
generate_math1_gen6(inst, dst, src[0]);
} else if (brw->gen == 5 || brw->is_g4x) {
@@ -1600,8 +1581,9 @@ fs_generator::generate_code(exec_list *instructions)
case SHADER_OPCODE_INT_QUOTIENT:
case SHADER_OPCODE_INT_REMAINDER:
case SHADER_OPCODE_POW:
+ assert(brw->gen < 6 || inst->mlen == 0);
if (brw->gen >= 7) {
- generate_math2_gen7(inst, dst, src[0], src[1]);
+ gen6_math(p, dst, brw_math_function(inst->opcode), src[0], src[1]);
} else if (brw->gen == 6) {
generate_math2_gen6(inst, dst, src[0], src[1]);
} else {
--
2.0.0
More information about the mesa-dev
mailing list