From 81d342e2a14d9d4260d3b03ed2c257c8ae8388bc Mon Sep 17 00:00:00 2001 From: Sagar Ghuge Date: Thu, 30 May 2019 14:11:58 -0700 Subject: [PATCH] nir: Add urol and uror opcodes Signed-off-by: Sagar Ghuge Reviewed-by: Matt Turner --- 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 26e2679..7854fae 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 -- 2.7.4