[Mesa-dev] [PATCH 10/14] nir: add nir_src_bit_size() helper

Samuel Iglesias Gonsálvez siglesias at igalia.com
Mon Mar 7 08:46:07 UTC 2016


From: Connor Abbott <connor.w.abbott at intel.com>

---
 src/compiler/nir/nir.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index d2fd23d..39aad02 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -557,6 +557,15 @@ nir_dest_for_reg(nir_register *reg)
    return dest;
 }
 
+static inline unsigned
+nir_src_bit_size(nir_src src)
+{
+   if (src.is_ssa)
+      return src.ssa->bit_size;
+
+   return src.reg.reg->bit_size;
+}
+
 void nir_src_copy(nir_src *dest, const nir_src *src, void *instr_or_if);
 void nir_dest_copy(nir_dest *dest, const nir_dest *src, nir_instr *instr);
 
-- 
2.7.0



More information about the mesa-dev mailing list