@@ -803,8 +803,7 @@ multiclass T2I_adde_sube_irs<bits<4> opcod, string opc, PatFrag opnode,
803
803
804
804
/// T2I_sh_ir - Defines a set of (op reg, {so_imm|r}) patterns for a shift /
805
805
// rotate operation that produces a value.
806
- multiclass T2I_sh_ir<bits<2> opcod, string opc, Operand ty, PatFrag opnode,
807
- string baseOpc> {
806
+ multiclass T2I_sh_ir<bits<2> opcod, string opc, Operand ty, PatFrag opnode> {
808
807
// 5-bit imm
809
808
def ri : T2sTwoRegShiftImm<
810
809
(outs rGPR:$Rd), (ins rGPR:$Rm, ty:$imm), IIC_iMOVsi,
@@ -829,41 +828,35 @@ multiclass T2I_sh_ir<bits<2> opcod, string opc, Operand ty, PatFrag opnode,
829
828
830
829
// Optional destination register
831
830
def : t2InstAlias<!strconcat(opc, "${s}${p}", ".w $Rdn, $imm"),
832
- (!cast<Instruction>(!strconcat(baseOpc, "ri")) rGPR:$Rdn, rGPR:$Rdn,
833
- ty:$imm, pred:$p,
834
- cc_out:$s)>;
831
+ (!cast<Instruction>(NAME#"ri") rGPR:$Rdn, rGPR:$Rdn, ty:$imm, pred:$p,
832
+ cc_out:$s)>;
835
833
def : t2InstAlias<!strconcat(opc, "${s}${p}", ".w $Rdn, $Rm"),
836
- (!cast<Instruction>(!strconcat(baseOpc, "rr")) rGPR:$Rdn, rGPR:$Rdn,
837
- rGPR:$Rm, pred:$p,
838
- cc_out:$s)>;
834
+ (!cast<Instruction>(NAME#"rr") rGPR:$Rdn, rGPR:$Rdn, rGPR:$Rm, pred:$p,
835
+ cc_out:$s)>;
839
836
840
837
// Assembler aliases w/o the ".w" suffix.
841
838
def : t2InstAlias<!strconcat(opc, "${s}${p}", " $Rd, $Rn, $imm"),
842
- (!cast<Instruction>(!strconcat(baseOpc, "ri")) rGPR:$Rd, rGPR:$Rn,
843
- ty:$imm, pred:$p,
844
- cc_out:$s)>;
839
+ (!cast<Instruction>(NAME#"ri") rGPR:$Rd, rGPR:$Rn, ty:$imm, pred:$p,
840
+ cc_out:$s)>;
845
841
def : t2InstAlias<!strconcat(opc, "${s}${p}", " $Rd, $Rn, $Rm"),
846
- (!cast<Instruction>(!strconcat(baseOpc, "rr")) rGPR:$Rd, rGPR:$Rn,
847
- rGPR:$Rm, pred:$p,
848
- cc_out:$s)>;
842
+ (!cast<Instruction>(NAME#"rr") rGPR:$Rd, rGPR:$Rn, rGPR:$Rm, pred:$p,
843
+ cc_out:$s)>;
849
844
850
845
// and with the optional destination operand, too.
851
846
def : t2InstAlias<!strconcat(opc, "${s}${p}", " $Rdn, $imm"),
852
- (!cast<Instruction>(!strconcat(baseOpc, "ri")) rGPR:$Rdn, rGPR:$Rdn,
853
- ty:$imm, pred:$p,
854
- cc_out:$s)>;
847
+ (!cast<Instruction>(NAME#"ri") rGPR:$Rdn, rGPR:$Rdn, ty:$imm, pred:$p,
848
+ cc_out:$s)>;
855
849
def : t2InstAlias<!strconcat(opc, "${s}${p}", " $Rdn, $Rm"),
856
- (!cast<Instruction>(!strconcat(baseOpc, "rr")) rGPR:$Rdn, rGPR:$Rdn,
857
- rGPR:$Rm, pred:$p,
858
- cc_out:$s)>;
850
+ (!cast<Instruction>(NAME#"rr") rGPR:$Rdn, rGPR:$Rdn, rGPR:$Rm, pred:$p,
851
+ cc_out:$s)>;
859
852
}
860
853
861
854
/// T2I_cmp_irs - Defines a set of (op r, {so_imm|r|so_reg}) cmp / test
862
855
/// patterns. Similar to T2I_bin_irs except the instruction does not produce
863
856
/// a explicit result, only implicitly set CPSR.
864
857
multiclass T2I_cmp_irs<bits<4> opcod, string opc,
865
858
InstrItinClass iii, InstrItinClass iir, InstrItinClass iis,
866
- PatFrag opnode, string baseOpc > {
859
+ PatFrag opnode> {
867
860
let isCompare = 1, Defs = [CPSR] in {
868
861
// shifted imm
869
862
def ri : T2OneRegCmpImm<
@@ -908,12 +901,9 @@ let isCompare = 1, Defs = [CPSR] in {
908
901
// No alias here for 'rr' version as not all instantiations of this
909
902
// multiclass want one (CMP in particular, does not).
910
903
def : t2InstAlias<!strconcat(opc, "${p}", " $Rn, $imm"),
911
- (!cast<Instruction>(!strconcat(baseOpc, "ri")) GPRnopc:$Rn,
912
- t2_so_imm:$imm, pred:$p)>;
904
+ (!cast<Instruction>(NAME#"ri") GPRnopc:$Rn, t2_so_imm:$imm, pred:$p)>;
913
905
def : t2InstAlias<!strconcat(opc, "${p}", " $Rn, $shift"),
914
- (!cast<Instruction>(!strconcat(baseOpc, "rs")) GPRnopc:$Rn,
915
- t2_so_reg:$shift,
916
- pred:$p)>;
906
+ (!cast<Instruction>(NAME#"rs") GPRnopc:$Rn, t2_so_reg:$shift, pred:$p)>;
917
907
}
918
908
919
909
/// T2I_ld - Defines a set of (op r, {imm12|imm8|so_reg}) load patterns.
@@ -2147,13 +2137,13 @@ def : T2Pat<(int_arm_usat GPR:$a, imm:$pos), (t2USAT imm:$pos, GPR:$a, 0)>;
2147
2137
//
2148
2138
2149
2139
defm t2LSL : T2I_sh_ir<0b00, "lsl", imm0_31,
2150
- BinOpFrag<(shl node:$LHS, node:$RHS)>, "t2LSL" >;
2140
+ BinOpFrag<(shl node:$LHS, node:$RHS)>>;
2151
2141
defm t2LSR : T2I_sh_ir<0b01, "lsr", imm_sr,
2152
- BinOpFrag<(srl node:$LHS, node:$RHS)>, "t2LSR" >;
2142
+ BinOpFrag<(srl node:$LHS, node:$RHS)>>;
2153
2143
defm t2ASR : T2I_sh_ir<0b10, "asr", imm_sr,
2154
- BinOpFrag<(sra node:$LHS, node:$RHS)>, "t2ASR" >;
2144
+ BinOpFrag<(sra node:$LHS, node:$RHS)>>;
2155
2145
defm t2ROR : T2I_sh_ir<0b11, "ror", imm0_31,
2156
- BinOpFrag<(rotr node:$LHS, node:$RHS)>, "t2ROR" >;
2146
+ BinOpFrag<(rotr node:$LHS, node:$RHS)>>;
2157
2147
2158
2148
// (rotr x, (and y, 0x...1f)) ==> (ROR x, y)
2159
2149
def : T2Pat<(rotr rGPR:$lhs, (and rGPR:$rhs, lo5AllOne)),
@@ -2871,7 +2861,7 @@ def : T2Pat<(or (and rGPR:$src1, 0xFFFF0000),
2871
2861
//
2872
2862
defm t2CMP : T2I_cmp_irs<0b1101, "cmp",
2873
2863
IIC_iCMPi, IIC_iCMPr, IIC_iCMPsi,
2874
- BinOpFrag<(ARMcmp node:$LHS, node:$RHS)>, "t2CMP" >;
2864
+ BinOpFrag<(ARMcmp node:$LHS, node:$RHS)>>;
2875
2865
2876
2866
def : T2Pat<(ARMcmpZ GPRnopc:$lhs, t2_so_imm:$imm),
2877
2867
(t2CMPri GPRnopc:$lhs, t2_so_imm:$imm)>;
@@ -2925,13 +2915,10 @@ let isCompare = 1, Defs = [CPSR] in {
2925
2915
// Assembler aliases w/o the ".w" suffix.
2926
2916
// No alias here for 'rr' version as not all instantiations of this multiclass
2927
2917
// want one (CMP in particular, does not).
2928
- def : t2InstAlias<!strconcat("cmn", "${p}", " $Rn, $imm"),
2929
- (!cast<Instruction>(!strconcat("t2CMN", "ri")) GPRnopc:$Rn,
2930
- t2_so_imm:$imm, pred:$p)>;
2931
- def : t2InstAlias<!strconcat("cmn", "${p}", " $Rn, $shift"),
2932
- (!cast<Instruction>(!strconcat("t2CMNz", "rs")) GPRnopc:$Rn,
2933
- t2_so_reg:$shift,
2934
- pred:$p)>;
2918
+ def : t2InstAlias<"cmn${p} $Rn, $imm",
2919
+ (t2CMNri GPRnopc:$Rn, t2_so_imm:$imm, pred:$p)>;
2920
+ def : t2InstAlias<"cmn${p} $Rn, $shift",
2921
+ (t2CMNzrs GPRnopc:$Rn, t2_so_reg:$shift, pred:$p)>;
2935
2922
2936
2923
def : T2Pat<(ARMcmp GPR:$src, t2_so_imm_neg:$imm),
2937
2924
(t2CMNri GPR:$src, t2_so_imm_neg:$imm)>;
@@ -2941,12 +2928,10 @@ def : T2Pat<(ARMcmpZ GPRnopc:$src, t2_so_imm_neg:$imm),
2941
2928
2942
2929
defm t2TST : T2I_cmp_irs<0b0000, "tst",
2943
2930
IIC_iTSTi, IIC_iTSTr, IIC_iTSTsi,
2944
- BinOpFrag<(ARMcmpZ (and_su node:$LHS, node:$RHS), 0)>,
2945
- "t2TST">;
2931
+ BinOpFrag<(ARMcmpZ (and_su node:$LHS, node:$RHS), 0)>>;
2946
2932
defm t2TEQ : T2I_cmp_irs<0b0100, "teq",
2947
2933
IIC_iTSTi, IIC_iTSTr, IIC_iTSTsi,
2948
- BinOpFrag<(ARMcmpZ (xor_su node:$LHS, node:$RHS), 0)>,
2949
- "t2TEQ">;
2934
+ BinOpFrag<(ARMcmpZ (xor_su node:$LHS, node:$RHS), 0)>>;
2950
2935
2951
2936
// Conditional moves
2952
2937
// FIXME: should be able to write a pattern for ARMcmov, but can't use
0 commit comments