mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 09:58:05 +02:00
pan/bi: Add bi_nir_round helper
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8135>
This commit is contained in:
parent
95d62ee7cf
commit
8c99fed470
1 changed files with 12 additions and 0 deletions
|
|
@ -2036,6 +2036,18 @@ bi_alu_src_index(nir_alu_src src, unsigned comps)
|
|||
return idx;
|
||||
}
|
||||
|
||||
static enum bi_round
|
||||
bi_nir_round(nir_op op)
|
||||
{
|
||||
switch (op) {
|
||||
case nir_op_fround_even: return BI_ROUND_NONE;
|
||||
case nir_op_ftrunc: return BI_ROUND_RTZ;
|
||||
case nir_op_fceil: return BI_ROUND_RTP;
|
||||
case nir_op_ffloor: return BI_ROUND_RTN;
|
||||
default: unreachable("invalid nir round op");
|
||||
}
|
||||
}
|
||||
|
||||
/* TEXS instructions assume normal 2D f32 operation but are more
|
||||
* space-efficient and with simpler RA/scheduling requirements*/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue