}
static bool
-bi_assign_uniform_constant_single(
- bi_registers *regs,
- bi_clause *clause,
- bi_instruction *ins, bool assigned, bool fast_zero)
+bi_assign_fau_idx_single(bi_registers *regs,
+ bi_clause *clause,
+ bi_instruction *ins,
+ bool assigned,
+ bool fast_zero)
{
if (!ins)
return assigned;
if (ins->type == BI_BLEND) {
assert(!assigned);
- regs->uniform_constant = 0x8;
+ regs->fau_idx = 0x8;
return true;
}
/* Build the constant */
unsigned C = bi_constant_field(idx) | lo;
- if (assigned && regs->uniform_constant != C)
- unreachable("Mismatched uniform/const field: branch");
+ if (assigned && regs->fau_idx != C)
+ unreachable("Mismatched fau_idx: branch");
- regs->uniform_constant = C;
+ regs->fau_idx = C;
return true;
}
unsigned lo = clause->constants[idx] & 0xF;
unsigned f = bi_constant_field(idx) | lo;
- if (assigned && regs->uniform_constant != f)
+ if (assigned && regs->fau_idx != f)
unreachable("Mismatched uniform/const field: imm");
- regs->uniform_constant = f;
- ins->src[s] = BIR_INDEX_PASS | (hi ? BIFROST_SRC_CONST_HI : BIFROST_SRC_CONST_LO);
+ regs->fau_idx = f;
+ ins->src[s] = BIR_INDEX_PASS | (hi ? BIFROST_SRC_FAU_HI : BIFROST_SRC_FAU_LO);
assigned = true;
} else if (ins->src[s] & BIR_INDEX_ZERO && (ins->type == BI_LOAD_UNIFORM || ins->type == BI_LOAD_VAR)) {
/* XXX: HACK UNTIL WE HAVE HI MATCHING DUE TO OVERFLOW XXX */
- ins->src[s] = BIR_INDEX_PASS | BIFROST_SRC_CONST_HI;
+ ins->src[s] = BIR_INDEX_PASS | BIFROST_SRC_FAU_HI;
} else if (ins->src[s] & BIR_INDEX_ZERO && !fast_zero) {
/* FMAs have a fast zero slot, ADD needs to use the
* uniform/const slot's special 0 mode handled here */
unsigned f = 0;
- if (assigned && regs->uniform_constant != f)
+ if (assigned && regs->fau_idx != f)
unreachable("Mismatched uniform/const field: 0");
- regs->uniform_constant = f;
- ins->src[s] = BIR_INDEX_PASS | BIFROST_SRC_CONST_LO;
+ regs->fau_idx = f;
+ ins->src[s] = BIR_INDEX_PASS | BIFROST_SRC_FAU_LO;
assigned = true;
} else if (ins->src[s] & BIR_INDEX_ZERO && fast_zero) {
ins->src[s] = BIR_INDEX_PASS | BIFROST_SRC_STAGE;
}
static void
-bi_assign_uniform_constant(
- bi_clause *clause,
- bi_registers *regs,
- bi_bundle bundle)
+bi_assign_fau_idx(bi_clause *clause,
+ bi_registers *regs,
+ bi_bundle bundle)
{
bool assigned =
- bi_assign_uniform_constant_single(regs, clause, bundle.fma, false, true);
+ bi_assign_fau_idx_single(regs, clause, bundle.fma, false, true);
- bi_assign_uniform_constant_single(regs, clause, bundle.add, assigned, false);
+ bi_assign_fau_idx_single(regs, clause, bundle.add, assigned, false);
}
/* Assigns a slot for reading, before anything is written */
s.reg2 = regs.slot[2];
s.reg3 = regs.slot[3];
- s.uniform_const = regs.uniform_constant;
+ s.fau_idx = regs.fau_idx;
memcpy(&packed, &s, sizeof(s));
return packed;
struct bifrost_branch pack = {
.src0 = bi_get_src(ins, regs, 0),
.src1 = (zero_ctrl << 1) | !slot_swapped,
- .src2 = BIFROST_SRC_CONST_HI,
+ .src2 = BIFROST_SRC_FAU_HI,
.cond = BR_COND_EQ,
.size = BR_SIZE_ZERO,
.op = BIFROST_ADD_OP_BRANCH
{
struct bifrost_branch pack = {
/* It's unclear what these bits actually mean */
- .src0 = BIFROST_SRC_CONST_LO,
+ .src0 = BIFROST_SRC_FAU_LO,
.src1 = BIFROST_SRC_PASS_FMA,
/* Offset, see above */
- .src2 = BIFROST_SRC_CONST_HI,
+ .src2 = BIFROST_SRC_FAU_HI,
/* All ones in fact */
.cond = (BR_ALWAYS & 0x7),
bi_pack_bundle(bi_clause *clause, bi_bundle bundle, bi_bundle prev, bool first_bundle, gl_shader_stage stage)
{
bi_assign_slots(&bundle, &prev);
- bi_assign_uniform_constant(clause, &bundle.regs, bundle);
+ bi_assign_fau_idx(clause, &bundle.regs, bundle);
bundle.regs.first_instruction = first_bundle;
bi_flip_slots(&bundle.regs);
else if (ctrl.slot23.slot3 == BIFROST_OP_WRITE_HI)
fprintf(fp, "slot 3: r%d (write hi %s) ", srcs.reg3, slot3_fma);
- if (srcs.uniform_const) {
- if (srcs.uniform_const & 0x80) {
- fprintf(fp, "uniform: u%d", (srcs.uniform_const & 0x7f) * 2);
+ if (srcs.fau_idx) {
+ if (srcs.fau_idx & 0x80) {
+ fprintf(fp, "uniform: u%d", (srcs.fau_idx & 0x7f) * 2);
}
}
return map[fau_value];
}
-static void dump_uniform_const_src(FILE *fp, struct bifrost_regs srcs, struct bi_constants *consts, bool high32)
+static void dump_fau_src(FILE *fp, struct bifrost_regs srcs, struct bi_constants *consts, bool high32)
{
- if (srcs.uniform_const & 0x80) {
- unsigned uniform = (srcs.uniform_const & 0x7f);
+ if (srcs.fau_idx & 0x80) {
+ unsigned uniform = (srcs.fau_idx & 0x7f);
fprintf(fp, "u%d.w%d", uniform, high32);
- } else if (srcs.uniform_const >= 0x20) {
- unsigned idx = const_fau_to_idx(srcs.uniform_const >> 4);
+ } else if (srcs.fau_idx >= 0x20) {
+ unsigned idx = const_fau_to_idx(srcs.fau_idx >> 4);
uint64_t imm = consts->raw[idx];
- imm |= (srcs.uniform_const & 0xf);
+ imm |= (srcs.fau_idx & 0xf);
if (consts->mods[idx] != BI_CONSTMOD_NONE)
dump_pc_imm(fp, imm, consts->mods[idx], high32);
else if (high32)
else
dump_const_imm(fp, imm);
} else {
- switch (srcs.uniform_const) {
+ switch (srcs.fau_idx) {
case 0:
fprintf(fp, "#0");
break;
case 13:
case 14:
case 15:
- fprintf(fp, "blend_descriptor_%u", (unsigned) srcs.uniform_const - 8);
+ fprintf(fp, "blend_descriptor_%u", (unsigned) srcs.fau_idx - 8);
break;
default:
- fprintf(fp, "XXX - reserved%u", (unsigned) srcs.uniform_const);
+ fprintf(fp, "XXX - reserved%u", (unsigned) srcs.fau_idx);
break;
}
fprintf(fp, "t"); // i.e. the output of FMA this cycle
break;
case 4:
- dump_uniform_const_src(fp, srcs, consts, false);
+ dump_fau_src(fp, srcs, consts, false);
break;
case 5:
- dump_uniform_const_src(fp, srcs, consts, true);
+ dump_fau_src(fp, srcs, consts, true);
break;
case 6:
fprintf(fp, "t0");