pan/bi: Structify FMA_FADD

Just to make it easier to work with.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4025>
This commit is contained in:
Alyssa Rosenzweig
2020-03-02 16:42:36 -05:00
committed by Marge Bot
parent 4fe5b59a96
commit 346262ceb6
2 changed files with 35 additions and 8 deletions
+27
View File
@@ -82,6 +82,33 @@ struct bifrost_add_inst {
unsigned op : 17;
};
enum bifrost_outmod {
BIFROST_NONE = 0x0,
BIFROST_POS = 0x1,
BIFROST_SAT_SIGNED = 0x2,
BIFROST_SAT = 0x3,
};
enum bifrost_roundmode {
BIFROST_RTE = 0x0,
BIFROST_RTP = 0x1,
BIFROST_RTN = 0x2,
BIFROST_RTZ = 0x3
};
struct bifrost_fma_add {
unsigned src0 : 3;
unsigned src1 : 3;
unsigned src1_abs : 1;
unsigned src0_neg : 1;
unsigned src1_neg : 1;
unsigned unk : 3;
unsigned src0_abs : 1;
enum bifrost_outmod outmod : 2;
enum bifrost_roundmode roundmode : 2;
unsigned op : 6;
};
enum bifrost_csel_cond {
BIFROST_FEQ_F = 0x0,
BIFROST_FGT_F = 0x1,
+8 -8
View File
@@ -483,15 +483,15 @@ static void dump_src(FILE *fp, unsigned src, struct bifrost_regs srcs, uint64_t
static void dump_output_mod(FILE *fp, unsigned mod)
{
switch (mod) {
case 0:
case BIFROST_NONE:
break;
case 1:
case BIFROST_POS:
fprintf(fp, ".clamp_0_inf");
break; // max(out, 0)
case 2:
case BIFROST_SAT_SIGNED:
fprintf(fp, ".clamp_m1_1");
break; // clamp(out, -1, 1)
case 3:
case BIFROST_SAT:
fprintf(fp, ".clamp_0_1");
break; // clamp(out, 0, 1)
default:
@@ -540,18 +540,18 @@ static void dump_minmax_mode(FILE *fp, unsigned mod)
static void dump_round_mode(FILE *fp, unsigned mod)
{
switch (mod) {
case 0:
case BIFROST_RTE:
/* roundTiesToEven, the IEEE default. */
break;
case 1:
case BIFROST_RTP:
/* roundTowardPositive in the IEEE spec. */
fprintf(fp, ".round_pos");
break;
case 2:
case BIFROST_RTN:
/* roundTowardNegative in the IEEE spec. */
fprintf(fp, ".round_neg");
break;
case 3:
case BIFROST_RTZ:
/* roundTowardZero in the IEEE spec. */
fprintf(fp, ".round_zero");
break;