aco: disallow p_extract(,,32,)

Nothing uses these.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31762>
This commit is contained in:
Rhys Perry 2024-10-18 16:51:16 +01:00 committed by Marge Bot
parent f528597906
commit 07e28dad75
2 changed files with 1 additions and 5 deletions

View file

@ -1027,8 +1027,6 @@ can_apply_extract(opt_ctx& ctx, aco_ptr<Instruction>& instr, unsigned idx, ssa_i
if (!sel) {
return false;
} else if (sel.size() == 4) {
return true;
} else if ((instr->opcode == aco_opcode::v_cvt_f32_u32 ||
instr->opcode == aco_opcode::v_cvt_f32_i32) &&
sel.size() == 1 && !sel.sign_extend() && !instr->usesModifiers()) {

View file

@ -699,12 +699,10 @@ validate_ir(Program* program)
unsigned data_bits = instr->operands[0].bytes() * 8u;
unsigned op_bits = instr->operands[2].constantValue();
check(op_bits == 8 || op_bits == 16, "Size must be 8 or 16", instr.get());
if (instr->opcode == aco_opcode::p_insert) {
check(op_bits == 8 || op_bits == 16, "Size must be 8 or 16", instr.get());
check(op_bits < data_bits, "Size must be smaller than source", instr.get());
} else if (instr->opcode == aco_opcode::p_extract) {
check(op_bits == 8 || op_bits == 16 || op_bits == 32,
"Size must be 8 or 16 or 32", instr.get());
check(data_bits >= op_bits, "Can't extract more bits than what the data has.",
instr.get());
}