mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 00:38:48 +02:00
brw: Handle scalars and swizzles correctly in is_const_zero
v2: Massive simplification based on feedback from Ken. Fixes:96cde9cc01("intel/fs: Emit better code for bfi(..., 0)") Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commitdff1e8ae28) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
This commit is contained in:
parent
29a5d22049
commit
efc9ad3986
2 changed files with 4 additions and 4 deletions
|
|
@ -3154,7 +3154,7 @@
|
|||
"description": "brw: Handle scalars and swizzles correctly in is_const_zero",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "96cde9cc01dc0cfa4d4edf70d47df118ca57e5c0",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -874,9 +874,9 @@ try_emit_b2fi_of_inot(nir_to_brw_state &ntb, const brw_builder &bld,
|
|||
}
|
||||
|
||||
static bool
|
||||
is_const_zero(const nir_src &src)
|
||||
is_const_zero(const nir_alu_src &src)
|
||||
{
|
||||
return nir_src_is_const(src) && nir_src_as_int(src) == 0;
|
||||
return nir_src_is_const(src.src) && nir_alu_src_as_uint(src) == 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1639,7 +1639,7 @@ brw_from_nir_emit_alu(nir_to_brw_state &ntb, nir_alu_instr *instr,
|
|||
* either 0 or src0. Replacing the 0 with another value can eliminate a
|
||||
* temporary register.
|
||||
*/
|
||||
if (is_const_zero(instr->src[2].src))
|
||||
if (is_const_zero(instr->src[2]))
|
||||
bld.BFI2(result, op[0], op[1], op[0]);
|
||||
else
|
||||
bld.BFI2(result, op[0], op[1], op[2]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue