[llvm] [AArch64][SVE] Use INS when moving elements from bottom 128b of SVE type (PR #114034)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 30 04:03:51 PDT 2024
================
@@ -7222,44 +7222,101 @@ def : Pat<(v2i64 (int_aarch64_neon_vcopy_lane
V128:$Vd, VectorIndexD:$idx, V128:$Vs, VectorIndexD:$idx2)
)>;
-multiclass Neon_INS_elt_pattern<ValueType VT128, ValueType VT64,
- ValueType VTScal, Instruction INS> {
- def : Pat<(VT128 (vector_insert V128:$src,
- (VTScal (vector_extract (VT128 V128:$Rn), (i64 imm:$Immn))),
+// Insert an extracted vector element into a 128-bit Neon vector
+multiclass Neon_INS_elt_pattern_v128<ValueType VT128, ValueType VT64, ValueType VTSVE,
+ ValueType VTScal, Operand ExIdxTy, Instruction INS> {
+ // Extracting from the lower 128-bits of an SVE vector
+ def : Pat<(VT128 (vector_insert VT128:$Rn,
+ (VTScal (vector_extract VTSVE:$Rm, (i64 ExIdxTy:$Immn))),
+ (i64 imm:$Immd))),
+ (INS VT128:$Rn, imm:$Immd, (VT128 (EXTRACT_SUBREG VTSVE:$Rm, zsub)), ExIdxTy:$Immn)>;
+
+ // Extracting from another Neon vector
+ def : Pat<(VT128 (vector_insert V128:$Rn,
+ (VTScal (vector_extract (VT128 V128:$Rm), (i64 imm:$Immn))),
----------------
SpencerAbson wrote:
Good point, this was a little over-kill.
https://github.com/llvm/llvm-project/pull/114034
More information about the llvm-commits
mailing list