pan/bi: Add imm_f16 helper
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>
This commit is contained in:
parent
e4ae458df8
commit
7ec9dc98d7
|
@ -32,6 +32,7 @@
|
|||
#include "compiler/nir/nir.h"
|
||||
#include "panfrost/util/pan_ir.h"
|
||||
#include "util/u_math.h"
|
||||
#include "util/half_float.h"
|
||||
|
||||
/* Swizzles across bytes in a 32-bit word. Expresses swz in the XML directly.
|
||||
* To express widen, use the correpsonding replicated form, i.e. H01 = identity
|
||||
|
@ -225,6 +226,12 @@ bi_imm_u16(uint16_t imm)
|
|||
return bi_half(bi_imm_u32(imm), false);
|
||||
}
|
||||
|
||||
static inline bi_index
|
||||
bi_imm_f16(float imm)
|
||||
{
|
||||
return bi_imm_u16(_mesa_float_to_half(imm));
|
||||
}
|
||||
|
||||
static inline bool
|
||||
bi_is_null(bi_index idx)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue