Duraid Madina | 9b9d45f | 2005-03-17 18:17:03 +0000 | [diff] [blame] | 1 | //===- 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 | |
| 16 | include "IA64InstrFormats.td" |
| 17 | |
| 18 | def u6imm : Operand<i8>; |
| 19 | def s16imm : Operand<i16>; |
| 20 | def s21imm : Operand<i32> { |
| 21 | let PrintMethod = "printS21ImmOperand"; |
| 22 | } |
| 23 | def u32imm : Operand<i32> { |
| 24 | let PrintMethod = "printU32ImmOperand"; |
| 25 | } |
| 26 | def s32imm : Operand<i32> { |
| 27 | let PrintMethod = "printS32ImmOperand"; |
| 28 | } |
| 29 | def u64imm : Operand<i64> { |
| 30 | let PrintMethod = "printU64ImmOperand"; |
| 31 | } |
| 32 | |
| 33 | // the asmprinter needs to know about calls |
| 34 | let PrintMethod = "printCallOperand" in |
| 35 | def calltarget : Operand<i64>; |
| 36 | |
| 37 | def PHI : PseudoInstIA64<(ops), "PHI">; |
| 38 | def IDEF : PseudoInstIA64<(ops), "// IDEF">; |
Duraid Madina | 09c61b9 | 2005-04-04 04:50:57 +0000 | [diff] [blame] | 39 | def IUSE : PseudoInstIA64<(ops), "// IUSE">; |
Duraid Madina | 9b9d45f | 2005-03-17 18:17:03 +0000 | [diff] [blame] | 40 | def WTF : PseudoInstIA64<(ops), "que??">; |
| 41 | def ADJUSTCALLSTACKUP : PseudoInstIA64<(ops), "// ADJUSTCALLSTACKUP">; |
| 42 | def ADJUSTCALLSTACKDOWN : PseudoInstIA64<(ops), "// ADJUSTCALLSTACKDOWN">; |
| 43 | def PSEUDO_ALLOC : PseudoInstIA64<(ops), "// PSEUDO_ALLOC">; |
| 44 | |
| 45 | def ALLOC : AForm<0x03, 0x0b, |
| 46 | (ops GR:$dst, i8imm:$inputs, i8imm:$locals, i8imm:$outputs, i8imm:$rotating), |
| 47 | "alloc $dst = ar.pfs,$inputs,$locals,$outputs,$rotating;;">; |
| 48 | |
| 49 | def MOV : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src), "mov $dst = $src;;">; |
| 50 | def PMOV : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src, PR:$qp), |
| 51 | "($qp) mov $dst = $src;;">; |
| 52 | |
| 53 | def SPILL_ALL_PREDICATES_TO_GR : AForm<0x03, 0x0b, (ops GR:$dst), |
| 54 | "mov $dst = pr;;">; |
| 55 | def FILL_ALL_PREDICATES_FROM_GR : AForm<0x03, 0x0b, (ops GR:$src), |
| 56 | "mov pr = $src;;">; |
| 57 | |
| 58 | let isTwoAddress = 1 in { |
| 59 | def CMOV : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src2, GR:$src, PR:$qp), |
| 60 | "($qp) mov $dst = $src;;">; |
| 61 | } |
| 62 | |
Duraid Madina | 291e126 | 2005-03-31 07:32:32 +0000 | [diff] [blame] | 63 | def PFMOV : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src, PR:$qp), |
| 64 | "($qp) mov $dst = $src;;">; |
| 65 | |
| 66 | let isTwoAddress = 1 in { |
| 67 | def CFMOV : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src2, FP:$src, PR:$qp), |
| 68 | "($qp) mov $dst = $src;;">; |
| 69 | } |
| 70 | |
Duraid Madina | 9b9d45f | 2005-03-17 18:17:03 +0000 | [diff] [blame] | 71 | let isTwoAddress = 1 in { |
| 72 | def TCMPNE : AForm<0x03, 0x0b, |
| 73 | (ops PR:$dst, PR:$src2, GR:$src3, GR:$src4), |
| 74 | "cmp.ne $dst, p0 = $src3, $src4;;">; |
| 75 | |
| 76 | def TPCMPEQOR : AForm<0x03, 0x0b, |
| 77 | (ops PR:$dst, PR:$src2, GR:$src3, GR:$src4, PR:$qp), |
| 78 | "($qp) cmp.eq.or $dst, p0 = $src3, $src4;;">; |
| 79 | |
| 80 | def TPCMPNE : AForm<0x03, 0x0b, |
| 81 | (ops PR:$dst, PR:$src2, GR:$src3, GR:$src4, PR:$qp), |
| 82 | "($qp) cmp.ne $dst, p0 = $src3, $src4;;">; |
| 83 | |
| 84 | def TPCMPEQ : AForm<0x03, 0x0b, |
| 85 | (ops PR:$dst, PR:$src2, GR:$src3, GR:$src4, PR:$qp), |
| 86 | "($qp) cmp.eq $dst, p0 = $src3, $src4;;">; |
| 87 | } |
| 88 | |
| 89 | def MOVI32 : AForm<0x03, 0x0b, (ops GR:$dst, u32imm:$imm), |
| 90 | "mov $dst = $imm;;">; |
| 91 | def MOVLI32 : AForm<0x03, 0x0b, (ops GR:$dst, u32imm:$imm), |
| 92 | "movl $dst = $imm;;">; |
| 93 | def MOVLSI32 : AForm<0x03, 0x0b, (ops GR:$dst, s32imm:$imm), |
| 94 | "movl $dst = $imm;;">; |
| 95 | def MOVLI64 : AForm<0x03, 0x0b, (ops GR:$dst, u64imm:$imm), |
| 96 | "movl $dst = $imm;;">; |
| 97 | |
| 98 | def AND : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2), |
| 99 | "and $dst = $src1, $src2;;">; |
| 100 | def OR : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2), |
| 101 | "or $dst = $src1, $src2;;">; |
| 102 | def XOR : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2), |
| 103 | "xor $dst = $src1, $src2;;">; |
| 104 | def SHL : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2), |
| 105 | "shl $dst = $src1, $src2;;">; |
| 106 | def SHLI : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, s21imm:$imm), |
| 107 | "shl $dst = $src1, $imm;;">; // FIXME: 6 immediate bits, not 21 |
| 108 | def SHRU : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2), |
| 109 | "shr.u $dst = $src1, $src2;;">; |
| 110 | def SHRS : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2), |
| 111 | "shr $dst = $src1, $src2;;">; |
| 112 | |
| 113 | def DEPZ : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, u6imm:$imm1, u6imm:$imm2), "dep.z $dst = $src1, $imm1, $imm2;;">; |
| 114 | |
| 115 | def SXT1 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src), "sxt1 $dst = $src;;">; |
| 116 | def ZXT1 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src), "zxt1 $dst = $src;;">; |
| 117 | def SXT2 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src), "sxt2 $dst = $src;;">; |
| 118 | def ZXT2 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src), "zxt2 $dst = $src;;">; |
| 119 | def SXT4 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src), "sxt4 $dst = $src;;">; |
| 120 | def ZXT4 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src), "zxt4 $dst = $src;;">; |
| 121 | |
| 122 | // the following are all a bit unfortunate: we throw away the complement |
| 123 | // of the compare! |
| 124 | def CMPEQ : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2), |
| 125 | "cmp.eq $dst, p0 = $src1, $src2;;">; |
| 126 | def CMPGT : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2), |
| 127 | "cmp.gt $dst, p0 = $src1, $src2;;">; |
| 128 | def CMPGE : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2), |
| 129 | "cmp.ge $dst, p0 = $src1, $src2;;">; |
| 130 | def CMPLT : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2), |
| 131 | "cmp.lt $dst, p0 = $src1, $src2;;">; |
| 132 | def CMPLE : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2), |
| 133 | "cmp.le $dst, p0 = $src1, $src2;;">; |
| 134 | def CMPNE : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2), |
| 135 | "cmp.ne $dst, p0 = $src1, $src2;;">; |
| 136 | def CMPLTU : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2), |
| 137 | "cmp.ltu $dst, p0 = $src1, $src2;;">; |
| 138 | def CMPGTU : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2), |
| 139 | "cmp.gtu $dst, p0 = $src1, $src2;;">; |
| 140 | def CMPLEU : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2), |
| 141 | "cmp.leu $dst, p0 = $src1, $src2;;">; |
| 142 | def CMPGEU : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2), |
| 143 | "cmp.geu $dst, p0 = $src1, $src2;;">; |
| 144 | |
| 145 | // and we do the whole thing again for FP compares! |
| 146 | def FCMPEQ : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2), |
| 147 | "fcmp.eq $dst, p0 = $src1, $src2;;">; |
| 148 | def FCMPGT : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2), |
| 149 | "fcmp.gt $dst, p0 = $src1, $src2;;">; |
| 150 | def FCMPGE : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2), |
| 151 | "fcmp.ge $dst, p0 = $src1, $src2;;">; |
| 152 | def FCMPLT : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2), |
| 153 | "fcmp.lt $dst, p0 = $src1, $src2;;">; |
| 154 | def FCMPLE : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2), |
| 155 | "fcmp.le $dst, p0 = $src1, $src2;;">; |
| 156 | def FCMPNE : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2), |
| 157 | "fcmp.neq $dst, p0 = $src1, $src2;;">; |
| 158 | def FCMPLTU : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2), |
| 159 | "fcmp.ltu $dst, p0 = $src1, $src2;;">; |
| 160 | def FCMPGTU : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2), |
| 161 | "fcmp.gtu $dst, p0 = $src1, $src2;;">; |
| 162 | def FCMPLEU : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2), |
| 163 | "fcmp.leu $dst, p0 = $src1, $src2;;">; |
| 164 | def FCMPGEU : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2), |
| 165 | "fcmp.geu $dst, p0 = $src1, $src2;;">; |
| 166 | |
| 167 | def PCMPEQOR : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2, PR:$qp), |
| 168 | "($qp) cmp.eq.or $dst, p0 = $src1, $src2;;">; |
| 169 | def PCMPEQUNC : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2, PR:$qp), |
| 170 | "($qp) cmp.eq.unc $dst, p0 = $src1, $src2;;">; |
| 171 | def PCMPNE : AForm<0x03, 0x0b, (ops PR:$dst, GR:$src1, GR:$src2, PR:$qp), |
| 172 | "($qp) cmp.ne $dst, p0 = $src1, $src2;;">; |
| 173 | |
| 174 | // two destinations! |
| 175 | def BCMPEQ : AForm<0x03, 0x0b, (ops PR:$dst1, PR:$dst2, GR:$src1, GR:$src2), |
| 176 | "cmp.eq $dst1, dst2 = $src1, $src2;;">; |
| 177 | |
| 178 | def ADD : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2), |
| 179 | "add $dst = $src1, $src2;;">; |
| 180 | |
| 181 | def ADDIMM22 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, s21imm:$imm), |
| 182 | "add $dst = $imm, $src1;;">; |
| 183 | def CADDIMM22 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, s21imm:$imm, PR:$qp), |
| 184 | "($qp) add $dst = $imm, $src1;;">; |
| 185 | |
| 186 | let isTwoAddress = 1 in { |
| 187 | def TPCADDIMM22 : AForm<0x03, 0x0b, |
| 188 | (ops GR:$dst, GR:$src1, s21imm:$imm, PR:$qp), |
| 189 | "($qp) add $dst = $imm, $dst;;">; |
| 190 | def TPCMPIMM8NE : AForm<0x03, 0x0b, |
| 191 | (ops PR:$dst, PR:$src1, s21imm:$imm, GR:$src2, PR:$qp), |
| 192 | "($qp) cmp.ne $dst , p0 = $imm, $src2;;">; |
| 193 | } |
| 194 | |
| 195 | def SUB : AForm<0x03, 0x0b, (ops GR:$dst, GR:$src1, GR:$src2), |
| 196 | "sub $dst = $src1, $src2;;">; |
| 197 | |
| 198 | def ST1 : AForm<0x03, 0x0b, (ops GR:$dstPtr, GR:$value), |
| 199 | "st1 [$dstPtr] = $value;;">; |
| 200 | def ST2 : AForm<0x03, 0x0b, (ops GR:$dstPtr, GR:$value), |
| 201 | "st2 [$dstPtr] = $value;;">; |
| 202 | def ST4 : AForm<0x03, 0x0b, (ops GR:$dstPtr, GR:$value), |
| 203 | "st4 [$dstPtr] = $value;;">; |
| 204 | def ST8 : AForm<0x03, 0x0b, (ops GR:$dstPtr, GR:$value), |
| 205 | "st8 [$dstPtr] = $value;;">; |
| 206 | |
| 207 | def LD1 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$srcPtr), |
| 208 | "ld1 $dst = [$srcPtr];;">; |
| 209 | def LD2 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$srcPtr), |
| 210 | "ld2 $dst = [$srcPtr];;">; |
| 211 | def LD4 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$srcPtr), |
| 212 | "ld4 $dst = [$srcPtr];;">; |
| 213 | def LD8 : AForm<0x03, 0x0b, (ops GR:$dst, GR:$srcPtr), |
| 214 | "ld8 $dst = [$srcPtr];;">; |
| 215 | |
| 216 | // some FP stuff: |
| 217 | def FADD : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2), |
| 218 | "fadd $dst = $src1, $src2;;">; |
| 219 | def FADDS: AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2), |
| 220 | "fadd.s $dst = $src1, $src2;;">; |
| 221 | def FSUB : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2), |
| 222 | "fsub $dst = $src1, $src2;;">; |
| 223 | def FMPY : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2), |
| 224 | "fmpy $dst = $src1, $src2;;">; |
| 225 | def FMOV : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src), |
| 226 | "mov $dst = $src;;">; // XXX: there _is_ no fmov |
| 227 | def FMA : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2, FP:$src3), |
| 228 | "fma $dst = $src1, $src2, $src3;;">; |
Duraid Madina | b366a02 | 2005-04-06 09:54:09 +0000 | [diff] [blame^] | 229 | def FMS : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2, FP:$src3), |
| 230 | "fms $dst = $src1, $src2, $src3;;">; |
Duraid Madina | 9b9d45f | 2005-03-17 18:17:03 +0000 | [diff] [blame] | 231 | def FNMA : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2, FP:$src3), |
| 232 | "fnma $dst = $src1, $src2, $src3;;">; |
Duraid Madina | a7ee8b8 | 2005-04-02 05:18:38 +0000 | [diff] [blame] | 233 | def FABS : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src), |
| 234 | "fabs $dst = $src;;">; |
| 235 | def FNEG : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src), |
| 236 | "fneg $dst = $src;;">; |
Duraid Madina | 5c156b7 | 2005-04-02 10:06:27 +0000 | [diff] [blame] | 237 | def FNEGABS : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src), |
| 238 | "fnegabs $dst = $src;;">; |
Duraid Madina | 9b9d45f | 2005-03-17 18:17:03 +0000 | [diff] [blame] | 239 | |
| 240 | def CFMAS1 : AForm<0x03, 0x0b, |
| 241 | (ops FP:$dst, FP:$src1, FP:$src2, FP:$src3, PR:$qp), |
| 242 | "($qp) fma.s1 $dst = $src1, $src2, $src3;;">; |
| 243 | def CFNMAS1 : AForm<0x03, 0x0b, |
| 244 | (ops FP:$dst, FP:$src1, FP:$src2, FP:$src3, PR:$qp), |
| 245 | "($qp) fnma.s1 $dst = $src1, $src2, $src3;;">; |
| 246 | |
| 247 | // FIXME: we 'explode' FRCPA (which should write two registers) into two |
| 248 | // operations that write one each. this is a waste, and is also destroying |
| 249 | // f127. not cool. |
| 250 | def FRCPAS1FLOAT : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2), |
| 251 | "frcpa.s1 $dst , p0 = $src1, $src2;;">; |
| 252 | // XXX: this _will_ break things: (f127) |
| 253 | def FRCPAS1PREDICATE : AForm<0x03, 0x0b, (ops PR:$dst, FP:$src1, FP:$src2), |
| 254 | "frcpa.s1 f127 , $dst = $src1, $src2;; // XXX FIXME!!!!">; |
| 255 | |
| 256 | def XMAL : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src1, FP:$src2, FP:$src3), |
| 257 | "xma.l $dst = $src1, $src2, $src3;;">; |
| 258 | |
| 259 | def FCVTXF : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src), |
| 260 | "fcvt.xf $dst = $src;;">; |
| 261 | def FCVTXUF : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src), |
| 262 | "fcvt.xuf $dst = $src;;">; |
| 263 | def FCVTXUFS1 : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src), |
| 264 | "fcvt.xuf.s1 $dst = $src;;">; |
| 265 | def FCVTFX : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src), |
| 266 | "fcvt.fx $dst = $src;;">; |
| 267 | def FCVTFXU : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src), |
| 268 | "fcvt.fxu $dst = $src;;">; |
| 269 | |
| 270 | def FCVTFXTRUNC : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src), |
| 271 | "fcvt.fx.trunc $dst = $src;;">; |
| 272 | def FCVTFXUTRUNC : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src), |
| 273 | "fcvt.fxu.trunc $dst = $src;;">; |
| 274 | |
| 275 | def FCVTFXTRUNCS1 : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src), |
| 276 | "fcvt.fx.trunc.s1 $dst = $src;;">; |
| 277 | def FCVTFXUTRUNCS1 : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src), |
| 278 | "fcvt.fxu.trunc.s1 $dst = $src;;">; |
| 279 | |
| 280 | def FNORMD : AForm<0x03, 0x0b, (ops FP:$dst, FP:$src), |
| 281 | "fnorm.d $dst = $src;;">; |
| 282 | |
| 283 | def GETFD : AForm<0x03, 0x0b, (ops GR:$dst, FP:$src), |
| 284 | "getf.d $dst = $src;;">; |
| 285 | def SETFD : AForm<0x03, 0x0b, (ops FP:$dst, GR:$src), |
| 286 | "setf.d $dst = $src;;">; |
| 287 | |
| 288 | def GETFSIG : AForm<0x03, 0x0b, (ops GR:$dst, FP:$src), |
| 289 | "getf.sig $dst = $src;;">; |
| 290 | def SETFSIG : AForm<0x03, 0x0b, (ops FP:$dst, GR:$src), |
| 291 | "setf.sig $dst = $src;;">; |
| 292 | |
| 293 | def LDF4 : AForm<0x03, 0x0b, (ops FP:$dst, GR:$srcPtr), |
| 294 | "ldfs $dst = [$srcPtr];;">; |
| 295 | def LDF8 : AForm<0x03, 0x0b, (ops FP:$dst, GR:$srcPtr), |
| 296 | "ldfd $dst = [$srcPtr];;">; |
| 297 | |
| 298 | def STF4 : AForm<0x03, 0x0b, (ops GR:$dstPtr, FP:$value), |
| 299 | "stfs [$dstPtr] = $value;;">; |
| 300 | def STF8 : AForm<0x03, 0x0b, (ops GR:$dstPtr, FP:$value), |
| 301 | "stfd [$dstPtr] = $value;;">; |
| 302 | |
| 303 | let isTerminator = 1, isBranch = 1 in { |
| 304 | def BRLCOND_NOTCALL : RawForm<0x03, 0xb0, (ops PR:$qp, i64imm:$dst), |
| 305 | "($qp) brl.cond.sptk $dst;;">; |
| 306 | def BRCOND_NOTCALL : RawForm<0x03, 0xb0, (ops PR:$qp, GR:$dst), |
| 307 | "($qp) br.cond.sptk $dst;;">; |
| 308 | } |
| 309 | |
| 310 | let isCall = 1, isTerminator = 1, isBranch = 1, |
| 311 | // all calls clobber non-callee-saved registers, and for now, they are these: |
| 312 | Defs = [r2,r3,r8,r9,r10,r11,r14,r15,r16,r17,r18,r19,r20,r21,r22,r23,r24, |
| 313 | r25,r26,r27,r28,r29,r30,r31, |
| 314 | p6,p7,p8,p9,p10,p11,p12,p13,p14,p15, |
| 315 | F6,F7,F8,F9,F10,F11,F12,F13,F14,F15, |
| 316 | F32,F33,F34,F35,F36,F37,F38,F39,F40,F41,F42,F43,F44,F45,F46,F47,F48,F49, |
| 317 | F50,F51,F52,F53,F54,F55,F56, |
| 318 | F57,F58,F59,F60,F61,F62,F63,F64,F65,F66,F67,F68,F69,F70,F71,F72,F73,F74, |
| 319 | F75,F76,F77,F78,F79,F80,F81, |
| 320 | F82,F83,F84,F85,F86,F87,F88,F89,F90,F91,F92,F93,F94,F95,F96,F97,F98,F99, |
| 321 | F100,F101,F102,F103,F104,F105, |
| 322 | F106,F107,F108,F109,F110,F111,F112,F113,F114,F115,F116,F117,F118,F119, |
| 323 | F120,F121,F122,F123,F124,F125,F126,F127, |
| 324 | out0,out1,out2,out3,out4,out5,out6,out7] in { |
| 325 | def BRCALL : RawForm<0x03, 0xb0, (ops calltarget:$dst), |
| 326 | "br.call.sptk rp = $dst;;">; // FIXME: teach llvm about branch regs? |
| 327 | def BRLCOND_CALL : RawForm<0x03, 0xb0, (ops PR:$qp, i64imm:$dst), |
| 328 | "($qp) brl.cond.call.sptk $dst;;">; |
| 329 | def BRCOND_CALL : RawForm<0x03, 0xb0, (ops PR:$qp, GR:$dst), |
| 330 | "($qp) br.cond.call.sptk $dst;;">; |
| 331 | } |
| 332 | |
| 333 | let isTerminator = 1, isReturn = 1 in |
| 334 | def RET : RawForm<0x03, 0xb0, (ops), "br.ret.sptk.many rp;;">; // return |
| 335 | |
| 336 | |