pan/mdg: Explain ld/st sign/zero extension
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 21 May 2020 16:13:38 +0000 (12:13 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 21 May 2020 17:49:14 +0000 (17:49 +0000)
Now we know why there are duplicates :-)

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5151>

src/panfrost/midgard/midgard.h
src/panfrost/midgard/midgard_ops.c

index aae81671449fc88da572b1f0b0cda6475d50cb41..273e0735f244c0825fdcdaf03f966255b0f12649 100644 (file)
@@ -458,9 +458,10 @@ typedef enum {
         /* Used for compute shader's __global arguments, __local variables (or
          * for register spilling) */
 
-        midgard_op_ld_char = 0x81,
-        midgard_op_ld_char2 = 0x84,
-        midgard_op_ld_short = 0x85,
+        midgard_op_ld_uchar = 0x80, /* zero extends */
+        midgard_op_ld_char = 0x81, /* sign extends */
+        midgard_op_ld_ushort = 0x84, /* zero extends */
+        midgard_op_ld_short = 0x85, /* sign extends */
         midgard_op_ld_char4 = 0x88, /* short2, int, float */
         midgard_op_ld_short4 = 0x8C, /* int2, float2, long */
         midgard_op_ld_int4 = 0x90, /* float4, long2 */
index c2006d72df15f9046e1650e678ec70f25ec0aa2d..8bb2528711a019b90a60b2c470ddfb5be644db26 100644 (file)
@@ -207,8 +207,9 @@ struct mir_ldst_op_props load_store_opcode_props[256] = {
         [midgard_op_atomic_umax64] = {"atomic_umax64", M64 | LDST_SIDE_FX},
         [midgard_op_atomic_xchg64] = {"atomic_xchg64", M64 | LDST_SIDE_FX},
 
+        [midgard_op_ld_uchar]  = {"ld_uchar", M32 | LDST_ADDRESS},
         [midgard_op_ld_char]   = {"ld_char",   M32 | LDST_ADDRESS},
-        [midgard_op_ld_char2]  = {"ld_char2",  M16 | LDST_ADDRESS},
+        [midgard_op_ld_ushort] = {"ld_ushort", M32 | LDST_ADDRESS},
         [midgard_op_ld_short]  = {"ld_short",  M32 | LDST_ADDRESS},
         [midgard_op_ld_char4]  = {"ld_char4",  M32 | LDST_ADDRESS},
         [midgard_op_ld_short4] = {"ld_short4", M32 | LDST_ADDRESS},