AArch64: Fix conditional branch pattern for SVE fallback
Corrects a masking issue in AArch64 SVE conditional branch fallback patterns.
This commit fixes an incorrect mask generation in the conditional branch patterns for AArch64 Scalable Vector Extension (SVE) fallback code. The issue caused incorrect behavior in loops that perform element-wise comparisons with vector data. The fix ensures the correct mask is applied, leading to accurate loop termination and correct results for the provided test case.
In Details
This patch corrects the mask generation for vec_cbranch_any and vec_cbranch_all in config/aarch64/aarch64-simd.md. The original code produced an incorrect mask when falling back to scalar operations after SVE vector operations, specifically affecting conditional branches based on vector comparisons. The corrected pattern ensures that the appropriate SVE predicate mask is applied, resolving issues seen in the provided test case with floating-point comparisons in a loop.
- SVE
- Scalable Vector Extension, an ARM instruction set architecture extension providing vector processing capabilities.
- predicate mask
- A special vector register in SVE that controls which elements within a vector operation are active or inactive.
- fallback pattern
- An alternative code generation sequence used when the primary, more optimized pattern cannot be applied.
- vector comparison
- An operation that compares corresponding elements of two vectors, producing a predicate mask or a vector of comparison results.