From 2cf3b28884047f1cdef76542355bd2a4dd653fde Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Fri, 31 Jul 2015 10:52:04 -0700 Subject: [PATCH] nir/builder: add nir_imm_double() Reviewed-by: Jason Ekstrand --- src/compiler/nir/nir_builder.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index 3e3bdcd3b8d..a14f9ef70d3 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -114,6 +114,14 @@ nir_imm_float(nir_builder *build, float x) return nir_build_imm(build, 1, 32, v); } +static inline nir_ssa_def * +nir_imm_double(nir_builder *build, double x) +{ + nir_const_value v = { { .f64 = {x, 0, 0, 0} } }; + nir_ssa_def *def = nir_build_imm(build, 1, 64, v); + return def; +} + static inline nir_ssa_def * nir_imm_vec4(nir_builder *build, float x, float y, float z, float w) { -- 2.30.2