nak,nir: Add 32-bit nir_op_lea_nv and use it
Changes code size by -0.80% on shaderdb. Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32517>
This commit is contained in:
@@ -1412,6 +1412,11 @@ opcode("prmt_nv", 0, tuint32, [0, 0, 0], [tuint32, tuint32, tuint32],
|
||||
dst |= ((uint32_t)x) << i * 8;
|
||||
}""")
|
||||
|
||||
# Address arithmetic instructions: shift and add
|
||||
# Shift must be a constant.
|
||||
opcode("lea_nv", 0, tuint32, [0, 0, 0], [tuint32, tuint32, tuint32], False,
|
||||
"", "src0 + (src1 << (src2 % bit_size))")
|
||||
|
||||
# 24b multiply into 32b result (with sign extension)
|
||||
binop("imul24", tint32, _2src_commutative + associative,
|
||||
"(((int32_t)src0 << 8) >> 8) * (((int32_t)src1 << 8) >> 8)")
|
||||
|
||||
Reference in New Issue
Block a user