pan/bi: Add a bifrost_roundmode field
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 3 Mar 2020 01:52:36 +0000 (20:52 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 5 Mar 2020 14:35:38 +0000 (14:35 +0000)
And a class property signaling it's okay to use.

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

src/panfrost/bifrost/bi_tables.c
src/panfrost/bifrost/compiler.h

index 0681fba..c1acd37 100644 (file)
@@ -36,7 +36,7 @@ unsigned bi_class_props[BI_NUM_CLASSES] = {
         [BI_CONVERT]           = 0,
         [BI_CSEL]              = 0,
         [BI_DISCARD]           = 0,
-        [BI_FMA]               = 0,
+        [BI_FMA]               = BI_ROUNDMODE,
         [BI_FREXP]             = 0,
         [BI_LOAD]              = 0,
         [BI_LOAD_ATTR]                 = 0,
@@ -49,5 +49,5 @@ unsigned bi_class_props[BI_NUM_CLASSES] = {
         [BI_STORE_VAR]                 = 0,
         [BI_SPECIAL]           = 0,
         [BI_TEX]               = 0,
-        [BI_ROUND]             = BI_GENERIC,
+        [BI_ROUND]             = BI_GENERIC | BI_ROUNDMODE,
 };
index 823d2e7..421db9a 100644 (file)
@@ -83,6 +83,9 @@ extern unsigned bi_class_props[BI_NUM_CLASSES];
  * irregular enough to warrant a separate class */
 #define BI_GENERIC (1 << 1)
 
+/* Accepts a bifrost_roundmode */
+#define BI_ROUNDMODE (1 << 2)
+
 /* It can't get any worse than csel4... can it? */
 #define BIR_SRC_COUNT 4
 
@@ -100,6 +103,9 @@ typedef struct {
         enum bifrost_outmod outmod;
         bool src_abs[BIR_SRC_COUNT];
         bool src_neg[BIR_SRC_COUNT];
+
+        /* Round mode (requires BI_ROUNDMODE) */
+        enum bifrost_roundmode roundmode;
 } bi_instruction;
 
 typedef struct {