Mesa (master): nir: Add urol and uror opcodes

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jul 1 17:16:37 UTC 2019


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

Author: Sagar Ghuge <sagar.ghuge at intel.com>
Date:   Thu May 30 14:11:58 2019 -0700

nir: Add urol and uror opcodes

Signed-off-by: Sagar Ghuge <sagar.ghuge at intel.com>
Reviewed-by: Matt Turner <mattst88 at gmail.com>

---

 src/compiler/nir/nir_opcodes.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py
index 26e26797585..7854faec15f 100644
--- a/src/compiler/nir/nir_opcodes.py
+++ b/src/compiler/nir/nir_opcodes.py
@@ -687,6 +687,17 @@ opcode("ishr", 0, tint, [0, 0], [tint, tuint32], False, "",
 opcode("ushr", 0, tuint, [0, 0], [tuint, tuint32], False, "",
        "src0 >> (src1 & (sizeof(src0) * 8 - 1))")
 
+opcode("urol", 0, tuint, [0, 0], [tuint, tuint32], False, "", """
+   uint32_t rotate_mask = sizeof(src0) * 8 - 1;
+   dst = (src0 << (src1 & rotate_mask)) |
+         (src0 >> (-src1 & rotate_mask));
+""")
+opcode("uror", 0, tuint, [0, 0], [tuint, tuint32], False, "", """
+   uint32_t rotate_mask = sizeof(src0) * 8 - 1;
+   dst = (src0 >> (src1 & rotate_mask)) |
+         (src0 << (-src1 & rotate_mask));
+""")
+
 # bitwise logic operators
 #
 # These are also used as boolean and, or, xor for hardware supporting




More information about the mesa-commit mailing list