summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_builder.h
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-02-23 21:35:00 -0800
committerJason Ekstrand <[email protected]>2017-03-03 13:59:24 -0800
commit9745bef3088694b13f040222a813a1c2ac9677f9 (patch)
tree71d835ea7426a5d835c9cfd4f0127b84f232569e /src/compiler/nir/nir_builder.h
parent46cd549c2bc9404caf77e4e437ade24b5b775466 (diff)
nir/builder: Add an int64 immediate helper
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_builder.h')
-rw-r--r--src/compiler/nir/nir_builder.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
index 2eaa0250656..1dc56ebf53d 100644
--- a/src/compiler/nir/nir_builder.h
+++ b/src/compiler/nir/nir_builder.h
@@ -253,6 +253,17 @@ nir_imm_int(nir_builder *build, int x)
}
static inline nir_ssa_def *
+nir_imm_int64(nir_builder *build, int64_t x)
+{
+ nir_const_value v;
+
+ memset(&v, 0, sizeof(v));
+ v.i64[0] = x;
+
+ return nir_build_imm(build, 1, 64, v);
+}
+
+static inline nir_ssa_def *
nir_imm_ivec4(nir_builder *build, int x, int y, int z, int w)
{
nir_const_value v;