From: Sagar Ghuge Date: Thu, 30 May 2019 21:11:58 +0000 (-0700) Subject: nir: Add urol and uror opcodes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=81d342e2a14d9d4260d3b03ed2c257c8ae8388bc;p=mesa.git nir: Add urol and uror opcodes Signed-off-by: Sagar Ghuge Reviewed-by: Matt Turner --- 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