aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-05-04 14:29:03 -0400
committerMarge Bot <[email protected]>2020-05-04 18:45:15 +0000
commit66163614dbfc546168bd44036669277f7a4a0209 (patch)
tree15852b4aeafabcf6a79e3cf808d21b53fd9e9e9c /src/panfrost
parent1799435df0f2782671596dd34c1f1965931943ad (diff)
pan/bit: Interpret IMATH
Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4890>
Diffstat (limited to 'src/panfrost')
-rw-r--r--src/panfrost/bifrost/test/bi_interpret.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/panfrost/bifrost/test/bi_interpret.c b/src/panfrost/bifrost/test/bi_interpret.c
index 6a7fa694342..1285787ef27 100644
--- a/src/panfrost/bifrost/test/bi_interpret.c
+++ b/src/panfrost/bifrost/test/bi_interpret.c
@@ -185,6 +185,7 @@ bit_write(struct bit_state *s, unsigned index, nir_alu_type T, bit_t value, bool
bit_make_int(name, expr) \
bit_make_poly(add, a + b);
+bit_make_int(sub, a - b);
bit_make_float(fma, (a * b) + c);
bit_make_poly(mov, a);
bit_make_poly(min, MIN2(a, b));
@@ -525,8 +526,18 @@ bit_step(struct bit_state *s, bi_instruction *ins, bool FMA)
break;
}
- case BI_IMATH:
- unreachable("Unsupported op");
+
+ case BI_IMATH: {
+ if (ins->op.imath == BI_IMATH_ADD) {
+ bint(bit_i64add, bit_i32add, bit_i16add, bit_i8add);
+ } else if (ins->op.imath == BI_IMATH_SUB) {
+ bint(bit_i64sub, bit_i32sub, bit_i16sub, bit_i8sub);
+ } else {
+ unreachable("Unsupported op");
+ }
+
+ break;
+ }
case BI_MINMAX: {
if (ins->op.minmax == BI_MINMAX_MIN) {