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,
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:
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;