On 4/14/25 7:44 PM, Kyrylo Tkachov wrote:
Hi Tejas,
On 14 Apr 2025, at 16:04, Tejas Belagod <tejas.bela...@arm.com> wrote:
The operand order to gen_vcond_mask call in the vec_extract pattern is wrong.
Fix the order where predicate is operand 3.
Tested and bootstrapped on aarch64-linux-gnu. OK for trunk?
gcc/ChangeLog
* config/aarch64/aarch64-sve.md (vec_extract<vpred><Vel>): Fix operand
order to gen_vcond_mask_*.
---
gcc/config/aarch64/aarch64-sve.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/config/aarch64/aarch64-sve.md
b/gcc/config/aarch64/aarch64-sve.md
index 3dbd65986ec..d4af3706294 100644
--- a/gcc/config/aarch64/aarch64-sve.md
+++ b/gcc/config/aarch64/aarch64-sve.md
@@ -3133,9 +3133,9 @@
"TARGET_SVE"
{
rtx tmp = gen_reg_rtx (<MODE>mode);
- emit_insn (gen_vcond_mask_<mode><vpred> (tmp, operands[1],
- CONST1_RTX (<MODE>mode),
- CONST0_RTX (<MODE>mode)));
+ emit_insn (gen_vcond_mask_<mode><vpred> (tmp, CONST1_RTX (<MODE>mode),
+ CONST0_RTX (<MODE>mode),
+ operands[1]));
emit_insn (gen_vec_extract<mode><Vel> (operands[0], tmp, operands[2]));
DONE;
Looks like a correct fix, is there a test case where this causes a problem?
No, I discovered it while working on making [] work on svbool_t, so it
needs new changes for this code path to be taken. With HEAD, I'm not
able to get vec_extract to trigger on a boolean vector as I can't use []
on svbool_t. None of the existing intrinsics seem to help either.
Does it need back porting?
Probably not as it needs a new feature.
Thanks,
Tejas.
Thanks,
Kyrill
}
--
2.25.1