Skip to content

Commit e762baf

Browse files
committed
[AArch64] Move SLId/SRId patterns into instruction definitions. NFC
The v1i64 patterns were next to the vector variants, not the SIMDScalar instructions tht define them. In moving them closer they cal also be incorporated into the definitions themselves. SIMDScalarRShiftDTied is altered to remove the redundant i64 variants.
1 parent 966667f commit e762baf

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

llvm/lib/Target/AArch64/AArch64InstrFormats.td

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10163,15 +10163,10 @@ multiclass SIMDScalarRShiftDTied<bit U, bits<5> opc, string asm,
1016310163
SDPatternOperator OpNode = null_frag> {
1016410164
def d : BaseSIMDScalarShiftTied<U, opc, {1,?,?,?,?,?,?},
1016510165
FPR64, FPR64, vecshiftR64, asm,
10166-
[(set (i64 FPR64:$dst), (OpNode (i64 FPR64:$Rd), (i64 FPR64:$Rn),
10166+
[(set (v1i64 FPR64:$dst), (OpNode (v1i64 FPR64:$Rd), (v1i64 FPR64:$Rn),
1016710167
(i32 vecshiftR64:$imm)))]> {
1016810168
let Inst{21-16} = imm{5-0};
1016910169
}
10170-
10171-
def : Pat<(v1i64 (OpNode (v1i64 FPR64:$Rd), (v1i64 FPR64:$Rn),
10172-
(i32 vecshiftR64:$imm))),
10173-
(!cast<Instruction>(NAME # "d") FPR64:$Rd, FPR64:$Rn,
10174-
vecshiftR64:$imm)>;
1017510170
}
1017610171

1017710172
multiclass SIMDScalarLShiftD<bit U, bits<5> opc, string asm,
@@ -10188,9 +10183,12 @@ multiclass SIMDScalarLShiftD<bit U, bits<5> opc, string asm,
1018810183
}
1018910184

1019010185
let mayStore = 0, mayLoad = 0, hasSideEffects = 0 in
10191-
multiclass SIMDScalarLShiftDTied<bit U, bits<5> opc, string asm> {
10186+
multiclass SIMDScalarLShiftDTied<bit U, bits<5> opc, string asm,
10187+
SDPatternOperator OpNode> {
1019210188
def d : BaseSIMDScalarShiftTied<U, opc, {1,?,?,?,?,?,?},
10193-
FPR64, FPR64, vecshiftL64, asm, []> {
10189+
FPR64, FPR64, vecshiftL64, asm,
10190+
[(set (v1i64 FPR64:$dst), (OpNode (v1i64 FPR64:$Rd), (v1i64 FPR64:$Rn),
10191+
(i32 vecshiftR64:$imm)))]> {
1019410192
let Inst{21-16} = imm{5-0};
1019510193
}
1019610194
}

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8133,7 +8133,7 @@ def : Pat<(i32 (int_aarch64_neon_facgt (f16 FPR16:$Rn), (f16 FPR16:$Rm))),
81338133
hsub))>;
81348134

81358135
defm SHL : SIMDScalarLShiftD< 0, 0b01010, "shl", AArch64vshl>;
8136-
defm SLI : SIMDScalarLShiftDTied<1, 0b01010, "sli">;
8136+
defm SLI : SIMDScalarLShiftDTied<1, 0b01010, "sli", AArch64vsli>;
81378137
defm SQRSHRN : SIMDScalarRShiftBHS< 0, 0b10011, "sqrshrn",
81388138
int_aarch64_neon_sqrshrn>;
81398139
defm SQRSHRUN : SIMDScalarRShiftBHS< 1, 0b10001, "sqrshrun",
@@ -8144,7 +8144,7 @@ defm SQSHRN : SIMDScalarRShiftBHS< 0, 0b10010, "sqshrn",
81448144
int_aarch64_neon_sqshrn>;
81458145
defm SQSHRUN : SIMDScalarRShiftBHS< 1, 0b10000, "sqshrun",
81468146
int_aarch64_neon_sqshrun>;
8147-
defm SRI : SIMDScalarRShiftDTied< 1, 0b01000, "sri">;
8147+
defm SRI : SIMDScalarRShiftDTied< 1, 0b01000, "sri", AArch64vsri>;
81488148
defm SRSHR : SIMDScalarRShiftD< 0, 0b00100, "srshr", AArch64srshri>;
81498149
defm SRSRA : SIMDScalarRShiftDTied< 0, 0b00110, "srsra",
81508150
TriOpFrag<(add node:$LHS,
@@ -8212,9 +8212,6 @@ def : SHLToADDPat<v2i32, FPR64>;
82128212
defm SHRN : SIMDVectorRShiftNarrowBHS<0, 0b10000, "shrn",
82138213
BinOpFrag<(trunc (AArch64vashr node:$LHS, node:$RHS))>>;
82148214
defm SLI : SIMDVectorLShiftBHSDTied<1, 0b01010, "sli", AArch64vsli>;
8215-
def : Pat<(v1i64 (AArch64vsli (v1i64 FPR64:$Rd), (v1i64 FPR64:$Rn),
8216-
(i32 vecshiftL64:$imm))),
8217-
(SLId FPR64:$Rd, FPR64:$Rn, vecshiftL64:$imm)>;
82188215
defm SQRSHRN : SIMDVectorRShiftNarrowBHS<0, 0b10011, "sqrshrn",
82198216
BinOpFrag<(truncssat_s (AArch64srshri node:$LHS, node:$RHS))>>;
82208217
defm SQRSHRUN: SIMDVectorRShiftNarrowBHS<1, 0b10001, "sqrshrun",
@@ -8226,9 +8223,6 @@ defm SQSHRN : SIMDVectorRShiftNarrowBHS<0, 0b10010, "sqshrn",
82268223
defm SQSHRUN : SIMDVectorRShiftNarrowBHS<1, 0b10000, "sqshrun",
82278224
BinOpFrag<(truncssat_u (AArch64vashr node:$LHS, node:$RHS))>>;
82288225
defm SRI : SIMDVectorRShiftBHSDTied<1, 0b01000, "sri", AArch64vsri>;
8229-
def : Pat<(v1i64 (AArch64vsri (v1i64 FPR64:$Rd), (v1i64 FPR64:$Rn),
8230-
(i32 vecshiftR64:$imm))),
8231-
(SRId FPR64:$Rd, FPR64:$Rn, vecshiftR64:$imm)>;
82328226
defm SRSHR : SIMDVectorRShiftBHSD<0, 0b00100, "srshr", AArch64srshri>;
82338227
defm SRSRA : SIMDVectorRShiftBHSDTied<0, 0b00110, "srsra",
82348228
TriOpFrag<(add node:$LHS,

0 commit comments

Comments
 (0)