aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_generator.cpp17
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_nir.cpp18
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp6
3 files changed, 10 insertions, 31 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
index 1b2ce15dbce..92050b94d33 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
@@ -996,21 +996,8 @@ vec4_generator::generate_pull_constant_load(vec4_instruction *inst,
gen6_resolve_implied_move(p, &header, inst->base_mrf);
- if (devinfo->gen >= 6) {
- if (offset.file == BRW_IMMEDIATE_VALUE) {
- brw_MOV(p, retype(brw_message_reg(inst->base_mrf + 1),
- BRW_REGISTER_TYPE_D),
- brw_imm_d(offset.dw1.ud >> 4));
- } else {
- brw_SHR(p, retype(brw_message_reg(inst->base_mrf + 1),
- BRW_REGISTER_TYPE_D),
- offset, brw_imm_d(4));
- }
- } else {
- brw_MOV(p, retype(brw_message_reg(inst->base_mrf + 1),
- BRW_REGISTER_TYPE_D),
- offset);
- }
+ brw_MOV(p, retype(brw_message_reg(inst->base_mrf + 1), BRW_REGISTER_TYPE_D),
+ offset);
uint32_t msg_type;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
index b2adb9aaea5..23b2fabd98e 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
@@ -660,20 +660,12 @@ vec4_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
unsigned const_offset = instr->const_index[0];
src_reg offset;
- if (devinfo->gen <= 6) {
- if (!has_indirect) {
- offset = src_reg(const_offset & ~15);
- } else {
- offset = get_nir_src(instr->src[1], nir_type_int, 1);
- }
+ if (!has_indirect) {
+ offset = src_reg(const_offset / 16);
} else {
- if (!has_indirect) {
- offset = src_reg(const_offset & ~15);
- } else {
- offset = src_reg(this, glsl_type::uint_type);
- emit(SHR(dst_reg(offset), get_nir_src(instr->src[1], nir_type_int, 1),
- src_reg(4u)));
- }
+ offset = src_reg(this, glsl_type::uint_type);
+ emit(SHR(dst_reg(offset), get_nir_src(instr->src[1], nir_type_int, 1),
+ src_reg(4u)));
}
src_reg packed_consts = src_reg(this, glsl_type::vec4_type);
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 005c8b1ac39..9062bcc444f 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -3432,10 +3432,10 @@ vec4_visitor::get_pull_constant_offset(bblock_t * block, vec4_instruction *inst,
emit_before(block, inst, ADD(dst_reg(index), *reladdr,
src_reg(reg_offset)));
- /* Pre-gen7, the message header uses byte offsets instead of vec4
+ /* Pre-gen6, the message header uses byte offsets instead of vec4
* (16-byte) offset units.
*/
- if (devinfo->gen < 7) {
+ if (devinfo->gen < 6) {
emit_before(block, inst, MUL(dst_reg(index), index, src_reg(16)));
}
@@ -3446,7 +3446,7 @@ vec4_visitor::get_pull_constant_offset(bblock_t * block, vec4_instruction *inst,
emit_before(block, inst, MOV(dst_reg(offset), src_reg(reg_offset)));
return offset;
} else {
- int message_header_scale = devinfo->gen < 7 ? 16 : 1;
+ int message_header_scale = devinfo->gen < 6 ? 16 : 1;
return src_reg(reg_offset * message_header_scale);
}
}