summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>2020-04-28 14:36:17 -0400
committerMarge Bot <eric+marge@anholt.net>2020-04-29 00:30:05 +0000
commita077da627300435eba90248683e778bb12631ed0 (patch)
tree160528a76830e9ac51d32496a7b9f4989acd27b5
parentef9582738e5950764dcd33eddef7183e5529e5ff (diff)
pan/bi: Handle iand/ior/ixor in NIR->BIR
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4790>
-rw-r--r--src/panfrost/bifrost/bifrost_compile.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index c051b169af2..ad3cdd90449 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -349,6 +349,11 @@ bi_class_for_nir_alu(nir_op op)
case nir_op_isub:
return BI_ISUB;
+ case nir_op_iand:
+ case nir_op_ior:
+ case nir_op_ixor:
+ return BI_BITWISE;
+
BI_CASE_CMP(nir_op_flt)
BI_CASE_CMP(nir_op_fge)
BI_CASE_CMP(nir_op_feq)
@@ -650,6 +655,15 @@ emit_alu(bi_context *ctx, nir_alu_instr *instr)
case nir_op_ftrunc:
alu.roundmode = BIFROST_RTZ;
break;
+ case nir_op_iand:
+ alu.op.bitwise = BI_BITWISE_AND;
+ break;
+ case nir_op_ior:
+ alu.op.bitwise = BI_BITWISE_OR;
+ break;
+ case nir_op_ixor:
+ alu.op.bitwise = BI_BITWISE_XOR;
+ break;
default:
break;
}
@@ -662,6 +676,10 @@ emit_alu(bi_context *ctx, nir_alu_instr *instr)
bi_fuse_csel_cond(&alu, instr->src[0],
&constants_left, &constant_shift, comps);
+ } else if (alu.type == BI_BITWISE) {
+ /* Implicit shift argument... at some point we should fold */
+ alu.src[2] = BIR_INDEX_ZERO;
+ alu.src_types[2] = alu.src_types[1];
}
bi_emit(ctx, alu);