From 99f3c1f34c0526a9d0a5177d71d0c4a6042c3409 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 2 Mar 2020 21:53:13 -0500 Subject: [PATCH] pan/bi: Add PAN_SCHED_* flags Class (mostly) determines scheduling options. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_tables.c | 46 ++++++++++++++++---------------- src/panfrost/bifrost/compiler.h | 9 +++++++ 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/src/panfrost/bifrost/bi_tables.c b/src/panfrost/bifrost/bi_tables.c index c1acd379d22..cf3e774efd8 100644 --- a/src/panfrost/bifrost/bi_tables.c +++ b/src/panfrost/bifrost/bi_tables.c @@ -27,27 +27,27 @@ #include "compiler.h" unsigned bi_class_props[BI_NUM_CLASSES] = { - [BI_ADD] = BI_GENERIC | BI_MODS, - [BI_ATEST] = 0, - [BI_BRANCH] = 0, - [BI_CMP] = BI_GENERIC | BI_MODS, - [BI_BLEND] = 0, - [BI_BITWISE] = BI_GENERIC, - [BI_CONVERT] = 0, - [BI_CSEL] = 0, - [BI_DISCARD] = 0, - [BI_FMA] = BI_ROUNDMODE, - [BI_FREXP] = 0, - [BI_LOAD] = 0, - [BI_LOAD_ATTR] = 0, - [BI_LOAD_VAR] = 0, - [BI_LOAD_VAR_ADDRESS] = 0, - [BI_MINMAX] = BI_GENERIC, - [BI_MOV] = BI_MODS, - [BI_SHIFT] = 0, - [BI_STORE] = 0, - [BI_STORE_VAR] = 0, - [BI_SPECIAL] = 0, - [BI_TEX] = 0, - [BI_ROUND] = BI_GENERIC | BI_ROUNDMODE, + [BI_ADD] = BI_GENERIC | BI_MODS | BI_SCHED_ALL, + [BI_ATEST] = BI_SCHED_ADD, + [BI_BRANCH] = BI_SCHED_ADD, + [BI_CMP] = BI_GENERIC | BI_MODS | BI_SCHED_ALL, + [BI_BLEND] = BI_ADD, + [BI_BITWISE] = BI_GENERIC | BI_SCHED_ALL, + [BI_CONVERT] = BI_SCHED_ALL, + [BI_CSEL] = BI_SCHED_FMA, + [BI_DISCARD] = BI_SCHED_ADD, + [BI_FMA] = BI_ROUNDMODE | BI_SCHED_FMA, + [BI_FREXP] = BI_SCHED_ALL, + [BI_LOAD] = BI_SCHED_ADD, + [BI_LOAD_ATTR] = BI_SCHED_ADD, + [BI_LOAD_VAR] = BI_SCHED_ADD, + [BI_LOAD_VAR_ADDRESS] = BI_SCHED_ADD, + [BI_MINMAX] = BI_GENERIC | BI_SCHED_ALL, + [BI_MOV] = BI_MODS | BI_SCHED_ALL, + [BI_SHIFT] = BI_SCHED_ALL, + [BI_STORE] = BI_SCHED_ADD, + [BI_STORE_VAR] = BI_SCHED_ADD, + [BI_SPECIAL] = BI_SCHED_ALL, + [BI_TEX] = BI_SCHED_ADD, + [BI_ROUND] = BI_GENERIC | BI_ROUNDMODE | BI_SCHED_ALL, }; diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index e37c03c52f6..9f56ed2dcfa 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -86,6 +86,15 @@ extern unsigned bi_class_props[BI_NUM_CLASSES]; /* Accepts a bifrost_roundmode */ #define BI_ROUNDMODE (1 << 2) +/* Can be scheduled to FMA */ +#define BI_SCHED_FMA (1 << 3) + +/* Can be scheduled to ADD */ +#define BI_SCHED_ADD (1 << 4) + +/* Most ALU ops can do either, actually */ +#define BI_SCHED_ALL (BI_SCHED_FMA | BI_SCHED_ADD) + /* It can't get any worse than csel4... can it? */ #define BIR_SRC_COUNT 4 -- 2.30.2