Mesa (master): pan/mdg: Add roundmode enum

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 3 16:06:16 UTC 2020


Module: Mesa
Branch: master
Commit: 2eb4c85e42452527d46b03242f6f26c8cb216e39
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2eb4c85e42452527d46b03242f6f26c8cb216e39

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Mon May 25 14:05:34 2020 -0400

pan/mdg: Add roundmode enum

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

---

 src/panfrost/midgard/compiler.h | 3 +++
 src/panfrost/midgard/midgard.h  | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h
index 1765bfd8551..7e2a453584c 100644
--- a/src/panfrost/midgard/compiler.h
+++ b/src/panfrost/midgard/compiler.h
@@ -121,6 +121,9 @@ typedef struct midgard_instruction {
         /* Out of the union for csel (could maybe be fixed..) */
         bool src_invert[MIR_SRC_COUNT];
 
+        /* If the op supports it */
+        enum midgard_roundmode roundmode;
+
         /* Special fields for an ALU instruction */
         midgard_reg_info registers;
 
diff --git a/src/panfrost/midgard/midgard.h b/src/panfrost/midgard/midgard.h
index 4e7c80585d5..bb93d0d653d 100644
--- a/src/panfrost/midgard/midgard.h
+++ b/src/panfrost/midgard/midgard.h
@@ -822,4 +822,11 @@ typedef union midgard_constants {
 }
 midgard_constants;
 
+enum midgard_roundmode {
+        MIDGARD_RTE = 0x0, /* round to even */
+        MIDGARD_RTZ = 0x1, /* round to zero */
+        MIDGARD_RTN = 0x2, /* round to negative */
+        MIDGARD_RTP = 0x3, /* round to positive */
+};
+
 #endif



More information about the mesa-commit mailing list