From 33630090a21f63d2106d8985abffeb7e72375278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Tue, 31 Aug 2021 20:00:16 +0200 Subject: nir: Add comment to explain the sad_u8x4 opcode. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Timur Kristóf Reviewed-by: Jason Ekstrand Part-of: --- src/compiler/nir/nir_opcodes.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/compiler/nir/nir_opcodes.py') 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; -- cgit v1.2.1