summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/midgard
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-06-10 11:05:40 -0700
committerAlyssa Rosenzweig <[email protected]>2019-06-11 08:44:18 -0700
commitfc472007e7a2d2f33fbf9692355d4b6ece73b49a (patch)
treec666a82289146ab37ed005d31fd634b9439fe2f9 /src/gallium/drivers/panfrost/midgard
parentb0396d6dda46e16ef4e3549fafc37818668697f7 (diff)
panfrost/midgard: Add perspective division opcodes
...on the load/store unit, not the ALUs. Looks goofy but hey. Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/midgard')
-rw-r--r--src/gallium/drivers/panfrost/midgard/midgard.h7
-rw-r--r--src/gallium/drivers/panfrost/midgard/midgard_ops.c2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/midgard.h b/src/gallium/drivers/panfrost/midgard/midgard.h
index 68e969ccf9c..980a968cbe9 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard.h
+++ b/src/gallium/drivers/panfrost/midgard/midgard.h
@@ -371,6 +371,13 @@ typedef enum {
/* Used in OpenCL. Probably can ld other things as well */
midgard_op_ld_global_id = 0x10,
+ /* 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>. 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,
midgard_op_atomic_and = 0x44,
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_ops.c b/src/gallium/drivers/panfrost/midgard/midgard_ops.c
index 693fb56124d..85981dbef5b 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_ops.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_ops.c
@@ -153,6 +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_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",