ir3: Use correct category for OPC_PUSH_CONSTS_LOAD_MACRO

This prevents is_scalar_alu() from crashing, and seems like the right
thing to do to prevent other "surprises." Make it have the category of
the instructions it expands to.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22075>
This commit is contained in:
Connor Abbott 2024-04-12 12:25:09 -04:00 committed by Marge Bot
parent 507b51e7ae
commit f8ac16b4b9
2 changed files with 7 additions and 5 deletions

View file

@ -130,11 +130,6 @@ typedef enum {
OPC_SCAN_MACRO = _OPC(1, 58),
OPC_SCAN_CLUSTERS_MACRO = _OPC(1, 60),
/* Macros that expand to an stsc at the start of the preamble.
* It loads into const file and should not be optimized in any way.
*/
OPC_PUSH_CONSTS_LOAD_MACRO = _OPC(1, 59),
/* category 2: */
OPC_ADD_F = _OPC(2, 0),
OPC_MIN_F = _OPC(2, 1),
@ -364,6 +359,11 @@ typedef enum {
OPC_STSC = _OPC(6, 82),
OPC_LDG_K = _OPC(6, 83),
/* Macros that expand to an stsc at the start of the preamble.
* It loads into const file and should not be optimized in any way.
*/
OPC_PUSH_CONSTS_LOAD_MACRO = _OPC(6, 84),
/* category 7: */
OPC_BAR = _OPC(7, 0),
OPC_FENCE = _OPC(7, 1),

View file

@ -387,6 +387,8 @@ validate_instr(struct ir3_validate_ctx *ctx, struct ir3_instruction *instr)
validate_reg_size(ctx, instr->srcs[0], instr->cat6.type);
validate_assert(ctx, !(instr->srcs[1]->flags & IR3_REG_HALF));
break;
case OPC_PUSH_CONSTS_LOAD_MACRO:
break;
case OPC_LDC_K:
validate_assert(ctx, !(instr->srcs[0]->flags & IR3_REG_HALF));
validate_assert(ctx, !(instr->srcs[1]->flags & IR3_REG_HALF));