From b3fe01e2c1c387cbeed7f2459ddcd78aceb8dd27 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 11 May 2026 15:24:26 -0400 Subject: [PATCH] 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 Reviewed-by: Kenneth Graunke Part-of: --- src/intel/compiler/jay/jay_lower_pre_ra.c | 2 +- src/intel/compiler/jay/jay_to_binary.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/intel/compiler/jay/jay_lower_pre_ra.c b/src/intel/compiler/jay/jay_lower_pre_ra.c index 010edb97fad..c16a9d03d98 100644 --- a/src/intel/compiler/jay/jay_lower_pre_ra.c +++ b/src/intel/compiler/jay/jay_lower_pre_ra.c @@ -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); diff --git a/src/intel/compiler/jay/jay_to_binary.c b/src/intel/compiler/jay/jay_to_binary.c index e40b629a628..2aa6408b033 100644 --- a/src/intel/compiler/jay/jay_to_binary.c +++ b/src/intel/compiler/jay/jay_to_binary.c @@ -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; }