diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-04-17 15:20:50 -0400 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2020-04-17 16:25:35 -0400 |
commit | 7e76c2b806dcef8254f0039ce27d916ca6dc2bf5 (patch) | |
tree | 471684210d0014bf24b85be6dc5b83ae87a29105 | |
parent | 1647884cec58577024c0ff5e22d276b9e8e741f6 (diff) |
pan/bi: Structify add and min/max fp16 ADD
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>
-rw-r--r-- | src/panfrost/bifrost/bifrost.h | 22 |
1 files 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 { |