diff options
author | Sagar Ghuge <[email protected]> | 2019-05-30 14:11:58 -0700 |
---|---|---|
committer | Sagar Ghuge <[email protected]> | 2019-07-01 10:14:22 -0700 |
commit | 81d342e2a14d9d4260d3b03ed2c257c8ae8388bc (patch) | |
tree | 7d559dca2964968ef59bb3257f762a4b501f1305 /src/compiler/nir/nir_opcodes.py | |
parent | 83fdec0f0deb98a7f48186679a491f3128fdd1fe (diff) |
nir: Add urol and uror opcodes
Signed-off-by: Sagar Ghuge <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_opcodes.py')
-rw-r--r-- | src/compiler/nir/nir_opcodes.py | 11 |
1 files changed, 11 insertions, 0 deletions
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 |