std::vector<aco_ptr<Instruction>> *instructions;
std::vector<aco_ptr<Instruction>>::iterator it;
bool is_precise = false;
+ bool is_nuw = false;
- Builder(Program *pgm) : program(pgm), use_iterator(false), start(false), lm(pgm->lane_mask), instructions(NULL) {}
+ Builder(Program *pgm) : program(pgm), use_iterator(false), start(false), lm(pgm ? pgm->lane_mask : s2), instructions(NULL) {}
Builder(Program *pgm, Block *block) : program(pgm), use_iterator(false), start(false), lm(pgm ? pgm->lane_mask : s2), instructions(&block->instructions) {}
Builder(Program *pgm, std::vector<aco_ptr<Instruction>> *instrs) : program(pgm), use_iterator(false), start(false), lm(pgm ? pgm->lane_mask : s2), instructions(instrs) {}
return res;
};
+ Builder nuw() const {
+ Builder res = *this;
+ res.is_nuw = true;
+ return res;
+ }
+
void moveEnd(Block *block) {
instructions = &block->instructions;
}
% for fixed in ['m0', 'vcc', 'exec', 'scc']:
Operand ${fixed}(Temp tmp) {
% if fixed == 'vcc' or fixed == 'exec':
- assert(tmp.regClass() == lm);
+ //vcc_hi and exec_hi can still be used in wave32
+ assert(tmp.type() == RegType::sgpr && tmp.bytes() <= 8);
% endif
Operand op(tmp);
op.setFixed(aco::${fixed});
Definition ${fixed}(Definition def) {
% if fixed == 'vcc' or fixed == 'exec':
- assert(def.regClass() == lm);
+ //vcc_hi and exec_hi can still be used in wave32
+ assert(def.regClass().type() == RegType::sgpr && def.bytes() <= 8);
% endif
def.setFixed(aco::${fixed});
return def;
Definition hint_${fixed}(Definition def) {
% if fixed == 'vcc' or fixed == 'exec':
- assert(def.regClass() == lm);
+ //vcc_hi and exec_hi can still be used in wave32
+ assert(def.regClass().type() == RegType::sgpr && def.bytes() <= 8);
% endif
def.setHint(aco::${fixed});
return def;
% for i in range(num_definitions):
instr->definitions[${i}] = def${i};
instr->definitions[${i}].setPrecise(is_precise);
+ instr->definitions[${i}].setNUW(is_nuw);
% endfor
% for i in range(num_operands):
instr->operands[${i}] = op${i}.op;