Home | History | Annotate | Download | only in ppc64
      1 // cmd/9c/9.out.h from Vita Nuova.
      2 //
      3 //	Copyright  1994-1999 Lucent Technologies Inc.  All rights reserved.
      4 //	Portions Copyright  1995-1997 C H Forsyth (forsyth (a] terzarima.net)
      5 //	Portions Copyright  1997-1999 Vita Nuova Limited
      6 //	Portions Copyright  2000-2008 Vita Nuova Holdings Limited (www.vitanuova.com)
      7 //	Portions Copyright  2004,2006 Bruce Ellis
      8 //	Portions Copyright  2005-2007 C H Forsyth (forsyth (a] terzarima.net)
      9 //	Revisions Copyright  2000-2008 Lucent Technologies Inc. and others
     10 //	Portions Copyright  2009 The Go Authors.  All rights reserved.
     11 //
     12 // Permission is hereby granted, free of charge, to any person obtaining a copy
     13 // of this software and associated documentation files (the "Software"), to deal
     14 // in the Software without restriction, including without limitation the rights
     15 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     16 // copies of the Software, and to permit persons to whom the Software is
     17 // furnished to do so, subject to the following conditions:
     18 //
     19 // The above copyright notice and this permission notice shall be included in
     20 // all copies or substantial portions of the Software.
     21 //
     22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     23 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     24 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
     25 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     26 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
     27 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
     28 // THE SOFTWARE.
     29 
     30 package ppc64
     31 
     32 import "cmd/internal/obj"
     33 
     34 //go:generate go run ../stringer.go -i $GOFILE -o anames.go -p ppc64
     35 
     36 /*
     37  * powerpc 64
     38  */
     39 const (
     40 	NSNAME = 8
     41 	NSYM   = 50
     42 	NREG   = 32 /* number of general registers */
     43 	NFREG  = 32 /* number of floating point registers */
     44 )
     45 
     46 const (
     47 	REG_R0 = obj.RBasePPC64 + iota
     48 	REG_R1
     49 	REG_R2
     50 	REG_R3
     51 	REG_R4
     52 	REG_R5
     53 	REG_R6
     54 	REG_R7
     55 	REG_R8
     56 	REG_R9
     57 	REG_R10
     58 	REG_R11
     59 	REG_R12
     60 	REG_R13
     61 	REG_R14
     62 	REG_R15
     63 	REG_R16
     64 	REG_R17
     65 	REG_R18
     66 	REG_R19
     67 	REG_R20
     68 	REG_R21
     69 	REG_R22
     70 	REG_R23
     71 	REG_R24
     72 	REG_R25
     73 	REG_R26
     74 	REG_R27
     75 	REG_R28
     76 	REG_R29
     77 	REG_R30
     78 	REG_R31
     79 
     80 	REG_F0
     81 	REG_F1
     82 	REG_F2
     83 	REG_F3
     84 	REG_F4
     85 	REG_F5
     86 	REG_F6
     87 	REG_F7
     88 	REG_F8
     89 	REG_F9
     90 	REG_F10
     91 	REG_F11
     92 	REG_F12
     93 	REG_F13
     94 	REG_F14
     95 	REG_F15
     96 	REG_F16
     97 	REG_F17
     98 	REG_F18
     99 	REG_F19
    100 	REG_F20
    101 	REG_F21
    102 	REG_F22
    103 	REG_F23
    104 	REG_F24
    105 	REG_F25
    106 	REG_F26
    107 	REG_F27
    108 	REG_F28
    109 	REG_F29
    110 	REG_F30
    111 	REG_F31
    112 
    113 	REG_CR0
    114 	REG_CR1
    115 	REG_CR2
    116 	REG_CR3
    117 	REG_CR4
    118 	REG_CR5
    119 	REG_CR6
    120 	REG_CR7
    121 
    122 	REG_MSR
    123 	REG_FPSCR
    124 	REG_CR
    125 
    126 	REG_SPECIAL = REG_CR0
    127 
    128 	REG_SPR0 = obj.RBasePPC64 + 1024 // first of 1024 registers
    129 	REG_DCR0 = obj.RBasePPC64 + 2048 // first of 1024 registers
    130 
    131 	REG_XER = REG_SPR0 + 1
    132 	REG_LR  = REG_SPR0 + 8
    133 	REG_CTR = REG_SPR0 + 9
    134 
    135 	REGZERO  = REG_R0 /* set to zero */
    136 	REGSP    = REG_R1
    137 	REGSB    = REG_R2
    138 	REGRET   = REG_R3
    139 	REGARG   = -1      /* -1 disables passing the first argument in register */
    140 	REGRT1   = REG_R3  /* reserved for runtime, duffzero and duffcopy */
    141 	REGRT2   = REG_R4  /* reserved for runtime, duffcopy */
    142 	REGMIN   = REG_R7  /* register variables allocated from here to REGMAX */
    143 	REGCTXT  = REG_R11 /* context for closures */
    144 	REGTLS   = REG_R13 /* C ABI TLS base pointer */
    145 	REGMAX   = REG_R27
    146 	REGEXT   = REG_R30 /* external registers allocated from here down */
    147 	REGG     = REG_R30 /* G */
    148 	REGTMP   = REG_R31 /* used by the linker */
    149 	FREGRET  = REG_F0
    150 	FREGMIN  = REG_F17 /* first register variable */
    151 	FREGMAX  = REG_F26 /* last register variable for 9g only */
    152 	FREGEXT  = REG_F26 /* first external register */
    153 	FREGCVI  = REG_F27 /* floating conversion constant */
    154 	FREGZERO = REG_F28 /* both float and double */
    155 	FREGHALF = REG_F29 /* double */
    156 	FREGONE  = REG_F30 /* double */
    157 	FREGTWO  = REG_F31 /* double */
    158 )
    159 
    160 /*
    161  * GENERAL:
    162  *
    163  * compiler allocates R3 up as temps
    164  * compiler allocates register variables R7-R27
    165  * compiler allocates external registers R30 down
    166  *
    167  * compiler allocates register variables F17-F26
    168  * compiler allocates external registers F26 down
    169  */
    170 const (
    171 	BIG = 32768 - 8
    172 )
    173 
    174 const (
    175 	/* mark flags */
    176 	LABEL   = 1 << 0
    177 	LEAF    = 1 << 1
    178 	FLOAT   = 1 << 2
    179 	BRANCH  = 1 << 3
    180 	LOAD    = 1 << 4
    181 	FCMP    = 1 << 5
    182 	SYNC    = 1 << 6
    183 	LIST    = 1 << 7
    184 	FOLL    = 1 << 8
    185 	NOSCHED = 1 << 9
    186 )
    187 
    188 const (
    189 	C_NONE = iota
    190 	C_REG
    191 	C_FREG
    192 	C_CREG
    193 	C_SPR /* special processor register */
    194 	C_ZCON
    195 	C_SCON   /* 16 bit signed */
    196 	C_UCON   /* 32 bit signed, low 16 bits 0 */
    197 	C_ADDCON /* -0x8000 <= v < 0 */
    198 	C_ANDCON /* 0 < v <= 0xFFFF */
    199 	C_LCON   /* other 32 */
    200 	C_DCON   /* other 64 (could subdivide further) */
    201 	C_SACON  /* $n(REG) where n <= int16 */
    202 	C_SECON
    203 	C_LACON /* $n(REG) where int16 < n <= int32 */
    204 	C_LECON
    205 	C_DACON /* $n(REG) where int32 < n */
    206 	C_SBRA
    207 	C_LBRA
    208 	C_SAUTO
    209 	C_LAUTO
    210 	C_SEXT
    211 	C_LEXT
    212 	C_ZOREG
    213 	C_SOREG
    214 	C_LOREG
    215 	C_FPSCR
    216 	C_MSR
    217 	C_XER
    218 	C_LR
    219 	C_CTR
    220 	C_ANY
    221 	C_GOK
    222 	C_ADDR
    223 	C_TEXTSIZE
    224 
    225 	C_NCLASS /* must be the last */
    226 )
    227 
    228 const (
    229 	AADD = obj.ABasePPC64 + obj.A_ARCHSPECIFIC + iota
    230 	AADDCC
    231 	AADDV
    232 	AADDVCC
    233 	AADDC
    234 	AADDCCC
    235 	AADDCV
    236 	AADDCVCC
    237 	AADDME
    238 	AADDMECC
    239 	AADDMEVCC
    240 	AADDMEV
    241 	AADDE
    242 	AADDECC
    243 	AADDEVCC
    244 	AADDEV
    245 	AADDZE
    246 	AADDZECC
    247 	AADDZEVCC
    248 	AADDZEV
    249 	AAND
    250 	AANDCC
    251 	AANDN
    252 	AANDNCC
    253 	ABC
    254 	ABCL
    255 	ABEQ
    256 	ABGE
    257 	ABGT
    258 	ABLE
    259 	ABLT
    260 	ABNE
    261 	ABVC
    262 	ABVS
    263 	ACMP
    264 	ACMPU
    265 	ACNTLZW
    266 	ACNTLZWCC
    267 	ACRAND
    268 	ACRANDN
    269 	ACREQV
    270 	ACRNAND
    271 	ACRNOR
    272 	ACROR
    273 	ACRORN
    274 	ACRXOR
    275 	ADIVW
    276 	ADIVWCC
    277 	ADIVWVCC
    278 	ADIVWV
    279 	ADIVWU
    280 	ADIVWUCC
    281 	ADIVWUVCC
    282 	ADIVWUV
    283 	AEQV
    284 	AEQVCC
    285 	AEXTSB
    286 	AEXTSBCC
    287 	AEXTSH
    288 	AEXTSHCC
    289 	AFABS
    290 	AFABSCC
    291 	AFADD
    292 	AFADDCC
    293 	AFADDS
    294 	AFADDSCC
    295 	AFCMPO
    296 	AFCMPU
    297 	AFCTIW
    298 	AFCTIWCC
    299 	AFCTIWZ
    300 	AFCTIWZCC
    301 	AFDIV
    302 	AFDIVCC
    303 	AFDIVS
    304 	AFDIVSCC
    305 	AFMADD
    306 	AFMADDCC
    307 	AFMADDS
    308 	AFMADDSCC
    309 	AFMOVD
    310 	AFMOVDCC
    311 	AFMOVDU
    312 	AFMOVS
    313 	AFMOVSU
    314 	AFMSUB
    315 	AFMSUBCC
    316 	AFMSUBS
    317 	AFMSUBSCC
    318 	AFMUL
    319 	AFMULCC
    320 	AFMULS
    321 	AFMULSCC
    322 	AFNABS
    323 	AFNABSCC
    324 	AFNEG
    325 	AFNEGCC
    326 	AFNMADD
    327 	AFNMADDCC
    328 	AFNMADDS
    329 	AFNMADDSCC
    330 	AFNMSUB
    331 	AFNMSUBCC
    332 	AFNMSUBS
    333 	AFNMSUBSCC
    334 	AFRSP
    335 	AFRSPCC
    336 	AFSUB
    337 	AFSUBCC
    338 	AFSUBS
    339 	AFSUBSCC
    340 	AMOVMW
    341 	ALSW
    342 	ALWAR
    343 	AMOVWBR
    344 	AMOVB
    345 	AMOVBU
    346 	AMOVBZ
    347 	AMOVBZU
    348 	AMOVH
    349 	AMOVHBR
    350 	AMOVHU
    351 	AMOVHZ
    352 	AMOVHZU
    353 	AMOVW
    354 	AMOVWU
    355 	AMOVFL
    356 	AMOVCRFS
    357 	AMTFSB0
    358 	AMTFSB0CC
    359 	AMTFSB1
    360 	AMTFSB1CC
    361 	AMULHW
    362 	AMULHWCC
    363 	AMULHWU
    364 	AMULHWUCC
    365 	AMULLW
    366 	AMULLWCC
    367 	AMULLWVCC
    368 	AMULLWV
    369 	ANAND
    370 	ANANDCC
    371 	ANEG
    372 	ANEGCC
    373 	ANEGVCC
    374 	ANEGV
    375 	ANOR
    376 	ANORCC
    377 	AOR
    378 	AORCC
    379 	AORN
    380 	AORNCC
    381 	AREM
    382 	AREMCC
    383 	AREMV
    384 	AREMVCC
    385 	AREMU
    386 	AREMUCC
    387 	AREMUV
    388 	AREMUVCC
    389 	ARFI
    390 	ARLWMI
    391 	ARLWMICC
    392 	ARLWNM
    393 	ARLWNMCC
    394 	ASLW
    395 	ASLWCC
    396 	ASRW
    397 	ASRAW
    398 	ASRAWCC
    399 	ASRWCC
    400 	ASTSW
    401 	ASTWCCC
    402 	ASUB
    403 	ASUBCC
    404 	ASUBVCC
    405 	ASUBC
    406 	ASUBCCC
    407 	ASUBCV
    408 	ASUBCVCC
    409 	ASUBME
    410 	ASUBMECC
    411 	ASUBMEVCC
    412 	ASUBMEV
    413 	ASUBV
    414 	ASUBE
    415 	ASUBECC
    416 	ASUBEV
    417 	ASUBEVCC
    418 	ASUBZE
    419 	ASUBZECC
    420 	ASUBZEVCC
    421 	ASUBZEV
    422 	ASYNC
    423 	AXOR
    424 	AXORCC
    425 
    426 	ADCBF
    427 	ADCBI
    428 	ADCBST
    429 	ADCBT
    430 	ADCBTST
    431 	ADCBZ
    432 	AECIWX
    433 	AECOWX
    434 	AEIEIO
    435 	AICBI
    436 	AISYNC
    437 	APTESYNC
    438 	ATLBIE
    439 	ATLBIEL
    440 	ATLBSYNC
    441 	ATW
    442 
    443 	ASYSCALL
    444 	AWORD
    445 
    446 	ARFCI
    447 
    448 	/* optional on 32-bit */
    449 	AFRES
    450 	AFRESCC
    451 	AFRSQRTE
    452 	AFRSQRTECC
    453 	AFSEL
    454 	AFSELCC
    455 	AFSQRT
    456 	AFSQRTCC
    457 	AFSQRTS
    458 	AFSQRTSCC
    459 
    460 	/* 64-bit */
    461 
    462 	ACNTLZD
    463 	ACNTLZDCC
    464 	ACMPW /* CMP with L=0 */
    465 	ACMPWU
    466 	ADIVD
    467 	ADIVDCC
    468 	ADIVDVCC
    469 	ADIVDV
    470 	ADIVDU
    471 	ADIVDUCC
    472 	ADIVDUVCC
    473 	ADIVDUV
    474 	AEXTSW
    475 	AEXTSWCC
    476 	/* AFCFIW; AFCFIWCC */
    477 	AFCFID
    478 	AFCFIDCC
    479 	AFCTID
    480 	AFCTIDCC
    481 	AFCTIDZ
    482 	AFCTIDZCC
    483 	ALDAR
    484 	AMOVD
    485 	AMOVDU
    486 	AMOVWZ
    487 	AMOVWZU
    488 	AMULHD
    489 	AMULHDCC
    490 	AMULHDU
    491 	AMULHDUCC
    492 	AMULLD
    493 	AMULLDCC
    494 	AMULLDVCC
    495 	AMULLDV
    496 	ARFID
    497 	ARLDMI
    498 	ARLDMICC
    499 	ARLDC
    500 	ARLDCCC
    501 	ARLDCR
    502 	ARLDCRCC
    503 	ARLDCL
    504 	ARLDCLCC
    505 	ASLBIA
    506 	ASLBIE
    507 	ASLBMFEE
    508 	ASLBMFEV
    509 	ASLBMTE
    510 	ASLD
    511 	ASLDCC
    512 	ASRD
    513 	ASRAD
    514 	ASRADCC
    515 	ASRDCC
    516 	ASTDCCC
    517 	ATD
    518 
    519 	/* 64-bit pseudo operation */
    520 	ADWORD
    521 	AREMD
    522 	AREMDCC
    523 	AREMDV
    524 	AREMDVCC
    525 	AREMDU
    526 	AREMDUCC
    527 	AREMDUV
    528 	AREMDUVCC
    529 
    530 	/* more 64-bit operations */
    531 	AHRFID
    532 
    533 	ALAST
    534 
    535 	// aliases
    536 	ABR = obj.AJMP
    537 	ABL = obj.ACALL
    538 )
    539