aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-05-04 14:13:29 -0400
committerMarge Bot <[email protected]>2020-05-04 18:45:15 +0000
commit8fcc23bf28d2c533151465bdf1d1d0cecb59b8fc (patch)
tree0b078a37d69fa1f0733d284b796089dbaa49520c /src/panfrost
parent36e4ffa382f9f82ff6d7ed1dd4fc66010ed48fea (diff)
pan/bit: Factor out identity swizzle helper
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_test_pack.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/panfrost/bifrost/test/bi_test_pack.c b/src/panfrost/bifrost/test/bi_test_pack.c
index 2f02db12c9b..832eddaa163 100644
--- a/src/panfrost/bifrost/test/bi_test_pack.c
+++ b/src/panfrost/bifrost/test/bi_test_pack.c
@@ -517,19 +517,23 @@ bit_constant_helper(struct panfrost_device *dev,
}
static void
+bit_swizzle_identity(bi_instruction *ins, unsigned args, unsigned size)
+{
+ for (unsigned i = 0; i < 2; ++i) {
+ for (unsigned j = 0; j < (32 / size); ++j)
+ ins->swizzle[i][j] = j;
+ }
+}
+
+static void
bit_bitwise_helper(struct panfrost_device *dev, uint32_t *input, unsigned size, enum bit_debug debug)
{
bi_instruction ins = bit_ins(BI_BITWISE, 3, nir_type_uint, size);
+ bit_swizzle_identity(&ins, 2, size);
/* TODO: shifts */
ins.src[2] = BIR_INDEX_ZERO;
- /* Force identity swizzle -- bitwise is not swizzleable */
- for (unsigned i = 0; i < 2; ++i) {
- for (unsigned j = 0; j < (32 / size); ++j)
- ins.swizzle[i][j] = j;
- }
-
for (unsigned op = BI_BITWISE_AND; op <= BI_BITWISE_XOR; ++op) {
ins.op.bitwise = op;