jay/validate: add validation for bogus uflag cases

this would've caught the previous bug

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41872>
This commit is contained in:
Alyssa Rosenzweig 2026-06-02 10:30:30 -04:00 committed by Marge Bot
parent 8b75e06196
commit a110a4a6d6

View file

@ -215,6 +215,10 @@ validate_inst(struct validate_state *validate, jay_inst *I)
I->cond_flag.file == UFLAG &&
(I->op == JAY_OPCODE_CMP || I->op == JAY_OPCODE_MOV)));
/* We cannot mix uniformness */
CHECK(I->cond_flag.file != UFLAG || I->dst.file != GPR);
CHECK(I->cond_flag.file != FLAG || I->dst.file != UGPR);
/* Standard modifiers only allowed on some instructions */
CHECK(!I->conditional_mod || opinfo->cmod || I->op == JAY_OPCODE_CSEL);
CHECK(!I->saturate || opinfo->sat);