From ba63db1f2ecf78ab894fe411b4f27d8523cf952d Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Mon, 3 Oct 2016 13:26:54 +0200 Subject: i965/vec4: use byte_offset() instead of offset() In a later patch we want to change the semantics of offset() to be in terms of SIMD width and scalar channels so it is consistent with the definition of the same helper in the scalar backend. However, some uses of offset() in the vec4 backend do not operate naturally in terms of these semantics. In these cases it is more natural to use the byte_offset() helper instead. Reviewed-by: Francisco Jerez --- src/mesa/drivers/dri/i965/brw_vec4_cse.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/mesa/drivers/dri/i965/brw_vec4_cse.cpp') diff --git a/src/mesa/drivers/dri/i965/brw_vec4_cse.cpp b/src/mesa/drivers/dri/i965/brw_vec4_cse.cpp index 1b91db95a80..bf7e4a4f070 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_cse.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_cse.cpp @@ -182,8 +182,9 @@ vec4_visitor::opt_cse_local(bblock_t *block) NULL), inst->dst.type); for (unsigned i = 0; i < regs_written(entry->generator); ++i) { - vec4_instruction *copy = MOV(offset(entry->generator->dst, i), - offset(entry->tmp, i)); + vec4_instruction *copy = + MOV(byte_offset(entry->generator->dst, i * REG_SIZE), + byte_offset(entry->tmp, i * REG_SIZE)); copy->force_writemask_all = entry->generator->force_writemask_all; entry->generator->insert_after(block, copy); @@ -197,8 +198,9 @@ vec4_visitor::opt_cse_local(bblock_t *block) assert(inst->dst.type == entry->tmp.type); for (unsigned i = 0; i < regs_written(inst); ++i) { - vec4_instruction *copy = MOV(offset(inst->dst, i), - offset(entry->tmp, i)); + vec4_instruction *copy = + MOV(byte_offset(inst->dst, i * REG_SIZE), + byte_offset(entry->tmp, i * REG_SIZE)); copy->force_writemask_all = inst->force_writemask_all; inst->insert_before(block, copy); } -- cgit v1.2.3