From: Alyssa Rosenzweig Date: Tue, 3 Mar 2020 01:51:03 +0000 (-0500) Subject: pan/bi: Factor out enum bifrost_minmax_mode X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bbf41ffb00d8d78db1cf43403ab7f6af5a2f9ec3;p=mesa.git pan/bi: Factor out enum bifrost_minmax_mode We'll want it from the compiler-side. Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/bifrost/bifrost.h b/src/panfrost/bifrost/bifrost.h index 64a9e8d9a65..237b99e93d6 100644 --- a/src/panfrost/bifrost/bifrost.h +++ b/src/panfrost/bifrost/bifrost.h @@ -96,6 +96,13 @@ enum bifrost_roundmode { BIFROST_RTZ = 0x3 }; +enum bifrost_minmax_mode { + BIFROST_MINMAX_NONE = 0x0, + BIFROST_NAN_WINS = 0x1, + BIFROST_SRC1_WINS = 0x2, + BIFROST_SRC0_WINS = 0x3, +}; + struct bifrost_fma_add { unsigned src0 : 3; unsigned src1 : 3; diff --git a/src/panfrost/bifrost/disassemble.c b/src/panfrost/bifrost/disassemble.c index 975d88bf383..f16f96cd73b 100644 --- a/src/panfrost/bifrost/disassemble.c +++ b/src/panfrost/bifrost/disassemble.c @@ -439,20 +439,20 @@ static void dump_output_mod(FILE *fp, unsigned mod) static void dump_minmax_mode(FILE *fp, unsigned mod) { switch (mod) { - case 0: + case BIFROST_MINMAX_NONE: /* Same as fmax() and fmin() -- return the other number if any * number is NaN. Also always return +0 if one argument is +0 and * the other is -0. */ break; - case 1: + case BIFROST_NAN_WINS: /* Instead of never returning a NaN, always return one. The * "greater"/"lesser" NaN is always returned, first by checking the * sign and then the mantissa bits. */ fprintf(fp, ".nan_wins"); break; - case 2: + case BIFROST_SRC1_WINS: /* For max, implement src0 > src1 ? src0 : src1 * For min, implement src0 < src1 ? src0 : src1 * @@ -463,7 +463,7 @@ static void dump_minmax_mode(FILE *fp, unsigned mod) */ fprintf(fp, ".src1_wins"); break; - case 3: + case BIFROST_SRC0_WINS: /* For max, implement src0 < src1 ? src1 : src0 * For min, implement src0 > src1 ? src1 : src0 */