From: Kenneth Graunke Date: Sat, 7 Jun 2014 09:27:43 +0000 (-0700) Subject: i965/fs: Drop the generate_math[12]_gen7 methods. X-Git-Tag: upstream/10.3~1590 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=35e48bd6188a56097016eb1c05e16d1ba35345c4;p=platform%2Fupstream%2Fmesa.git 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 --- diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index cda344e..9c4e116 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 6c028d8..9a59274 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp @@ -293,25 +293,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) @@ -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 {