Lines Matching refs:check

83    auto check = [&program, &is_valid](bool success, const char* msg,
116 /* check base format */
140 check(base_format == instr_info.format[(int)instr->opcode],
143 /* check VOP3 modifiers */
145 check(base_format == Format::VOP2 || base_format == Format::VOP1 ||
150 /* check SDWA */
152 check(base_format == Format::VOP2 || base_format == Format::VOP1 ||
156 check(program->gfx_level >= GFX8, "SDWA is GFX8 to GFX10.3 only", instr.get());
157 check(program->gfx_level < GFX11, "SDWA is GFX8 to GFX10.3 only", instr.get());
160 check(sdwa.omod == 0 || program->gfx_level >= GFX9, "SDWA omod only supported on GFX9+",
163 check(sdwa.clamp == false || program->gfx_level == GFX8,
165 check((instr->definitions[0].isFixed() && instr->definitions[0].physReg() == vcc) ||
170 check(def.bytes() <= 4, "SDWA definitions must not be larger than 4 bytes",
172 check(def.bytes() >= sdwa.dst_sel.size() + sdwa.dst_sel.offset(),
174 check(
177 check(sdwa.dst_sel.offset() % sdwa.dst_sel.size() == 0, "Invalid selection offset",
179 check(def.bytes() == 4 || def.bytes() == sdwa.dst_sel.size(),
182 check(def.bytes() == 4 || sdwa.dst_sel.offset() == 0,
188 check(op.bytes() <= 4, "SDWA operands must not be larger than 4 bytes", instr.get());
189 check(op.bytes() >= sdwa.sel[i].size() + sdwa.sel[i].offset(),
191 check(sdwa.sel[i].size() == 1 || sdwa.sel[i].size() == 2 || sdwa.sel[i].size() == 4,
193 check(sdwa.sel[i].offset() % sdwa.sel[i].size() == 0, "Invalid selection offset",
197 check(instr->operands[2].isFixed() && instr->operands[2].physReg() == vcc,
201 check(instr->definitions[1].isFixed() && instr->definitions[1].physReg() == vcc,
222 check(sdwa_opcodes || feature_mac, "SDWA can't be used with this opcode", instr.get());
225 /* check opsel */
228 check(vop3.opsel == 0 || program->gfx_level >= GFX9, "Opsel is only supported on GFX9+",
235 check((vop3.opsel & (1 << i)) == 0, "Unexpected opsel for operand", instr.get());
238 check((vop3.opsel & (1 << 3)) == 0, "Unexpected opsel for sub-dword definition",
243 check(instr->definitions[0].regClass() ==
251 check((vop3p.opsel_lo & (1 << i)) == 0 && (vop3p.opsel_hi & (1 << i)) == 0,
254 check(instr->definitions[0].regClass() == v1, "VOP3P must have v1 definition",
258 /* check for undefs */
268 check(can_be_undef, "Undefs can only be used in certain operands", instr.get());
270 check(instr->operands[i].isFixed() || instr->operands[i].isTemp() ||
276 /* check subdword definitions */
279 check(instr->definitions[i].bytes() <= 4 || instr->isPseudo() || instr->isVMEM(),
285 /* check literals */
292 check(!instr->isDPP() && !instr->isSDWA() &&
297 check(literal.isUndefined() || (literal.size() == op.size() &&
301 check(instr->isSALU() || instr->isVOP3() || instr->isVOP3P() || i == 0 || i == 2,
305 /* check num sgprs for VALU */
323 check(instr->definitions[0].getTemp().type() == RegType::sgpr,
326 check(instr->definitions[0].getTemp().type() == RegType::vgpr,
337 check(i != 1 || (op.isTemp() && op.regClass().type() == RegType::sgpr) ||
340 check(i == 1 || (op.isTemp() && op.regClass().type() == RegType::vgpr &&
347 check(i != 0 || (op.isTemp() && op.regClass().type() == RegType::vgpr),
349 check(i == 0 || (op.isTemp() && op.regClass().type() == RegType::sgpr) ||
357 check(i != 2 || (op.isTemp() && op.regClass().type() == RegType::vgpr &&
360 check(i == 2 || (op.isTemp() && op.regClass().type() == RegType::sgpr) ||
366 check(scalar_mask & (1 << i), "Wrong source position for SGPR argument",
376 check(scalar_mask & (1 << i), "Wrong source position for constant argument",
379 check(num_sgprs + (literal.isUndefined() ? 0 : 1) <= const_bus_limit,
385 check(instr->definitions[0].getTemp().type() == RegType::sgpr,
388 check(op.isConstant() || op.regClass().type() <= RegType::sgpr,
399 check(op.bytes() < 4 || size % 4 == 0, "Operand is not aligned", instr.get());
402 check(size == instr->definitions[0].bytes(),
406 check(op.isConstant() || op.regClass().type() == RegType::sgpr,
411 check((instr->operands[0].isTemp()) && instr->operands[1].isConstant(),
413 check((instr->operands[1].constantValue() + 1) * instr->definitions[0].bytes() <=
416 check(instr->definitions[0].getTemp().type() == RegType::vgpr ||
419 check(program->gfx_level >= GFX9 ||
424 check(instr->operands[0].isTemp(), "Operand must be a temporary", instr.get());
429 check(size == instr->operands[0].bytes(),
433 check(def.regClass().type() == RegType::vgpr,
437 check(program->gfx_level >= GFX9 || !def.regClass().is_subdword(),
441 check(instr->definitions.size() == instr->operands.size(),
444 check(instr->definitions[i].bytes() == instr->operands[i].bytes(),
447 check((instr->definitions[i].getTemp().type() ==
452 check(instr->definitions[i].regClass().is_linear_vgpr() ==
456 check(!instr->definitions[i].regClass().is_linear_vgpr(),
462 check(instr->operands.size() == block.logical_preds.size(),
464 check(instr->definitions[0].getTemp().type() == RegType::vgpr,
467 check(instr->definitions[0].size() == op.size(),
471 check(!op.isTemp() || op.getTemp().is_linear(), "Wrong Operand type",
473 check(instr->definitions[0].size() == op.size(),
476 check(instr->operands.size() == block.linear_preds.size(),
480 check(instr->operands[0].isTemp(), "Data operand must be temporary", instr.get());
481 check(instr->operands[1].isConstant(), "Index must be constant", instr.get());
483 check(instr->operands[3].isConstant(), "Sign-extend flag must be constant",
486 check(instr->definitions[0].getTemp().type() != RegType::sgpr ||
491 check(instr->operands[0].bytes() == instr->definitions[0].bytes(),
495 check(instr->definitions.size() >= 2 && instr->definitions[1].isFixed() &&
503 check(op_bits == 8 || op_bits == 16, "Size must be 8 or 16", instr.get());
504 check(op_bits < data_bits, "Size must be smaller than source", instr.get());
506 check(op_bits == 8 || op_bits == 16 || op_bits == 32,
508 check(data_bits >= op_bits, "Can't extract more bits than what the data has.",
513 check(instr->operands[1].constantValue() < comp, "Index must be in-bounds",
516 check(instr->definitions.size() == 0, "p_jump_to_epilog must have 0 definitions",
518 check(instr->operands.size() > 0 &&
523 check(instr->operands[i].getTemp().type() == RegType::vgpr ||
532 check(op.regClass().type() == RegType::vgpr,
538 check(instr->definitions[0].regClass().type() == RegType::sgpr ||
542 check(instr->definitions[0].regClass().type() == RegType::vgpr,
550 check((instr->operands[0].isFixed() && !instr->operands[0].isConstant()) ||
555 check(instr->operands[1].isConstant() ||
560 check(instr->definitions[0].getTemp().type() == RegType::sgpr,
566 check(instr->operands.size() > 1, "VMEM instructions must have at least one operand",
568 check(instr->operands[1].hasRegClass() &&
571 check(
574 check(instr->operands.size() < 4 ||
600 check(instr->definitions[0].isTemp() &&
603 check(d16 || !instr->definitions[0].regClass().is_subdword(),
605 check(instr->definitions[0].bytes() <= 8 || !d16,
611 check(instr->operands.size() >= 4, "MIMG instructions must have at least 4 operands",
613 check(instr->operands[0].hasRegClass() &&
617 check(instr->operands[1].regClass() == s4,
622 check(instr->definitions.empty() ||
629 check(instr->operands.size() == 4 || program->gfx_level >= GFX10,
633 check(instr->operands[i].hasRegClass() &&
637 check(instr->operands[i].regClass() == v1, "MIMG VADDR must be v1 if NSA is used",
643 check(instr->definitions[0].isTemp() &&
646 check(instr->mimg().d16 || !instr->definitions[0].regClass().is_subdword(),
648 check(instr->definitions[0].bytes() <= 8 || !instr->mimg().d16,
655 check((op.isTemp() && op.regClass().type() == RegType::vgpr) || op.physReg() == m0,
659 check(instr->definitions[0].getTemp().type() == RegType::vgpr,
665 check(instr->operands[i].hasRegClass() &&
671 check(instr->operands[1].isUndefined(), "Flat instructions don't support SADDR",
675 check(
680 check(instr->operands[0].hasRegClass() &&
683 check(instr->operands[1].hasRegClass() &&
687 check(instr->operands[0].isTemp() || instr->operands[1].isTemp(),
690 check(instr->definitions[0].getTemp().type() == RegType::vgpr,
693 check(instr->operands[2].regClass().type() == RegType::vgpr,
1091 /* check live out */
1109 /* check killed p_phi sgpr operands */