summaryrefslogtreecommitdiff
path: root/src/compiler/nir/nir_opcodes.py
diff options
context:
space:
mode:
authorTimur Kristóf <timur.kristof@gmail.com>2021-08-31 20:00:16 +0200
committerMarge Bot <eric+marge@anholt.net>2021-09-01 08:42:03 +0000
commit33630090a21f63d2106d8985abffeb7e72375278 (patch)
treed77c0f91c67ce6fa38f17d2b1de218cb926fa3fe /src/compiler/nir/nir_opcodes.py
parent77a852c1baff8b25078b8efbcd7674e140beea2c (diff)
downloadmesa-33630090a21f63d2106d8985abffeb7e72375278.tar.gz
nir: Add comment to explain the sad_u8x4 opcode.
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12649>
Diffstat (limited to 'src/compiler/nir/nir_opcodes.py')
-rw-r--r--src/compiler/nir/nir_opcodes.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py
index a46ff8f41e7..af32edda067 100644
--- a/src/compiler/nir/nir_opcodes.py
+++ b/src/compiler/nir/nir_opcodes.py
@@ -1060,6 +1060,11 @@ if (bits == 0) {
}
""")
+# Sum of absolute differences with accumulation.
+# (Equivalent to AMD's v_sad_u8 instruction.)
+# The first two sources contain packed 8-bit unsigned integers, the instruction
+# will calculate the absolute difference of these, and then add them together.
+# There is also a third source which is a 32-bit unsigned integer and added to the result.
triop_horiz("sad_u8x4", 1, 1, 1, 1, """
uint8_t s0_b0 = (src0.x & 0x000000ff) >> 0;
uint8_t s0_b1 = (src0.x & 0x0000ff00) >> 8;