LdsDirectVALUHazardBlockState& block_state,
aco_ptr<Instruction>& instr)
{
- if (instr->isVALU() || instr->isVINTERP_INREG()) {
+ if (instr->isVALU()) {
block_state.has_trans |= instr->isTrans();
bool uses_vgpr = false;
if (instr->isSALU() && !instr->definitions.empty()) {
if (block_state.state == written_after_exec_write && instr_writes_exec(instr))
block_state.state = exec_written;
- } else if (instr->isVALU() || instr->isVINTERP_INREG()) {
+ } else if (instr->isVALU()) {
bool vgpr_write = false;
for (Definition& def : instr->definitions) {
if (def.physReg().reg() < 256)
* For the hazard, there must be less than 3 VALU between the first and second VGPR writes.
* There also must be less than 5 VALU between the second VGPR write and the current instruction.
*/
- if (state.program->wave_size != 64 || (!instr->isVALU() && !instr->isVINTERP_INREG()))
+ if (state.program->wave_size != 64 || !instr->isVALU())
return false;
unsigned num_vgprs = 0;
* VALU reads VGPR written by transcendental instruction without 6+ VALU or 2+ transcendental
* in-between.
*/
- if (va_vdst > 0 && (instr->isVALU() || instr->isVINTERP_INREG())) {
+ if (va_vdst > 0 && instr->isVALU()) {
uint8_t num_valu = 15;
uint8_t num_trans = 15;
for (Operand& op : instr->operands) {
if (sa_sdst == 0)
ctx.sgpr_read_by_valu_as_lanemask_then_wr_by_salu.reset();
- if (instr->isVALU() || instr->isVINTERP_INREG()) {
+ if (instr->isVALU()) {
bool is_trans = instr->isTrans();
ctx.valu_since_wr_by_trans.inc();
for (Operand& op : instr->operands)
fill_vgpr_bitset(ctx.vgpr_used_by_ds, op.physReg(), op.bytes());
}
- if (instr->isVALU() || instr->isVINTERP_INREG() || instr->isEXP() || vm_vsrc == 0) {
+ if (instr->isVALU() || instr->isEXP() || vm_vsrc == 0) {
ctx.vgpr_used_by_vmem_load.reset();
ctx.vgpr_used_by_vmem_store.reset();
ctx.vgpr_used_by_ds.reset();
continue;
wait.combine(it->second.imm);
- if (instr->isVALU() || instr->isSALU() || instr->isVINTERP_INREG())
+ if (instr->isVALU() || instr->isSALU())
delay.combine(it->second.delay);
}
}
gen_alu(Instruction* instr, wait_ctx& ctx)
{
Instruction_cycle_info cycle_info = get_cycle_info(*ctx.program, *instr);
- bool is_valu = instr->isVALU() || instr->isVINTERP_INREG();
+ bool is_valu = instr->isVALU();
bool is_trans = instr->isTrans();
bool clear = instr->isEXP() || instr->isDS() || instr->isMIMG() || instr->isFlatLike() ||
instr->isMUBUF() || instr->isMTBUF();
if (instr->operands.size() && instr->operands[0].isLiteral())
return false;
- if (instr->isSDWA() || instr->isVOP3P())
+ if (instr->isSDWA() || instr->isVINTERP_INREG() || instr->isVOP3P())
return false;
if (!pre_ra && (instr->isVOPC() || instr->definitions.size() > 1) &&
constexpr bool isVALU() const noexcept
{
- return isVOP1() || isVOP2() || isVOPC() || isVOP3() || isVOP3P();
+ return isVOP1() || isVOP2() || isVOPC() || isVOP3() || isVOP3P() || isVINTERP_INREG();
}
constexpr bool isSALU() const noexcept
can_remove = false;
} else if (inst->isSALU()) {
num_scalar++;
- } else if (inst->isVALU() || inst->isVINTRP() || inst->isVINTERP_INREG()) {
+ } else if (inst->isVALU() || inst->isVINTRP()) {
num_vector++;
/* VALU which writes SGPRs are always executed on GFX10+ */
if (ctx.program->gfx_level >= GFX10) {
else if (instr->opcode == aco_opcode::v_writelane_b32_e64 ||
instr->opcode == aco_opcode::v_writelane_b32)
return 2; /* potentially VOP3, but reads VDST as SRC2 */
- else if (instr->isVOP3() || instr->isVOP3P())
+ else if (instr->isVOP3() || instr->isVOP3P() || instr->isVINTERP_INREG())
return instr->operands.size();
}
}
assert(rc.bytes() <= 2);
- if (instr->isVALU() || instr->isVINTERP_INREG()) {
+ if (instr->isVALU()) {
if (can_use_SDWA(gfx_level, instr, false))
return rc.bytes();
if (can_use_opsel(gfx_level, instr->opcode, idx))
return;
assert(rc.bytes() <= 2);
- if (instr->isVALU() || instr->isVINTERP_INREG()) {
+ if (instr->isVALU()) {
/* check if we can use opsel */
if (instr->format == Format::VOP3) {
assert(byte == 2);
return std::make_pair(4, rc.size() * 4u);
}
- if (instr->isVALU() || instr->isVINTRP() || instr->isVINTERP_INREG()) {
+ if (instr->isVALU() || instr->isVINTRP()) {
assert(rc.bytes() <= 2);
if (can_use_SDWA(gfx_level, instr, false))
if (instr->isPseudo())
return;
- if (instr->isVALU() || instr->isVINTERP_INREG()) {
+ if (instr->isVALU()) {
amd_gfx_level gfx_level = program->gfx_level;
assert(instr->definitions[0].bytes() <= 2);
instr.get());
}
- if (instr->isSALU() || instr->isVALU() || instr->isVINTERP_INREG()) {
+ if (instr->isSALU() || instr->isVALU()) {
/* check literals */
Operand literal(s1);
for (unsigned i = 0; i < instr->operands.size(); i++) {
}
/* check num sgprs for VALU */
- if (instr->isVALU() || instr->isVINTERP_INREG()) {
+ if (instr->isVALU()) {
bool is_shift64 = instr->opcode == aco_opcode::v_lshlrev_b64 ||
instr->opcode == aco_opcode::v_lshrrev_b64 ||
instr->opcode == aco_opcode::v_ashrrev_i64;
if (instr->isPseudo())
return gfx_level >= GFX8 ? def.bytes() : def.size() * 4u;
- if (instr->isVALU() || instr->isVINTERP_INREG()) {
+ if (instr->isVALU()) {
assert(def.bytes() <= 2);
if (instr->isSDWA())
return instr->sdwa().dst_sel.size();