aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/bifrost/compiler.h
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-03-09 14:09:04 -0400
committerMarge Bot <[email protected]>2020-03-10 19:25:59 +0000
commit795646d8f863ec2200fa8b92c036b0897f2bdd2b (patch)
treec30de085136ffe33d2c3479b945f7170e1a42da1 /src/panfrost/bifrost/compiler.h
parent9b8cb9f5aee3428e49d80b2154718cae6c29938c (diff)
pan/bi: Generalize swizzles to avoid extracts
We'd really rather not emit extracts. We are approaching on a vector IR anyway which is annoying but really necessary to handle I/O and fp16 correctly. So let's just go all the way and deal with swizzles and masks within reason; it'll still be somewhat saner in the long-term. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4139>
Diffstat (limited to 'src/panfrost/bifrost/compiler.h')
-rw-r--r--src/panfrost/bifrost/compiler.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h
index 14e0bc87567..d0ca32a7a79 100644
--- a/src/panfrost/bifrost/compiler.h
+++ b/src/panfrost/bifrost/compiler.h
@@ -56,7 +56,6 @@ enum bi_class {
BI_CONVERT,
BI_CSEL,
BI_DISCARD,
- BI_EXTRACT,
BI_FMA,
BI_FREXP,
BI_LOAD,
@@ -191,8 +190,7 @@ typedef struct {
unsigned dest;
unsigned src[BIR_SRC_COUNT];
- /* If one of the sources has BIR_INDEX_CONSTANT... Also, for
- * BI_EXTRACT, the component index is stored here. */
+ /* If one of the sources has BIR_INDEX_CONSTANT */
union {
uint64_t u64;
uint32_t u32;
@@ -218,12 +216,11 @@ typedef struct {
/* Source types if required by the class */
nir_alu_type src_types[BIR_SRC_COUNT];
- /* If the source type is 8-bit or 16-bit such that SIMD is possible, and
- * the class has BI_SWIZZLABLE, this is a swizzle for the input. Swizzles
- * in practice only occur with one-source arguments (conversions,
- * dedicated swizzle ops) and as component selection on two-sources
- * where it is unambiguous which is which. Bounds are 32/type_size. */
- unsigned swizzle[4];
+ /* If the source type is 8-bit or 16-bit such that SIMD is possible,
+ * and the class has BI_SWIZZLABLE, this is a swizzle in the usual
+ * sense. On non-SIMD instructions, it can be used for component
+ * selection, so we don't have to special case extraction. */
+ uint8_t swizzle[BIR_SRC_COUNT][NIR_MAX_VEC_COMPONENTS];
/* A class-specific op from which the actual opcode can be derived
* (along with the above information) */