jay: fix bfn with 0xffff constant

awkward.

Totals from 128 (4.84% of 2647) affected shaders:
Instrs: 258121 -> 257970 (-0.06%); split: -0.07%, +0.01%
CodeSize: 3662400 -> 3661792 (-0.02%); split: -0.14%, +0.12%

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41510>
This commit is contained in:
Alyssa Rosenzweig 2026-05-11 15:24:26 -04:00 committed by Marge Bot
parent c5cee5d973
commit b3fe01e2c1
2 changed files with 2 additions and 2 deletions

View file

@ -173,7 +173,7 @@ lower_immediates(jay_builder *b, jay_inst *I, struct hash_table_u64 *constants)
bool last = s == (jay_num_isa_srcs(I) - 1);
bool allowed = s < 2 && (last || I->op == JAY_OPCODE_SEND);
allowed |= (I->op == JAY_OPCODE_BFN && s == 0 && imm < UINT16_MAX);
allowed |= (I->op == JAY_OPCODE_BFN && s == 0 && imm <= UINT16_MAX);
if (!allowed) {
I->src[s] = lower_imm_to_ugpr(b, I, s, constants);

View file

@ -87,7 +87,7 @@ to_brw_reg(jay_function *f,
if (jay_type_size_bits(type) == 64) {
type = jay_type_resize(type, 32);
} else if (I->op == JAY_OPCODE_BFN) {
assert(jay_as_uint(d) < UINT16_MAX);
assert(jay_as_uint(d) <= UINT16_MAX);
type = JAY_TYPE_U16;
}