nir: add ilea_agx/ulea_agx opcodes

to facilitate address mode lowering.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31964>
This commit is contained in:
Alyssa Rosenzweig 2024-11-01 10:34:43 -04:00
parent 23afe968ad
commit 9ab8d70fa6

View file

@ -1347,6 +1347,13 @@ opcode("imadshl_agx", 0, tint, [0, 0, 0, 0], [tint, tint, tint, tint], False,
opcode("imsubshl_agx", 0, tint, [0, 0, 0, 0], [tint, tint, tint, tint], False,
"", f"(src0 * src1) - (src2 << src3)")
# Address arithmetic instructions: extend, shift, and add
# Shift must be a small constant.
opcode("ilea_agx", 0, tuint64, [0, 0, 0], [tuint64, tint32, tuint32], False,
"", f"src0 + (((int64_t)src1) << src2)")
opcode("ulea_agx", 0, tuint64, [0, 0, 0], [tuint64, tuint32, tuint32], False,
"", f"src0 + (((uint64_t)src1) << src2)")
# Bounds check instruction.
#
# Sources: <data, end offset, bounds>