Mesa (master): nir/builder: Add an int64 immediate helper

Jason Ekstrand jekstrand at kemper.freedesktop.org
Fri Mar 3 23:05:22 UTC 2017


Module: Mesa
Branch: master
Commit: 9745bef3088694b13f040222a813a1c2ac9677f9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9745bef3088694b13f040222a813a1c2ac9677f9

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Thu Feb 23 21:35:00 2017 -0800

nir/builder: Add an int64 immediate helper

Reviewed-by: Matt Turner <mattst88 at gmail.com>

---

 src/compiler/nir/nir_builder.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
index 2eaa025..1dc56eb 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;




More information about the mesa-commit mailing list