summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2016-04-13 16:04:04 -0700
committerKenneth Graunke <kenneth@whitecape.org>2016-04-20 15:05:13 -0700
commit2a25a5142bd78b22cc9ada41b8988bb282c2a7ac (patch)
treeebad5df241574608eec8f0f66d841be5e7f0a5dc /src
parent9967561158acd94edff0fa93ceaf4bc527e271ed (diff)
i965: Fold vectorize_mov() back into the one caller.
After the previous patch, this helper is only called in one place. So, just fold it back in - there are a lot of parameters here and not much code. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4.cpp40
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4.h4
2 files changed, 16 insertions, 28 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index 033eccee3ba..4557a650f71 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -350,28 +350,6 @@ src_reg::equals(const src_reg &r) const
}
bool
-vec4_visitor::vectorize_mov(bblock_t *block, vec4_instruction *inst,
- uint8_t imm[4], vec4_instruction *imm_inst[4],
- int inst_count, unsigned writemask)
-{
- if (inst_count < 2)
- return false;
-
- unsigned vf;
- memcpy(&vf, imm, sizeof(vf));
- vec4_instruction *mov = MOV(imm_inst[0]->dst, brw_imm_vf(vf));
- mov->dst.type = BRW_REGISTER_TYPE_F;
- mov->dst.writemask = writemask;
- inst->insert_before(block, mov);
-
- for (int i = 0; i < inst_count; i++) {
- imm_inst[i]->remove(block);
- }
-
- return true;
-}
-
-bool
vec4_visitor::opt_vector_float()
{
bool progress = false;
@@ -405,8 +383,22 @@ vec4_visitor::opt_vector_float()
if (last_reg != inst->dst.nr ||
last_reg_offset != inst->dst.reg_offset ||
last_reg_file != inst->dst.file) {
- progress |= vectorize_mov(block, inst, imm, imm_inst, inst_count,
- writemask);
+
+ if (inst_count > 1) {
+ unsigned vf;
+ memcpy(&vf, imm, sizeof(vf));
+ vec4_instruction *mov = MOV(imm_inst[0]->dst, brw_imm_vf(vf));
+ mov->dst.type = BRW_REGISTER_TYPE_F;
+ mov->dst.writemask = writemask;
+ inst->insert_before(block, mov);
+
+ for (int i = 0; i < inst_count; i++) {
+ imm_inst[i]->remove(block);
+ }
+
+ progress = true;
+ }
+
inst_count = 0;
last_reg = -1;
writemask = 0;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h
index 11db159109f..4708b6620e3 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4.h
@@ -359,10 +359,6 @@ protected:
virtual void gs_end_primitive();
private:
- bool vectorize_mov(bblock_t *block, vec4_instruction *inst,
- uint8_t imm[4], vec4_instruction *imm_inst[4],
- int inst_count, unsigned writemask);
-
/**
* If true, then register allocation should fail instead of spilling.
*/