brw_set_default_compression_control(struct brw_compile *p,
enum brw_compression compression_control)
{
+ struct brw_context *brw = p->brw;
+
p->compressed = (compression_control == BRW_COMPRESSION_COMPRESSED);
- if (p->brw->gen >= 6) {
+ if (brw->gen >= 6) {
/* Since we don't use the SIMD32 support in gen6, we translate
* the pre-gen6 compression control here.
*/
void brw_set_default_acc_write_control(struct brw_compile *p, unsigned value)
{
- if (p->brw->gen >= 6)
+ struct brw_context *brw = p->brw;
+
+ if (brw->gen >= 6)
p->current->header.acc_wr_control = value;
}
struct brw_reg dest, \
struct brw_reg src) \
{ \
+ struct brw_context *brw = p->brw; \
struct brw_instruction *rnd, *add; \
rnd = next_insn(p, BRW_OPCODE_##OP); \
brw_set_dest(p, rnd, dest); \
brw_set_src0(p, rnd, src); \
\
- if (p->brw->gen < 6) { \
+ if (brw->gen < 6) { \
/* turn on round-increments */ \
rnd->header.destreg__conditionalmod = BRW_CONDITIONAL_R; \
add = brw_ADD(p, dest, dest, brw_imm_f(1.0f)); \
last_conditional_mod[inst->flag_subreg] = n;
}
- if (inst->writes_accumulator_implicitly(v->brw->gen) &&
+ if (inst->writes_accumulator_implicitly(v->brw) &&
!inst->dst.is_accumulator()) {
add_dep(last_accumulator_write, n);
last_accumulator_write = n;
last_conditional_mod[inst->flag_subreg] = n;
}
- if (inst->writes_accumulator_implicitly(v->brw->gen)) {
+ if (inst->writes_accumulator_implicitly(v->brw)) {
last_accumulator_write = n;
}
}
last_conditional_mod = n;
}
- if (inst->writes_accumulator_implicitly(v->brw->gen) &&
+ if (inst->writes_accumulator_implicitly(v->brw) &&
!inst->dst.is_accumulator()) {
add_dep(last_accumulator_write, n);
last_accumulator_write = n;
last_conditional_mod = n;
}
- if (inst->writes_accumulator_implicitly(v->brw->gen)) {
+ if (inst->writes_accumulator_implicitly(v->brw)) {
last_accumulator_write = n;
}
}
schedule_node *
fs_instruction_scheduler::choose_instruction_to_schedule()
{
+ struct brw_context *brw = v->brw;
schedule_node *chosen = NULL;
if (mode == SCHEDULE_PRE || mode == SCHEDULE_POST) {
* then the MRFs for the next SEND, then the next SEND, then the
* MRFs, etc., without ever consuming the results of a send.
*/
- if (v->brw->gen < 7) {
+ if (brw->gen < 7) {
fs_inst *chosen_inst = (fs_inst *)chosen->inst;
/* We use regs_written > 1 as our test for the kind of send
}
bool
-backend_instruction::writes_accumulator_implicitly(int gen) const
+backend_instruction::writes_accumulator_implicitly(struct brw_context *brw) const
{
return writes_accumulator ||
- (gen < 6 &&
+ (brw->gen < 6 &&
((opcode >= BRW_OPCODE_ADD && opcode < BRW_OPCODE_NOP) ||
(opcode >= FS_OPCODE_DDX && opcode <= FS_OPCODE_LINTERP &&
opcode != FS_OPCODE_CINTERP)));
bool can_do_source_mods() const;
bool can_do_saturate() const;
bool reads_accumulator_implicitly() const;
- bool writes_accumulator_implicitly(int gen) const;
+ bool writes_accumulator_implicitly(struct brw_context *brw) const;
/**
* True if the instruction has side effects other than writing to