mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-19 08:28:21 +02:00
pan/bi: Handle trivial i2i32
lower_bool_to_bitsize can generate i2i32 from a 32-bit source, which is trivial but needs to be handled explicitly to avoid going down the 8-bit conversion path. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14576>
This commit is contained in:
parent
f7d44a46cd
commit
6a05852f5b
1 changed files with 15 additions and 4 deletions
|
|
@ -2167,6 +2167,8 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
|
|||
break;
|
||||
|
||||
case nir_op_i2f32:
|
||||
assert(src_sz == 32 || src_sz == 16 || src_sz == 8);
|
||||
|
||||
if (src_sz == 32)
|
||||
bi_s32_to_f32_to(b, dst, s0, BI_ROUND_RTZ);
|
||||
else if (src_sz == 16)
|
||||
|
|
@ -2176,17 +2178,26 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
|
|||
break;
|
||||
|
||||
case nir_op_i2i32:
|
||||
if (src_sz == 16)
|
||||
assert(src_sz == 32 || src_sz == 16 || src_sz == 8);
|
||||
|
||||
if (src_sz == 32)
|
||||
bi_mov_i32_to(b, dst, s0);
|
||||
else if (src_sz == 16)
|
||||
bi_s16_to_s32_to(b, dst, s0);
|
||||
else
|
||||
else if (src_sz == 8)
|
||||
bi_s8_to_s32_to(b, dst, s0);
|
||||
break;
|
||||
|
||||
case nir_op_u2u32:
|
||||
if (src_sz == 16)
|
||||
assert(src_sz == 32 || src_sz == 16 || src_sz == 8);
|
||||
|
||||
if (src_sz == 32)
|
||||
bi_mov_i32_to(b, dst, s0);
|
||||
else if (src_sz == 16)
|
||||
bi_u16_to_u32_to(b, dst, s0);
|
||||
else
|
||||
else if (src_sz == 8)
|
||||
bi_u8_to_u32_to(b, dst, s0);
|
||||
|
||||
break;
|
||||
|
||||
case nir_op_i2i16:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue