This lets you easily build float immediates just given the bit size.
If we have this single place here to handle this then it will be
easier to add support for 16-bit floats later.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
}
static inline nir_ssa_def *
+nir_imm_floatN_t(nir_builder *build, double x, unsigned bit_size)
+{
+ switch (bit_size) {
+ case 32:
+ return nir_imm_float(build, x);
+ case 64:
+ return nir_imm_double(build, x);
+ }
+
+ unreachable("unknown float immediate bit size");
+}
+
+static inline nir_ssa_def *
nir_imm_vec4(nir_builder *build, float x, float y, float z, float w)
{
nir_const_value v;