blob: 92e68eb02c42842e9017691da25ecb051fd27f26 [file] [log] [blame]
Duraid Madina9b9d45f2005-03-17 18:17:03 +00001//===- IA64InstrInfo.td - Describe the IA64 Instruction Set -----*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by Duraid Madina and is distributed under the
6// University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file describes the IA64 instruction set, defining the instructions, and
11// properties of the instructions which are needed for code generation, machine
12// code emission, and analysis.
13//
14//===----------------------------------------------------------------------===//
15
16include "IA64InstrFormats.td"
17
18def u6imm : Operand<i8>;
Duraid Madina18c0c6b2005-04-07 12:32:24 +000019def s8imm : Operand<i8> {
20 let PrintMethod = "printS8ImmOperand";
21}
22def s14imm : Operand<i16> {
23 let PrintMethod = "printS14ImmOperand";
24}
Duraid Madina5ef2ec92005-04-11 05:55:56 +000025def s22imm : Operand<i32> {
26 let PrintMethod = "printS22ImmOperand";
Duraid Madina9b9d45f2005-03-17 18:17:03 +000027}
28def u64imm : Operand<i64> {
29 let PrintMethod = "printU64ImmOperand";
30}
Duraid Madina1ce0c012005-04-14 10:08:01 +000031def s64imm : Operand<i64> {
32 let PrintMethod = "printS64ImmOperand";
33}
Duraid Madina9b9d45f2005-03-17 18:17:03 +000034
35// the asmprinter needs to know about calls
36let PrintMethod = "printCallOperand" in
37 def calltarget : Operand<i64>;
38
39def PHI : PseudoInstIA64<(ops), "PHI">;
40def IDEF : PseudoInstIA64<(ops), "// IDEF">;
Duraid Madina09c61b92005-04-04 04:50:57 +000041def IUSE : PseudoInstIA64<(ops), "// IUSE">;
Duraid Madina9b9d45f2005-03-17 18:17:03 +000042def WTF : PseudoInstIA64<(ops), "que??">;
43def ADJUSTCALLSTACKUP : PseudoInstIA64<(ops), "// ADJUSTCALLSTACKUP">;
44def ADJUSTCALLSTACKDOWN : PseudoInstIA64<(ops), "// ADJUSTCALLSTACKDOWN">;
45def PSEUDO_ALLOC : PseudoInstIA64<(ops), "// PSEUDO_ALLOC">;
46
47def ALLOC : AForm<0x03, 0x0b,
48 (ops GR:$dst, i8imm:$inputs, i8imm:$locals, i8imm:$outputs, i8imm:$rotating),
49 "alloc $dst = ar.pfs,$inputs,$locals,$outputs,$rotating;;">;
50
51def MOV : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src), "mov $dst = $src;;">;
52def PMOV : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src, PR:$qp),
53 "($qp) mov $dst = $src;;">;
54
55def SPILL_ALL_PREDICATES_TO_GR : AForm<0x03, 0x0b, (ops GR:$dst),
56 "mov $dst = pr;;">;
57def FILL_ALL_PREDICATES_FROM_GR : AForm<0x03, 0x0b, (ops GR:$src),
58 "mov pr = $src;;">;
59
60let isTwoAddress = 1 in {
61 def CMOV : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src2, GR:$src, PR:$qp),
62 "($qp) mov $dst = $src;;">;
63}
64
Duraid Madina291e1262005-03-31 07:32:32 +000065def PFMOV : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src, PR:$qp),
66 "($qp) mov $dst = $src;;">;
67
68let isTwoAddress = 1 in {
69 def CFMOV : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src2, FP:$src, PR:$qp),
70 "($qp) mov $dst = $src;;">;
71}
72
Duraid Madina9b9d45f2005-03-17 18:17:03 +000073let isTwoAddress = 1 in {
74 def TCMPNE : AForm<0x03, 0x0b,
75 (ops PR:$dst, PR:$src2, GR:$src3, GR:$src4),
76 "cmp.ne $dst, p0 = $src3, $src4;;">;
77
78 def TPCMPEQOR : AForm<0x03, 0x0b,
79 (ops PR:$dst, PR:$src2, GR:$src3, GR:$src4, PR:$qp),
80 "($qp) cmp.eq.or $dst, p0 = $src3, $src4;;">;
81
82 def TPCMPNE : AForm<0x03, 0x0b,
83 (ops PR:$dst, PR:$src2, GR:$src3, GR:$src4, PR:$qp),
84 "($qp) cmp.ne $dst, p0 = $src3, $src4;;">;
85
86 def TPCMPEQ : AForm<0x03, 0x0b,
87 (ops PR:$dst, PR:$src2, GR:$src3, GR:$src4, PR:$qp),
88 "($qp) cmp.eq $dst, p0 = $src3, $src4;;">;
89}
90
Duraid Madina5ef2ec92005-04-11 05:55:56 +000091def MOVSIMM14 : AForm<0x03, 0x0b, (ops GR:$dst, s14imm:$imm),
Duraid Madina9b9d45f2005-03-17 18:17:03 +000092 "mov $dst = $imm;;">;
Duraid Madina5ef2ec92005-04-11 05:55:56 +000093def MOVSIMM22 : AForm<0x03, 0x0b, (ops GR:$dst, s22imm:$imm),
94 "mov $dst = $imm;;">;
Duraid Madina1ce0c012005-04-14 10:08:01 +000095def MOVLIMM64 : AForm<0x03, 0x0b, (ops GR:$dst, s64imm:$imm),
Duraid Madina9b9d45f2005-03-17 18:17:03 +000096 "movl $dst = $imm;;">;
97
98def AND : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2),
99 "and $dst = $src1, $src2;;">;
100def OR : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2),
101 "or $dst = $src1, $src2;;">;
102def XOR : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2),
103 "xor $dst = $src1, $src2;;">;
104def SHL : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2),
105 "shl $dst = $src1, $src2;;">;
Duraid Madina5ef2ec92005-04-11 05:55:56 +0000106def SHLI : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, u6imm:$imm),
107 "shl $dst = $src1, $imm;;">;
Duraid Madina9b9d45f2005-03-17 18:17:03 +0000108def SHRU : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2),
109 "shr.u $dst = $src1, $src2;;">;
Duraid Madina5ef2ec92005-04-11 05:55:56 +0000110def SHRUI : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, u6imm:$imm),
Duraid Madina18c0c6b2005-04-07 12:32:24 +0000111 "shr.u $dst = $src1, $imm;;">;
Duraid Madina9b9d45f2005-03-17 18:17:03 +0000112def SHRS : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2),
113 "shr $dst = $src1, $src2;;">;
Duraid Madina5ef2ec92005-04-11 05:55:56 +0000114def SHRSI : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, u6imm:$imm),
Duraid Madina18c0c6b2005-04-07 12:32:24 +0000115 "shr $dst = $src1, $imm;;">;
Duraid Madina9b9d45f2005-03-17 18:17:03 +0000116
Duraid Madinaed095022005-04-13 06:12:04 +0000117def SHLADD : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, u6imm:$imm, GR:$src2),
118 "shladd $dst = $src1, $imm, $src2;;">;
119
Duraid Madina6dcceb52005-04-08 10:01:48 +0000120def EXTRU : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, u6imm:$imm1, u6imm:$imm2),
121 "extr.u $dst = $src1, $imm1, $imm2;;">;
122
Duraid Madina9b9d45f2005-03-17 18:17:03 +0000123def DEPZ : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, u6imm:$imm1, u6imm:$imm2), "dep.z $dst = $src1, $imm1, $imm2;;">;
124
125def SXT1 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src), "sxt1 $dst = $src;;">;
126def ZXT1 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src), "zxt1 $dst = $src;;">;
127def SXT2 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src), "sxt2 $dst = $src;;">;
128def ZXT2 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src), "zxt2 $dst = $src;;">;
129def SXT4 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src), "sxt4 $dst = $src;;">;
130def ZXT4 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src), "zxt4 $dst = $src;;">;
131
132// the following are all a bit unfortunate: we throw away the complement
133// of the compare!
134def CMPEQ : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2),
135 "cmp.eq $dst, p0 = $src1, $src2;;">;
136def CMPGT : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2),
137 "cmp.gt $dst, p0 = $src1, $src2;;">;
138def CMPGE : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2),
139 "cmp.ge $dst, p0 = $src1, $src2;;">;
140def CMPLT : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2),
141 "cmp.lt $dst, p0 = $src1, $src2;;">;
142def CMPLE : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2),
143 "cmp.le $dst, p0 = $src1, $src2;;">;
144def CMPNE : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2),
145 "cmp.ne $dst, p0 = $src1, $src2;;">;
146def CMPLTU : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2),
147 "cmp.ltu $dst, p0 = $src1, $src2;;">;
148def CMPGTU : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2),
149 "cmp.gtu $dst, p0 = $src1, $src2;;">;
150def CMPLEU : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2),
151 "cmp.leu $dst, p0 = $src1, $src2;;">;
152def CMPGEU : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2),
153 "cmp.geu $dst, p0 = $src1, $src2;;">;
154
155// and we do the whole thing again for FP compares!
156def FCMPEQ : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2),
157 "fcmp.eq $dst, p0 = $src1, $src2;;">;
158def FCMPGT : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2),
159 "fcmp.gt $dst, p0 = $src1, $src2;;">;
160def FCMPGE : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2),
161 "fcmp.ge $dst, p0 = $src1, $src2;;">;
162def FCMPLT : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2),
163 "fcmp.lt $dst, p0 = $src1, $src2;;">;
164def FCMPLE : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2),
165 "fcmp.le $dst, p0 = $src1, $src2;;">;
166def FCMPNE : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2),
167 "fcmp.neq $dst, p0 = $src1, $src2;;">;
168def FCMPLTU : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2),
169 "fcmp.ltu $dst, p0 = $src1, $src2;;">;
170def FCMPGTU : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2),
171 "fcmp.gtu $dst, p0 = $src1, $src2;;">;
172def FCMPLEU : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2),
173 "fcmp.leu $dst, p0 = $src1, $src2;;">;
174def FCMPGEU : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2),
175 "fcmp.geu $dst, p0 = $src1, $src2;;">;
176
177def PCMPEQOR : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2, PR:$qp),
178 "($qp) cmp.eq.or $dst, p0 = $src1, $src2;;">;
179def PCMPEQUNC : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2, PR:$qp),
180 "($qp) cmp.eq.unc $dst, p0 = $src1, $src2;;">;
181def PCMPNE : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2, PR:$qp),
182 "($qp) cmp.ne $dst, p0 = $src1, $src2;;">;
183
184// two destinations!
185def BCMPEQ : AForm<0x03, 0x0b, (ops PR:$dst1, PR:$dst2, GR:$src1, GR:$src2),
186 "cmp.eq $dst1, dst2 = $src1, $src2;;">;
187
188def ADD : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2),
189 "add $dst = $src1, $src2;;">;
Duraid Madina18c0c6b2005-04-07 12:32:24 +0000190def ADDIMM14 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, s14imm:$imm),
191 "adds $dst = $imm, $src1;;">;
Duraid Madina9b9d45f2005-03-17 18:17:03 +0000192
Duraid Madina5ef2ec92005-04-11 05:55:56 +0000193def ADDIMM22 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, s22imm:$imm),
Duraid Madina9b9d45f2005-03-17 18:17:03 +0000194 "add $dst = $imm, $src1;;">;
Duraid Madina5ef2ec92005-04-11 05:55:56 +0000195def CADDIMM22 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, s22imm:$imm, PR:$qp),
Duraid Madina9b9d45f2005-03-17 18:17:03 +0000196 "($qp) add $dst = $imm, $src1;;">;
197
198let isTwoAddress = 1 in {
199def TPCADDIMM22 : AForm<0x03, 0x0b,
Duraid Madina5ef2ec92005-04-11 05:55:56 +0000200 (ops GR:$dst, GR:$src1, s22imm:$imm, PR:$qp),
Duraid Madina9b9d45f2005-03-17 18:17:03 +0000201 "($qp) add $dst = $imm, $dst;;">;
202def TPCMPIMM8NE : AForm<0x03, 0x0b,
Duraid Madina5ef2ec92005-04-11 05:55:56 +0000203 (ops PR:$dst, PR:$src1, s22imm:$imm, GR:$src2, PR:$qp),
Duraid Madina9b9d45f2005-03-17 18:17:03 +0000204 "($qp) cmp.ne $dst , p0 = $imm, $src2;;">;
205}
206
207def SUB : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2),
208 "sub $dst = $src1, $src2;;">;
Duraid Madina18c0c6b2005-04-07 12:32:24 +0000209def SUBIMM8 : AForm<0x03, 0x0b, (ops GR:$dst, s8imm:$imm, GR:$src2),
210 "sub $dst = $imm, $src2;;">;
Duraid Madina9b9d45f2005-03-17 18:17:03 +0000211
212def ST1 : AForm<0x03, 0x0b, (ops GR:$dstPtr, GR:$value),
213 "st1 [$dstPtr] = $value;;">;
214def ST2 : AForm<0x03, 0x0b, (ops GR:$dstPtr, GR:$value),
215 "st2 [$dstPtr] = $value;;">;
216def ST4 : AForm<0x03, 0x0b, (ops GR:$dstPtr, GR:$value),
217 "st4 [$dstPtr] = $value;;">;
218def ST8 : AForm<0x03, 0x0b, (ops GR:$dstPtr, GR:$value),
219 "st8 [$dstPtr] = $value;;">;
220
221def LD1 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$srcPtr),
222 "ld1 $dst = [$srcPtr];;">;
223def LD2 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$srcPtr),
224 "ld2 $dst = [$srcPtr];;">;
225def LD4 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$srcPtr),
226 "ld4 $dst = [$srcPtr];;">;
227def LD8 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$srcPtr),
228 "ld8 $dst = [$srcPtr];;">;
229
230// some FP stuff:
231def FADD : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2),
232 "fadd $dst = $src1, $src2;;">;
233def FADDS: AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2),
234 "fadd.s $dst = $src1, $src2;;">;
235def FSUB : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2),
236 "fsub $dst = $src1, $src2;;">;
237def FMPY : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2),
238 "fmpy $dst = $src1, $src2;;">;
239def FMOV : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
240 "mov $dst = $src;;">; // XXX: there _is_ no fmov
241def FMA : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2, FP:$src3),
242 "fma $dst = $src1, $src2, $src3;;">;
Duraid Madinab366a022005-04-06 09:54:09 +0000243def FMS : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2, FP:$src3),
244 "fms $dst = $src1, $src2, $src3;;">;
Duraid Madina9b9d45f2005-03-17 18:17:03 +0000245def FNMA : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2, FP:$src3),
246 "fnma $dst = $src1, $src2, $src3;;">;
Duraid Madinaa7ee8b82005-04-02 05:18:38 +0000247def FABS : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
248 "fabs $dst = $src;;">;
249def FNEG : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
250 "fneg $dst = $src;;">;
Duraid Madina5c156b72005-04-02 10:06:27 +0000251def FNEGABS : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
252 "fnegabs $dst = $src;;">;
Duraid Madina9b9d45f2005-03-17 18:17:03 +0000253
254def CFMAS1 : AForm<0x03, 0x0b,
255 (ops FP:$dst, FP:$src1, FP:$src2, FP:$src3, PR:$qp),
256 "($qp) fma.s1 $dst = $src1, $src2, $src3;;">;
257def CFNMAS1 : AForm<0x03, 0x0b,
258 (ops FP:$dst, FP:$src1, FP:$src2, FP:$src3, PR:$qp),
259 "($qp) fnma.s1 $dst = $src1, $src2, $src3;;">;
260
Duraid Madina6dcceb52005-04-08 10:01:48 +0000261def FRCPAS1 : AForm<0x03, 0x0b, (ops FP:$dstFR, PR:$dstPR, FP:$src1, FP:$src2),
262 "frcpa.s1 $dstFR, $dstPR = $src1, $src2;;">;
Duraid Madina9b9d45f2005-03-17 18:17:03 +0000263
264def XMAL : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2, FP:$src3),
265 "xma.l $dst = $src1, $src2, $src3;;">;
266
267def FCVTXF : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
268 "fcvt.xf $dst = $src;;">;
269def FCVTXUF : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
270 "fcvt.xuf $dst = $src;;">;
271def FCVTXUFS1 : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
272 "fcvt.xuf.s1 $dst = $src;;">;
273def FCVTFX : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
274 "fcvt.fx $dst = $src;;">;
275def FCVTFXU : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
276 "fcvt.fxu $dst = $src;;">;
277
278def FCVTFXTRUNC : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
279 "fcvt.fx.trunc $dst = $src;;">;
280def FCVTFXUTRUNC : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
281 "fcvt.fxu.trunc $dst = $src;;">;
282
283def FCVTFXTRUNCS1 : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
284 "fcvt.fx.trunc.s1 $dst = $src;;">;
285def FCVTFXUTRUNCS1 : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
286 "fcvt.fxu.trunc.s1 $dst = $src;;">;
287
288def FNORMD : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src),
289 "fnorm.d $dst = $src;;">;
290
291def GETFD : AForm<0x03, 0x0b, (ops GR:$dst, FP:$src),
292 "getf.d $dst = $src;;">;
293def SETFD : AForm<0x03, 0x0b, (ops FP:$dst, GR:$src),
294 "setf.d $dst = $src;;">;
295
296def GETFSIG : AForm<0x03, 0x0b, (ops GR:$dst, FP:$src),
297 "getf.sig $dst = $src;;">;
298def SETFSIG : AForm<0x03, 0x0b, (ops FP:$dst, GR:$src),
299 "setf.sig $dst = $src;;">;
300
301def LDF4 : AForm<0x03, 0x0b, (ops FP:$dst, GR:$srcPtr),
302 "ldfs $dst = [$srcPtr];;">;
303def LDF8 : AForm<0x03, 0x0b, (ops FP:$dst, GR:$srcPtr),
304 "ldfd $dst = [$srcPtr];;">;
305
306def STF4 : AForm<0x03, 0x0b, (ops GR:$dstPtr, FP:$value),
307 "stfs [$dstPtr] = $value;;">;
308def STF8 : AForm<0x03, 0x0b, (ops GR:$dstPtr, FP:$value),
309 "stfd [$dstPtr] = $value;;">;
310
311let isTerminator = 1, isBranch = 1 in {
312 def BRLCOND_NOTCALL : RawForm<0x03, 0xb0, (ops PR:$qp, i64imm:$dst),
313 "($qp) brl.cond.sptk $dst;;">;
314 def BRCOND_NOTCALL : RawForm<0x03, 0xb0, (ops PR:$qp, GR:$dst),
315 "($qp) br.cond.sptk $dst;;">;
316}
317
318let isCall = 1, isTerminator = 1, isBranch = 1,
Chris Lattnerea6f7702005-04-12 15:12:19 +0000319 Uses = [out0,out1,out2,out3,out4,out5,out6,out7],
Duraid Madina9b9d45f2005-03-17 18:17:03 +0000320// all calls clobber non-callee-saved registers, and for now, they are these:
321 Defs = [r2,r3,r8,r9,r10,r11,r14,r15,r16,r17,r18,r19,r20,r21,r22,r23,r24,
322 r25,r26,r27,r28,r29,r30,r31,
323 p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,
324 F6,F7,F8,F9,F10,F11,F12,F13,F14,F15,
325 F32,F33,F34,F35,F36,F37,F38,F39,F40,F41,F42,F43,F44,F45,F46,F47,F48,F49,
326 F50,F51,F52,F53,F54,F55,F56,
327 F57,F58,F59,F60,F61,F62,F63,F64,F65,F66,F67,F68,F69,F70,F71,F72,F73,F74,
328 F75,F76,F77,F78,F79,F80,F81,
329 F82,F83,F84,F85,F86,F87,F88,F89,F90,F91,F92,F93,F94,F95,F96,F97,F98,F99,
330 F100,F101,F102,F103,F104,F105,
331 F106,F107,F108,F109,F110,F111,F112,F113,F114,F115,F116,F117,F118,F119,
332 F120,F121,F122,F123,F124,F125,F126,F127,
333 out0,out1,out2,out3,out4,out5,out6,out7] in {
334 def BRCALL : RawForm<0x03, 0xb0, (ops calltarget:$dst),
335 "br.call.sptk rp = $dst;;">; // FIXME: teach llvm about branch regs?
336 def BRLCOND_CALL : RawForm<0x03, 0xb0, (ops PR:$qp, i64imm:$dst),
337 "($qp) brl.cond.call.sptk $dst;;">;
338 def BRCOND_CALL : RawForm<0x03, 0xb0, (ops PR:$qp, GR:$dst),
339 "($qp) br.cond.call.sptk $dst;;">;
340}
341
342let isTerminator = 1, isReturn = 1 in
343 def RET : RawForm<0x03, 0xb0, (ops), "br.ret.sptk.many rp;;">; // return
344
345