Deleted Added
full compact
ARMInstrThumb.td (199481) ARMInstrThumb.td (199511)
1//===- ARMInstrThumb.td - Thumb support for ARM ---------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 52 unchanged lines hidden (view full) ---

61 return CurDAG->getTargetConstant(V, MVT::i32);
62}]>;
63
64def thumb_immshifted_shamt : SDNodeXForm<imm, [{
65 unsigned V = ARM_AM::getThumbImmValShift((unsigned)N->getZExtValue());
66 return CurDAG->getTargetConstant(V, MVT::i32);
67}]>;
68
1//===- ARMInstrThumb.td - Thumb support for ARM ---------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 52 unchanged lines hidden (view full) ---

61 return CurDAG->getTargetConstant(V, MVT::i32);
62}]>;
63
64def thumb_immshifted_shamt : SDNodeXForm<imm, [{
65 unsigned V = ARM_AM::getThumbImmValShift((unsigned)N->getZExtValue());
66 return CurDAG->getTargetConstant(V, MVT::i32);
67}]>;
68
69// Scaled 4 immediate.
70def t_imm_s4 : Operand<i32> {
71 let PrintMethod = "printThumbS4ImmOperand";
72}
73
69// Define Thumb specific addressing modes.
70
71// t_addrmode_rr := reg + reg
72//
73def t_addrmode_rr : Operand<i32>,
74 ComplexPattern<i32, 2, "SelectThumbAddrModeRR", []> {
75 let PrintMethod = "printThumbAddrModeRROperand";
76 let MIOperandInfo = (ops tGPR:$base, tGPR:$offsreg);

--- 52 unchanged lines hidden (view full) ---

129
130// For both thumb1 and thumb2.
131let isNotDuplicable = 1 in
132def tPICADD : TIt<(outs GPR:$dst), (ins GPR:$lhs, pclabel:$cp), IIC_iALUr,
133 "\n$cp:\n\tadd\t$dst, pc",
134 [(set GPR:$dst, (ARMpic_add GPR:$lhs, imm:$cp))]>;
135
136// PC relative add.
74// Define Thumb specific addressing modes.
75
76// t_addrmode_rr := reg + reg
77//
78def t_addrmode_rr : Operand<i32>,
79 ComplexPattern<i32, 2, "SelectThumbAddrModeRR", []> {
80 let PrintMethod = "printThumbAddrModeRROperand";
81 let MIOperandInfo = (ops tGPR:$base, tGPR:$offsreg);

--- 52 unchanged lines hidden (view full) ---

134
135// For both thumb1 and thumb2.
136let isNotDuplicable = 1 in
137def tPICADD : TIt<(outs GPR:$dst), (ins GPR:$lhs, pclabel:$cp), IIC_iALUr,
138 "\n$cp:\n\tadd\t$dst, pc",
139 [(set GPR:$dst, (ARMpic_add GPR:$lhs, imm:$cp))]>;
140
141// PC relative add.
137def tADDrPCi : T1I<(outs tGPR:$dst), (ins i32imm:$rhs), IIC_iALUi,
138 "add\t$dst, pc, $rhs * 4", []>;
142def tADDrPCi : T1I<(outs tGPR:$dst), (ins t_imm_s4:$rhs), IIC_iALUi,
143 "add\t$dst, pc, $rhs", []>;
139
140// ADD rd, sp, #imm8
144
145// ADD rd, sp, #imm8
141def tADDrSPi : T1I<(outs tGPR:$dst), (ins GPR:$sp, i32imm:$rhs), IIC_iALUi,
142 "add\t$dst, $sp, $rhs * 4", []>;
146def tADDrSPi : T1I<(outs tGPR:$dst), (ins GPR:$sp, t_imm_s4:$rhs), IIC_iALUi,
147 "add\t$dst, $sp, $rhs", []>;
143
144// ADD sp, sp, #imm7
148
149// ADD sp, sp, #imm7
145def tADDspi : TIt<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs), IIC_iALUi,
146 "add\t$dst, $rhs * 4", []>;
150def tADDspi : TIt<(outs GPR:$dst), (ins GPR:$lhs, t_imm_s4:$rhs), IIC_iALUi,
151 "add\t$dst, $rhs", []>;
147
148// SUB sp, sp, #imm7
152
153// SUB sp, sp, #imm7
149def tSUBspi : TIt<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs), IIC_iALUi,
150 "sub\t$dst, $rhs * 4", []>;
154def tSUBspi : TIt<(outs GPR:$dst), (ins GPR:$lhs, t_imm_s4:$rhs), IIC_iALUi,
155 "sub\t$dst, $rhs", []>;
151
152// ADD rm, sp
153def tADDrSP : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs), IIC_iALUr,
154 "add\t$dst, $rhs", []>;
155
156// ADD sp, rm
157def tADDspr : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs), IIC_iALUr,
158 "add\t$dst, $rhs", []>;
159
160// Pseudo instruction that will expand into a tSUBspi + a copy.
161let usesCustomInserter = 1 in { // Expanded after instruction selection.
156
157// ADD rm, sp
158def tADDrSP : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs), IIC_iALUr,
159 "add\t$dst, $rhs", []>;
160
161// ADD sp, rm
162def tADDspr : TIt<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs), IIC_iALUr,
163 "add\t$dst, $rhs", []>;
164
165// Pseudo instruction that will expand into a tSUBspi + a copy.
166let usesCustomInserter = 1 in { // Expanded after instruction selection.
162def tSUBspi_ : PseudoInst<(outs GPR:$dst), (ins GPR:$lhs, i32imm:$rhs),
163 NoItinerary, "@ sub\t$dst, $rhs * 4", []>;
167def tSUBspi_ : PseudoInst<(outs GPR:$dst), (ins GPR:$lhs, t_imm_s4:$rhs),
168 NoItinerary, "@ sub\t$dst, $rhs", []>;
164
165def tADDspr_ : PseudoInst<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
166 NoItinerary, "@ add\t$dst, $rhs", []>;
167
168let Defs = [CPSR] in
169def tANDsp : PseudoInst<(outs tGPR:$dst), (ins tGPR:$lhs, tGPR:$rhs),
170 NoItinerary, "@ and\t$dst, $rhs", []>;
171} // usesCustomInserter

--- 581 unchanged lines hidden ---
169
170def tADDspr_ : PseudoInst<(outs GPR:$dst), (ins GPR:$lhs, GPR:$rhs),
171 NoItinerary, "@ add\t$dst, $rhs", []>;
172
173let Defs = [CPSR] in
174def tANDsp : PseudoInst<(outs tGPR:$dst), (ins tGPR:$lhs, tGPR:$rhs),
175 NoItinerary, "@ and\t$dst, $rhs", []>;
176} // usesCustomInserter

--- 581 unchanged lines hidden ---