[Mesa-dev] [PATCH 3/6] panfrost/midgard: Add umin/umax opcodes

Alyssa Rosenzweig alyssa at rosenzweig.io
Fri Apr 5 05:56:24 UTC 2019


Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
---
 src/gallium/drivers/panfrost/midgard/helpers.h         | 2 ++
 src/gallium/drivers/panfrost/midgard/midgard.h         | 4 ++++
 src/gallium/drivers/panfrost/midgard/midgard_compile.c | 2 ++
 3 files changed, 8 insertions(+)

diff --git a/src/gallium/drivers/panfrost/midgard/helpers.h b/src/gallium/drivers/panfrost/midgard/helpers.h
index 54960c7e599..0ef5dac51d4 100644
--- a/src/gallium/drivers/panfrost/midgard/helpers.h
+++ b/src/gallium/drivers/panfrost/midgard/helpers.h
@@ -196,6 +196,8 @@ static unsigned alu_opcode_props[256] = {
         [midgard_alu_op_fmax]		 = UNITS_MUL | UNITS_ADD,
         [midgard_alu_op_imin]		 = UNITS_MOST,
         [midgard_alu_op_imax]		 = UNITS_MOST,
+        [midgard_alu_op_umin]		 = UNITS_MOST,
+        [midgard_alu_op_umax]		 = UNITS_MOST,
         [midgard_alu_op_fmov]		 = UNITS_ALL | QUIRK_FLIPPED_R24,
         [midgard_alu_op_fround]          = UNITS_ADD,
         [midgard_alu_op_froundeven]      = UNITS_ADD,
diff --git a/src/gallium/drivers/panfrost/midgard/midgard.h b/src/gallium/drivers/panfrost/midgard/midgard.h
index 335ea5c56cc..0f963b9b3b1 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard.h
+++ b/src/gallium/drivers/panfrost/midgard/midgard.h
@@ -74,7 +74,9 @@ typedef enum {
         midgard_alu_op_isub       = 0x46,
         midgard_alu_op_imul       = 0x58,
         midgard_alu_op_imin       = 0x60,
+        midgard_alu_op_umin       = 0x61,
         midgard_alu_op_imax       = 0x62,
+        midgard_alu_op_umax       = 0x63,
         midgard_alu_op_iasr       = 0x68,
         midgard_alu_op_ilsr       = 0x69,
         midgard_alu_op_ishl       = 0x6E,
@@ -480,7 +482,9 @@ static char *alu_opcode_names[256] = {
         [midgard_alu_op_fdot4]      = "fdot4",
         [midgard_alu_op_freduce]    = "freduce",
         [midgard_alu_op_imin]       = "imin",
+        [midgard_alu_op_umin]       = "umin",
         [midgard_alu_op_imax]       = "imax",
+        [midgard_alu_op_umax]       = "umax",
         [midgard_alu_op_ishl]       = "ishl",
         [midgard_alu_op_iasr]       = "iasr",
         [midgard_alu_op_ilsr]       = "ilsr",
diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
index c68067d50a5..bcb68ac6d5a 100644
--- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c
+++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c
@@ -1029,6 +1029,8 @@ emit_alu(compiler_context *ctx, nir_alu_instr *instr)
                 ALU_CASE(fmax, fmax);
                 ALU_CASE(imin, imin);
                 ALU_CASE(imax, imax);
+                ALU_CASE(umin, umin);
+                ALU_CASE(umax, umax);
                 ALU_CASE(fmov, fmov);
                 ALU_CASE(ffloor, ffloor);
                 ALU_CASE(fround_even, froundeven);
-- 
2.20.1



More information about the mesa-dev mailing list