[08/18] panfrost/midgard: Add divide-by-z ld/st op

Submitted by Alyssa Rosenzweig on June 10, 2019, 10:01 p.m.

Details

Message ID 20190610220146.7832-9-alyssa.rosenzweig@collabora.com
State New
Headers show
Series "panfrost/midgard: Decode GLES3 texture op" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Alyssa Rosenzweig June 10, 2019, 10:01 p.m.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
---
 src/gallium/drivers/panfrost/midgard/midgard.h     | 6 ++++--
 src/gallium/drivers/panfrost/midgard/midgard_ops.c | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/drivers/panfrost/midgard/midgard.h b/src/gallium/drivers/panfrost/midgard/midgard.h
index dbcee0f53b5..ef06e298010 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard.h
+++ b/src/gallium/drivers/panfrost/midgard/midgard.h
@@ -373,8 +373,10 @@  typedef enum {
 
         /* The L/S unit can do perspective division a clock faster than the ALU
          * if you're lucky. Put the vec4 in r27, and call with 0x24 as the
-         * unknown state; the output will be <x/w, y/w, z/w, 1> */
-        midgard_op_ldst_perspective_division = 0x13,
+         * unknown state; the output will be <x/w, y/w, z/w, 1>. Replace w with
+         * z for the z version */
+        midgard_op_ldst_perspective_division_z = 0x12,
+        midgard_op_ldst_perspective_division_w = 0x13,
 
         /* val in r27.y, address embedded, outputs result to argument. Invert val for sub. Let val = +-1 for inc/dec. */
         midgard_op_atomic_add = 0x40,
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_ops.c b/src/gallium/drivers/panfrost/midgard/midgard_ops.c
index b8210a01ecb..85981dbef5b 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_ops.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_ops.c
@@ -153,7 +153,8 @@  struct mir_op_props alu_opcode_props[256] = {
 const char *load_store_opcode_names[256] = {
         [midgard_op_st_cubemap_coords] = "st_cubemap_coords",
         [midgard_op_ld_global_id] = "ld_global_id",
-        [midgard_op_ldst_perspective_division] = "ldst_perspective_division",
+        [midgard_op_ldst_perspective_division_z] = "ldst_perspective_division_z",
+        [midgard_op_ldst_perspective_division_w] = "ldst_perspective_division_w",
 
         [midgard_op_atomic_add] = "atomic_add",
         [midgard_op_atomic_and] = "atomic_and",