mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +02:00
pan/bi: Implement nir_op_f2[iu]32_rtne
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com> Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41036>
This commit is contained in:
parent
0d549f5bde
commit
4dfb07e7eb
1 changed files with 16 additions and 4 deletions
|
|
@ -3211,14 +3211,20 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
|
|||
}
|
||||
|
||||
case nir_op_f2i32:
|
||||
case nir_op_f2i32_rtne: {
|
||||
/* v11 removed F16_TO_S32 */
|
||||
assert(src_sz == 32 || (b->shader->arch < 11 && src_sz == 16));
|
||||
|
||||
bi_instr *I;
|
||||
if (src_sz == 32)
|
||||
bi_f32_to_s32_to(b, dst, s0);
|
||||
I = bi_f32_to_s32_to(b, dst, s0);
|
||||
else
|
||||
bi_f16_to_s32_to(b, dst, s0);
|
||||
I = bi_f16_to_s32_to(b, dst, s0);
|
||||
|
||||
if (instr->op == nir_op_f2i32_rtne)
|
||||
I->round = BI_ROUND_NONE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Note 32-bit sources => no vectorization, so 32-bit works */
|
||||
case nir_op_f2u16:
|
||||
|
|
@ -3242,14 +3248,20 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
|
|||
break;
|
||||
|
||||
case nir_op_f2u32:
|
||||
case nir_op_f2u32_rtne: {
|
||||
/* v11 removed F16_TO_U32 */
|
||||
assert(src_sz == 32 || (b->shader->arch < 11 && src_sz == 16));
|
||||
|
||||
bi_instr *I;
|
||||
if (src_sz == 32)
|
||||
bi_f32_to_u32_to(b, dst, s0);
|
||||
I = bi_f32_to_u32_to(b, dst, s0);
|
||||
else
|
||||
bi_f16_to_u32_to(b, dst, s0);
|
||||
I = bi_f16_to_u32_to(b, dst, s0);
|
||||
|
||||
if (instr->op == nir_op_f2u32_rtne)
|
||||
I->round = BI_ROUND_NONE;
|
||||
break;
|
||||
}
|
||||
|
||||
case nir_op_u2f16:
|
||||
/* Starting with v11, we don't have V2XXX_TO_V2F16, this should have been
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue