pan/bi: Add bi_cmpf_nir 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:
Alyssa Rosenzweig 2020-12-11 22:00:01 -05:00 committed by Marge Bot
parent 8c99fed470
commit 8e82641cf5
1 changed files with 27 additions and 0 deletions

View File

@ -2048,6 +2048,33 @@ bi_nir_round(nir_op op)
}
}
static enum bi_cmpf
bi_cmpf_nir(nir_op op)
{
switch (op) {
case nir_op_flt32:
case nir_op_ilt32:
case nir_op_ult32:
return BI_CMPF_LT;
case nir_op_fge32:
case nir_op_ige32:
case nir_op_uge32:
return BI_CMPF_GE;
case nir_op_feq32:
case nir_op_ieq32:
return BI_CMPF_EQ;
case nir_op_fneu32:
case nir_op_ine32:
return BI_CMPF_NE;
default:
unreachable("Invalid compare");
}
}
/* TEXS instructions assume normal 2D f32 operation but are more
* space-efficient and with simpler RA/scheduling requirements*/