return 0;
} else if (instr->cat6.src_offset || (instr->opc == OPC_LDG) ||
(instr->opc == OPC_LDL)) {
+ struct ir3_register *src3 = instr->regs[3];
instr_cat6a_t *cat6a = ptr;
cat6->src_off = true;
cat6a->src1 = reg(src1, info, instr->repeat, IR3_REG_IMMED);
cat6a->src1_im = !!(src1->flags & IR3_REG_IMMED);
- if (src2) {
- cat6a->src2 = reg(src2, info, instr->repeat, IR3_REG_IMMED);
- cat6a->src2_im = !!(src2->flags & IR3_REG_IMMED);
- }
- cat6a->off = instr->cat6.src_offset;
+
+ /* Num components */
+ cat6a->src2 = reg(src2, info, instr->repeat, IR3_REG_IMMED);
+ cat6a->src2_im = true;
+
+ /* Offset */
+ iassert(src3->flags & IR3_REG_IMMED);
+ cat6a->off = reg(src3, info, instr->repeat, IR3_REG_IMMED);
} else {
instr_cat6b_t *cat6b = ptr;
for (int i = 0; i < intr->num_components; i++) {
struct ir3_instruction *load =
- ir3_LDG(b, addr, 0, create_immed(b, 1), 0);
+ ir3_LDG(b, addr, 0, create_immed(b, 1), 0, /* num components */
+ create_immed(b, off + i * 4), 0);
load->cat6.type = TYPE_U32;
- load->cat6.src_offset = off + i * 4; /* byte offset */
dst[i] = load;
}
}
offset = ir3_get_src(ctx, &intr->src[0])[0];
base = nir_intrinsic_base(intr);
- ldl = ir3_LDL(b, offset, 0, create_immed(b, intr->num_components), 0);
- ldl->cat6.src_offset = base;
+ ldl = ir3_LDL(b, offset, 0,
+ create_immed(b, intr->num_components), 0,
+ create_immed(b, base), 0);
+
ldl->cat6.type = utype_dst(intr->dest);
ldl->regs[0]->wrmask = MASK(intr->num_components);