github.com/ader1990/go@v0.0.0-20140630135419-8c24447fa791/src/cmd/5l/5.out.h (about) 1 // Inferno utils/5c/5.out.h 2 // http://code.google.com/p/inferno-os/source/browse/utils/5c/5.out.h 3 // 4 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. 5 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) 6 // Portions Copyright © 1997-1999 Vita Nuova Limited 7 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) 8 // Portions Copyright © 2004,2006 Bruce Ellis 9 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) 10 // Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others 11 // Portions Copyright © 2009 The Go Authors. All rights reserved. 12 // 13 // Permission is hereby granted, free of charge, to any person obtaining a copy 14 // of this software and associated documentation files (the "Software"), to deal 15 // in the Software without restriction, including without limitation the rights 16 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 // copies of the Software, and to permit persons to whom the Software is 18 // furnished to do so, subject to the following conditions: 19 // 20 // The above copyright notice and this permission notice shall be included in 21 // all copies or substantial portions of the Software. 22 // 23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 29 // THE SOFTWARE. 30 31 #define NSNAME 8 32 #define NSYM 50 33 #define NREG 16 34 #include "../ld/textflag.h" 35 36 #define REGRET 0 37 /* -1 disables use of REGARG */ 38 #define REGARG -1 39 /* compiler allocates R1 up as temps */ 40 /* compiler allocates register variables R3 up */ 41 #define REGEXT 10 42 /* these two registers are declared in runtime.h */ 43 #define REGG (REGEXT-0) 44 #define REGM (REGEXT-1) 45 /* compiler allocates external registers R10 down */ 46 #define REGTMP 11 47 #define REGSP 13 48 #define REGLINK 14 49 #define REGPC 15 50 51 #define NFREG 16 52 #define FREGRET 0 53 #define FREGEXT 7 54 #define FREGTMP 15 55 /* compiler allocates register variables F0 up */ 56 /* compiler allocates external registers F7 down */ 57 58 enum as 59 { 60 AXXX, 61 62 AAND, 63 AEOR, 64 ASUB, 65 ARSB, 66 AADD, 67 AADC, 68 ASBC, 69 ARSC, 70 ATST, 71 ATEQ, 72 ACMP, 73 ACMN, 74 AORR, 75 ABIC, 76 77 AMVN, 78 79 AB, 80 ABL, 81 82 /* 83 * Do not reorder or fragment the conditional branch 84 * opcodes, or the predication code will break 85 */ 86 ABEQ, 87 ABNE, 88 ABCS, 89 ABHS, 90 ABCC, 91 ABLO, 92 ABMI, 93 ABPL, 94 ABVS, 95 ABVC, 96 ABHI, 97 ABLS, 98 ABGE, 99 ABLT, 100 ABGT, 101 ABLE, 102 103 AMOVWD, 104 AMOVWF, 105 AMOVDW, 106 AMOVFW, 107 AMOVFD, 108 AMOVDF, 109 AMOVF, 110 AMOVD, 111 112 ACMPF, 113 ACMPD, 114 AADDF, 115 AADDD, 116 ASUBF, 117 ASUBD, 118 AMULF, 119 AMULD, 120 ADIVF, 121 ADIVD, 122 ASQRTF, 123 ASQRTD, 124 AABSF, 125 AABSD, 126 127 ASRL, 128 ASRA, 129 ASLL, 130 AMULU, 131 ADIVU, 132 AMUL, 133 ADIV, 134 AMOD, 135 AMODU, 136 137 AMOVB, 138 AMOVBS, 139 AMOVBU, 140 AMOVH, 141 AMOVHS, 142 AMOVHU, 143 AMOVW, 144 AMOVM, 145 ASWPBU, 146 ASWPW, 147 148 ANOP, 149 ARFE, 150 ASWI, 151 AMULA, 152 153 ADATA, 154 AGLOBL, 155 AGOK, 156 AHISTORY, 157 ANAME, 158 ARET, 159 ATEXT, 160 AWORD, 161 ADYNT_, 162 AINIT_, 163 ABCASE, 164 ACASE, 165 166 AEND, 167 168 AMULL, 169 AMULAL, 170 AMULLU, 171 AMULALU, 172 173 ABX, 174 ABXRET, 175 ADWORD, 176 177 ASIGNAME, 178 179 ALDREX, 180 ASTREX, 181 182 ALDREXD, 183 ASTREXD, 184 185 APLD, 186 187 AUNDEF, 188 189 ACLZ, 190 191 AMULWT, 192 AMULWB, 193 AMULAWT, 194 AMULAWB, 195 196 AUSEFIELD, 197 ATYPE, 198 AFUNCDATA, 199 APCDATA, 200 ACHECKNIL, 201 AVARDEF, 202 AVARKILL, 203 ADUFFCOPY, 204 ADUFFZERO, 205 206 AMRC, // MRC/MCR 207 208 ALAST, 209 }; 210 211 /* scond byte */ 212 #define C_SCOND ((1<<4)-1) 213 #define C_SBIT (1<<4) 214 #define C_PBIT (1<<5) 215 #define C_WBIT (1<<6) 216 #define C_FBIT (1<<7) /* psr flags-only */ 217 #define C_UBIT (1<<7) /* up bit, unsigned bit */ 218 219 #define C_SCOND_EQ 0 220 #define C_SCOND_NE 1 221 #define C_SCOND_HS 2 222 #define C_SCOND_LO 3 223 #define C_SCOND_MI 4 224 #define C_SCOND_PL 5 225 #define C_SCOND_VS 6 226 #define C_SCOND_VC 7 227 #define C_SCOND_HI 8 228 #define C_SCOND_LS 9 229 #define C_SCOND_GE 10 230 #define C_SCOND_LT 11 231 #define C_SCOND_GT 12 232 #define C_SCOND_LE 13 233 #define C_SCOND_NONE 14 234 #define C_SCOND_NV 15 235 236 /* D_SHIFT type */ 237 #define SHIFT_LL 0<<5 238 #define SHIFT_LR 1<<5 239 #define SHIFT_AR 2<<5 240 #define SHIFT_RR 3<<5 241 242 enum 243 { 244 /* type/name */ 245 D_GOK = 0, 246 D_NONE = 1, 247 248 /* type */ 249 D_BRANCH = (D_NONE+1), 250 D_OREG = (D_NONE+2), 251 D_CONST = (D_NONE+7), 252 D_FCONST = (D_NONE+8), 253 D_SCONST = (D_NONE+9), 254 D_PSR = (D_NONE+10), 255 D_REG = (D_NONE+12), 256 D_FREG = (D_NONE+13), 257 D_FILE = (D_NONE+16), 258 D_OCONST = (D_NONE+17), 259 D_FILE1 = (D_NONE+18), 260 261 D_SHIFT = (D_NONE+19), 262 D_FPCR = (D_NONE+20), 263 D_REGREG = (D_NONE+21), // (reg, reg) 264 D_ADDR = (D_NONE+22), 265 266 D_SBIG = (D_NONE+23), 267 D_CONST2 = (D_NONE+24), 268 269 D_REGREG2 = (D_NONE+25), // reg, reg 270 271 /* name */ 272 D_EXTERN = (D_NONE+3), 273 D_STATIC = (D_NONE+4), 274 D_AUTO = (D_NONE+5), 275 D_PARAM = (D_NONE+6), 276 }; 277 278 /* 279 * this is the ranlib header 280 */ 281 #define SYMDEF "__.GOSYMDEF"