#define NIR_BUILDER_H
#include "nir_control_flow.h"
+#include "util/half_float.h"
struct exec_list;
return nir_imm_bool(build, false);
}
+static inline nir_ssa_def *
+nir_imm_float16(nir_builder *build, float x)
+{
+ nir_const_value v;
+
+ memset(&v, 0, sizeof(v));
+ v.u16[0] = _mesa_float_to_half(x);
+
+ return nir_build_imm(build, 1, 16, v);
+}
+
static inline nir_ssa_def *
nir_imm_float(nir_builder *build, float x)
{
nir_imm_floatN_t(nir_builder *build, double x, unsigned bit_size)
{
switch (bit_size) {
+ case 16:
+ return nir_imm_float16(build, x);
case 32:
return nir_imm_float(build, x);
case 64: