pan/bi: Fix clper_xor on Mali-G31

Mali-G31 has the old CLPER instruction, not the new one, which means we don't
get to specify a custom lane op. But the clper_xor helper incorrectly checked
the arch, not the implementation quirk.

Fixes: c00e7b729f ("pan/bi: Optimize abs(derivative)")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16846>
(cherry picked from commit 7535362204)
This commit is contained in:
Alyssa Rosenzweig 2022-06-02 20:27:41 -04:00 committed by Dylan Baker
parent d962bdcdd3
commit 5baf33795a
2 changed files with 7 additions and 5 deletions

View file

@ -2092,7 +2092,7 @@
"description": "pan/bi: Fix clper_xor on Mali-G31",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "c00e7b729fe84d433e3c23e5c118a348e01ced87"
},

View file

@ -1881,13 +1881,15 @@ bi_lower_fsincos_32(bi_builder *b, bi_index dst, bi_index s0, bool cos)
bi_fadd_f32_to(b, dst, I->dest[0], cos ? cosx : sinx);
}
/* The XOR lane op is useful for derivative calculation, but was added in v7.
* Add a safe helper that will do the appropriate lowering on v6 */
/*
* The XOR lane op is useful for derivative calculations, but not all Bifrost
* implementations have it. Add a safe helper that uses the hardware
* functionality when available and lowers where unavailable.
*/
static bi_index
bi_clper_xor(bi_builder *b, bi_index s0, bi_index s1)
{
if (b->shader->arch >= 7) {
if (!(b->shader->quirks & BIFROST_LIMITED_CLPER)) {
return bi_clper_i32(b, s0, s1,
BI_INACTIVE_RESULT_ZERO, BI_LANE_OP_XOR,
BI_SUBGROUP_SUBGROUP4);