aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/bifrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-04-06 13:08:44 -0400
committerMarge Bot <[email protected]>2020-04-06 19:41:56 +0000
commit0e0f7f110cbf9a39325cf7c2361a611fd8c870b3 (patch)
treed832e1db4820a77e2d79c49b4dbef8aaf733b34d /src/panfrost/bifrost
parente9967e9f8011553a5ef160eb85d03cd1d3ae31d4 (diff)
pan/bit: Add min/max support to interpreter
Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4470>
Diffstat (limited to 'src/panfrost/bifrost')
-rw-r--r--src/panfrost/bifrost/test/bi_interpret.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/panfrost/bifrost/test/bi_interpret.c b/src/panfrost/bifrost/test/bi_interpret.c
index b6807f55456..f0068398df4 100644
--- a/src/panfrost/bifrost/test/bi_interpret.c
+++ b/src/panfrost/bifrost/test/bi_interpret.c
@@ -184,6 +184,8 @@ bit_write(struct bit_state *s, unsigned index, nir_alu_type T, bit_t value, bool
bit_make_poly(add, a + b);
bit_make_float(fma, (a * b) + c);
bit_make_poly(mov, a);
+bit_make_poly(min, MIN2(a, b));
+bit_make_poly(max, MAX2(a, b));
/* Modifiers */
@@ -317,9 +319,16 @@ bit_step(struct bit_state *s, bi_instruction *ins, bool FMA)
case BI_FREXP:
case BI_ISUB:
- case BI_MINMAX:
unreachable("Unsupported op");
+ case BI_MINMAX: {
+ if (ins->op.minmax == BI_MINMAX_MIN) {
+ bpoly(min);
+ } else {
+ bpoly(max);
+ }
+ }
+
case BI_MOV:
bpoly(mov);