From d69bf8db6217b7309ea7a7aec8139c8151b39f3c Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 2 Mar 2020 20:52:36 -0500 Subject: [PATCH] pan/bi: Add a bifrost_roundmode field And a class property signaling it's okay to use. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_tables.c | 4 ++-- src/panfrost/bifrost/compiler.h | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/panfrost/bifrost/bi_tables.c b/src/panfrost/bifrost/bi_tables.c index 0681fbad00d..c1acd379d22 100644 --- a/src/panfrost/bifrost/bi_tables.c +++ b/src/panfrost/bifrost/bi_tables.c @@ -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, }; diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 823d2e7bc24..421db9afb7f 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -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 { -- 2.30.2