[Mesa-dev] [PATCH 4/4] i965/vec4: adapt to changes in the offset() helper
Iago Toral Quiroga
itoral at igalia.com
Mon Aug 22 09:53:17 UTC 2016
This commit should be squashed with the previous one.
---
src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp | 12 +++++++-----
src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp | 8 ++++----
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp | 2 +-
src/mesa/drivers/dri/i965/brw_vec4_surface_builder.cpp | 14 +++++++-------
src/mesa/drivers/dri/i965/brw_vec4_tcs.cpp | 2 +-
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 2 +-
6 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp b/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp
index c643212..36e5701 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp
@@ -62,7 +62,7 @@ vec4_visitor::dead_code_eliminate()
for (unsigned i = 0; i < inst->regs_written; i++) {
for (int c = 0; c < 4; c++)
result_live[c] |= BITSET_TEST(
- live, var_from_reg(alloc, offset(inst->dst, i), c));
+ live, var_from_reg(alloc, offset(inst->dst, 8, i), c));
}
} else {
for (unsigned c = 0; c < 4; c++)
@@ -113,8 +113,9 @@ vec4_visitor::dead_code_eliminate()
for (unsigned i = 0; i < inst->regs_written; i++) {
for (int c = 0; c < 4; c++) {
if (inst->dst.writemask & (1 << c)) {
- BITSET_CLEAR(live, var_from_reg(alloc,
- offset(inst->dst, i), c));
+ BITSET_CLEAR(live,
+ var_from_reg(alloc,
+ offset(inst->dst, 8, i), c));
}
}
}
@@ -134,8 +135,9 @@ vec4_visitor::dead_code_eliminate()
if (inst->src[i].file == VGRF) {
for (unsigned j = 0; j < inst->regs_read(i); j++) {
for (int c = 0; c < 4; c++) {
- BITSET_SET(live, var_from_reg(alloc,
- offset(inst->src[i], j), c));
+ BITSET_SET(live,
+ var_from_reg(alloc,
+ offset(inst->src[i], 8, j), c));
}
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp b/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp
index 57d5fbb..9689db2 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_live_variables.cpp
@@ -79,7 +79,7 @@ vec4_live_variables::setup_def_use()
for (unsigned j = 0; j < inst->regs_read(i); j++) {
for (int c = 0; c < 4; c++) {
const unsigned v =
- var_from_reg(alloc, offset(inst->src[i], j), c);
+ var_from_reg(alloc, offset(inst->src[i], 8, j), c);
if (!BITSET_TEST(bd->def, v))
BITSET_SET(bd->use, v);
}
@@ -103,7 +103,7 @@ vec4_live_variables::setup_def_use()
for (int c = 0; c < 4; c++) {
if (inst->dst.writemask & (1 << c)) {
const unsigned v =
- var_from_reg(alloc, offset(inst->dst, i), c);
+ var_from_reg(alloc, offset(inst->dst, 8, i), c);
if (!BITSET_TEST(bd->use, v))
BITSET_SET(bd->def, v);
}
@@ -260,7 +260,7 @@ vec4_visitor::calculate_live_intervals()
for (unsigned j = 0; j < inst->regs_read(i); j++) {
for (int c = 0; c < 4; c++) {
const unsigned v =
- var_from_reg(alloc, offset(inst->src[i], j), c);
+ var_from_reg(alloc, offset(inst->src[i], 8, j), c);
start[v] = MIN2(start[v], ip);
end[v] = ip;
}
@@ -273,7 +273,7 @@ vec4_visitor::calculate_live_intervals()
for (int c = 0; c < 4; c++) {
if (inst->dst.writemask & (1 << c)) {
const unsigned v =
- var_from_reg(alloc, offset(inst->dst, i), c);
+ var_from_reg(alloc, offset(inst->dst, 8, i), c);
start[v] = MIN2(start[v], ip);
end[v] = ip;
}
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index c294118..fba6ffd 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -256,7 +256,7 @@ dst_reg_for_nir_reg(vec4_visitor *v, nir_register *nir_reg,
dst_reg reg;
reg = v->nir_locals[nir_reg->index];
- reg = offset(reg, base_offset);
+ reg = offset(reg, 8, base_offset);
if (indirect) {
reg.reladdr =
new(v->mem_ctx) src_reg(v->get_nir_src(*indirect,
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_surface_builder.cpp b/src/mesa/drivers/dri/i965/brw_vec4_surface_builder.cpp
index 1db349a..82f3573 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_surface_builder.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_surface_builder.cpp
@@ -42,9 +42,9 @@ namespace {
DIV_ROUND_UP(size * dst_stride, 4));
for (unsigned i = 0; i < size; ++i)
- bld.MOV(writemask(offset(dst, i * dst_stride / 4),
+ bld.MOV(writemask(offset(dst, 8, i * dst_stride / 4),
1 << (i * dst_stride % 4)),
- swizzle(offset(src, i * src_stride / 4),
+ swizzle(offset(src, 8, i * src_stride / 4),
brw_swizzle_for_mask(1 << (i * src_stride % 4))));
return src_reg(dst);
@@ -124,16 +124,16 @@ namespace brw {
unsigned n = 0;
if (header_sz)
- bld.exec_all().MOV(offset(payload, n++),
+ bld.exec_all().MOV(offset(payload, 8, n++),
retype(header, BRW_REGISTER_TYPE_UD));
for (unsigned i = 0; i < addr_sz; i++)
- bld.MOV(offset(payload, n++),
- offset(retype(addr, BRW_REGISTER_TYPE_UD), i));
+ bld.MOV(offset(payload, 8, n++),
+ offset(retype(addr, BRW_REGISTER_TYPE_UD), 8, i));
for (unsigned i = 0; i < src_sz; i++)
- bld.MOV(offset(payload, n++),
- offset(retype(src, BRW_REGISTER_TYPE_UD), i));
+ bld.MOV(offset(payload, 8, n++),
+ offset(retype(src, BRW_REGISTER_TYPE_UD), 8, i));
/* Reduce the dynamically uniform surface index to a single
* scalar.
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_tcs.cpp b/src/mesa/drivers/dri/i965/brw_vec4_tcs.cpp
index 9944803..289c17f 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_tcs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_tcs.cpp
@@ -240,7 +240,7 @@ vec4_tcs_visitor::emit_urb_write(const src_reg &value,
inst = emit(TCS_OPCODE_SET_OUTPUT_URB_OFFSETS, dst_reg(message),
brw_imm_ud(writemask), indirect_offset);
inst->force_writemask_all = true;
- inst = emit(MOV(offset(dst_reg(retype(message, value.type)), 1), value));
+ inst = emit(MOV(offset(dst_reg(retype(message, value.type)), 8, 1), value));
inst->force_writemask_all = true;
inst = emit(TCS_OPCODE_URB_WRITE, dst_null_f(), message);
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 76b2a05..944799b 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -781,7 +781,7 @@ vec4_visitor::emit_pull_constant_load_reg(dst_reg dst,
else
emit(pull);
- dst_reg index_reg = retype(offset(dst_reg(header), 1),
+ dst_reg index_reg = retype(offset(dst_reg(header), 8, 1),
offset_reg.type);
pull = MOV(writemask(index_reg, WRITEMASK_X), offset_reg);
--
2.7.4
More information about the mesa-dev
mailing list