m_src2(value2),
m_dest(dest),
m_dest_swizzle({PIPE_SWIZZLE_X,7,7,7}),
- m_src_swizzle({PIPE_SWIZZLE_0, PIPE_SWIZZLE_X, 7}),
+ m_src_swizzle({PIPE_SWIZZLE_0, PIPE_SWIZZLE_X, PIPE_SWIZZLE_0}),
m_buffer_index_mode(bim_none),
m_uav_id(uav_id),
m_uav_base(uav_base),
m_flags(0)
{
add_remappable_src_value(&m_src);
+ add_remappable_src_value(&m_src2);
add_remappable_src_value(&m_uav_id);
add_remappable_dst_value(&m_dest);
+ m_dest_swizzle[0] = m_dest.chan_i(0);
}
GDSInstr::GDSInstr(ESDOp op, const GPRVector& dest, const PValue& value,
const PValue& uav_id, int uav_base):
GDSInstr(op, dest, value, PValue(), uav_id, uav_base)
{
+ assert(value);
+ m_src_swizzle[1] = value->chan();
+ m_src_swizzle[2] = PIPE_SWIZZLE_MAX;
}
GDSInstr::GDSInstr(ESDOp op, const GPRVector& dest,
const PValue& uav_id, int uav_base):
GDSInstr(op, dest, PValue(), PValue(), uav_id, uav_base)
{
- m_src_swizzle[1] = PIPE_SWIZZLE_1;
+ m_src_swizzle[1] = PIPE_SWIZZLE_0;
}
bool GDSInstr::is_equal_to(UNUSED const Instruction& lhs) const
os << "MEM_RAT RAT(" << m_rat_id;
if (m_rat_id_offset)
os << "+" << *m_rat_id_offset;
- os << ") @" << m_index << " OP:" << m_rat_op << " " << m_data;
+ os << ") @" << m_index;
+ os << " OP:" << m_rat_op << " " << m_data;
os << " BC:" << m_burst_count
<< " MASK:" << m_comp_mask
<< " ES:" << m_element_size;
{
auto addr = tex_instr.sampler_offset();
if (addr && (!m_bc->index_loaded[1] || m_loop_nesting
- || m_bc->index_reg[1] != addr->sel())) {
+ || m_bc->index_reg[1] != addr->sel()
+ || m_bc->index_reg_chan[1] != addr->chan())) {
struct r600_bytecode_alu alu;
memset(&alu, 0, sizeof(alu));
alu.op = opcode_map.at(op1_mova_int);
return false;
m_bc->index_reg[1] = addr->sel();
+ m_bc->index_reg_chan[1] = addr->chan();
m_bc->index_loaded[1] = true;
}
buffer_offset = boffs.value();
} else {
index_mode = bim_zero;
- if ((!m_bc->index_loaded[0] || m_loop_nesting || m_bc->index_reg[0] != addr->sel())) {
+ if ((!m_bc->index_loaded[0] || m_loop_nesting ||
+ m_bc->index_reg[0] != addr->sel() ||
+ m_bc->index_reg_chan[0] != addr->chan())) {
struct r600_bytecode_alu alu;
memset(&alu, 0, sizeof(alu));
alu.op = opcode_map.at(op1_mova_int);
return false;
m_bc->index_reg[0] = addr->sel();
+ m_bc->index_reg_chan[0] = addr->chan();
m_bc->index_loaded[0] = true;
}
}
auto addr = instr.uav_id();
if (addr->type() != Value::literal) {
if (!m_bc->index_loaded[1] || m_loop_nesting ||
- m_bc->index_reg[1] != addr->sel()) {
+ m_bc->index_reg[1] != addr->sel()
+ || m_bc->index_reg_chan[1] != addr->chan()) {
struct r600_bytecode_alu alu;
memset(&alu, 0, sizeof(alu));
return false;
m_bc->index_reg[1] = addr->sel();
+ m_bc->index_reg_chan[1] = addr->chan();
m_bc->index_loaded[1] = true;
}
} else {
if (addr) {
if (addr->type() != Value::literal) {
rat_index_mode = bim_one;
- if (!m_bc->index_loaded[1] || m_loop_nesting || m_bc->index_reg[1] != addr->sel()) {
+ if (!m_bc->index_loaded[1] || m_loop_nesting ||
+ m_bc->index_reg[1] != addr->sel()
+ || m_bc->index_reg_chan[1] != addr->chan()) {
struct r600_bytecode_alu alu;
memset(&alu, 0, sizeof(alu));
return false;
m_bc->index_reg[1] = addr->sel();
+ m_bc->index_reg_chan[1] = addr->chan();
m_bc->index_loaded[1] = true;
}
} else {
const LiteralValue& addr_reg = static_cast<const LiteralValue&>(*addr);
- rat_idx = addr_reg.value();
+ rat_idx += addr_reg.value();
}
}
memset(&gds, 0, sizeof(struct r600_bytecode_gds));
dst.sel = d.sel();
dst.chan = d.chan();
- if (m_bc->index_reg[1] == dst.sel)
+ if (m_bc->index_reg[1] == dst.sel &&
+ m_bc->index_reg_chan[1] == dst.chan)
m_bc->index_loaded[1] = false;
- if (m_bc->index_reg[0] == dst.sel)
+ if (m_bc->index_reg[0] == dst.sel &&
+ m_bc->index_reg_chan[0] == dst.chan)
m_bc->index_loaded[0] = false;
return true;