From 35e48bd6188a56097016eb1c05e16d1ba35345c4 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 7 Jun 2014 02:27:43 -0700 Subject: [PATCH] i965/fs: Drop the generate_math[12]_gen7 methods. 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 Reviewed-by: Matt Turner Reviewed-by: Jordan Justen --- src/mesa/drivers/dri/i965/brw_fs.h | 7 ----- .../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 cda344e47cb..9c4e116e3f6 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -627,13 +627,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 6c028d8f73c..9a592747458 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp @@ -292,25 +292,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, @@ -338,8 +319,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); @@ -1625,8 +1604,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) { @@ -1638,8 +1619,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.30.2