From 7e76c2b806dcef8254f0039ce27d916ca6dc2bf5 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 17 Apr 2020 15:20:50 -0400 Subject: pan/bi: Structify add and min/max fp16 ADD Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/panfrost/bifrost/bifrost.h b/src/panfrost/bifrost/bifrost.h index 1c47dab9fc4..38c85c853fb 100644 --- a/src/panfrost/bifrost/bifrost.h +++ b/src/panfrost/bifrost/bifrost.h @@ -160,19 +160,37 @@ struct bifrost_add_2src { #define BIFROST_ADD_OP_FMIN32 (0x01) #define BIFROST_ADD_OP_FADD32 (0x02) +#define BIFROST_ADD_OP_FADD16 (0x0A) + struct bifrost_add_faddmin { unsigned src0 : 3; unsigned src1 : 3; unsigned src1_abs : 1; unsigned src0_neg : 1; unsigned src1_neg : 1; - unsigned select : 2; - unsigned outmod : 2; + unsigned select : 2; /* swizzle_0 for fp16 */ + unsigned outmod : 2; /* swizzle_1 for fp16 */ unsigned mode : 2; unsigned src0_abs : 1; unsigned op : 4; } __attribute__((packed)); +#define BIFROST_ADD_OP_FMAX16 (0x10) +#define BIFROST_ADD_OP_FMIN16 (0x12) + +struct bifrost_add_fmin16 { + unsigned src0 : 3; + unsigned src1 : 3; + /* abs2 inferred as with FMA */ + unsigned abs1 : 1; + unsigned src0_neg : 1; + unsigned src1_neg : 1; + unsigned src0_swizzle : 2; + unsigned src1_swizzle : 2; + unsigned mode : 2; + unsigned op : 5; +} __attribute__((packed)); + #define BIFROST_ADD_OP_ST_VAR (0x19300 >> 8) struct bifrost_st_vary { -- cgit v1.2.3