Home | History | Annotate | Download | only in mips
      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 mips
     31 
     32 import (
     33 	"cmd/internal/obj"
     34 )
     35 
     36 //go:generate go run ../stringer.go -i $GOFILE -o anames.go -p mips
     37 
     38 /*
     39  * mips 64
     40  */
     41 const (
     42 	NSNAME = 8
     43 	NSYM   = 50
     44 	NREG   = 32 /* number of general registers */
     45 	NFREG  = 32 /* number of floating point registers */
     46 )
     47 
     48 const (
     49 	REG_R0 = obj.RBaseMIPS + iota
     50 	REG_R1
     51 	REG_R2
     52 	REG_R3
     53 	REG_R4
     54 	REG_R5
     55 	REG_R6
     56 	REG_R7
     57 	REG_R8
     58 	REG_R9
     59 	REG_R10
     60 	REG_R11
     61 	REG_R12
     62 	REG_R13
     63 	REG_R14
     64 	REG_R15
     65 	REG_R16
     66 	REG_R17
     67 	REG_R18
     68 	REG_R19
     69 	REG_R20
     70 	REG_R21
     71 	REG_R22
     72 	REG_R23
     73 	REG_R24
     74 	REG_R25
     75 	REG_R26
     76 	REG_R27
     77 	REG_R28
     78 	REG_R29
     79 	REG_R30
     80 	REG_R31
     81 
     82 	REG_F0
     83 	REG_F1
     84 	REG_F2
     85 	REG_F3
     86 	REG_F4
     87 	REG_F5
     88 	REG_F6
     89 	REG_F7
     90 	REG_F8
     91 	REG_F9
     92 	REG_F10
     93 	REG_F11
     94 	REG_F12
     95 	REG_F13
     96 	REG_F14
     97 	REG_F15
     98 	REG_F16
     99 	REG_F17
    100 	REG_F18
    101 	REG_F19
    102 	REG_F20
    103 	REG_F21
    104 	REG_F22
    105 	REG_F23
    106 	REG_F24
    107 	REG_F25
    108 	REG_F26
    109 	REG_F27
    110 	REG_F28
    111 	REG_F29
    112 	REG_F30
    113 	REG_F31
    114 
    115 	REG_HI
    116 	REG_LO
    117 
    118 	// co-processor 0 control registers
    119 	REG_M0
    120 	REG_M1
    121 	REG_M2
    122 	REG_M3
    123 	REG_M4
    124 	REG_M5
    125 	REG_M6
    126 	REG_M7
    127 	REG_M8
    128 	REG_M9
    129 	REG_M10
    130 	REG_M11
    131 	REG_M12
    132 	REG_M13
    133 	REG_M14
    134 	REG_M15
    135 	REG_M16
    136 	REG_M17
    137 	REG_M18
    138 	REG_M19
    139 	REG_M20
    140 	REG_M21
    141 	REG_M22
    142 	REG_M23
    143 	REG_M24
    144 	REG_M25
    145 	REG_M26
    146 	REG_M27
    147 	REG_M28
    148 	REG_M29
    149 	REG_M30
    150 	REG_M31
    151 
    152 	// FPU control registers
    153 	REG_FCR0
    154 	REG_FCR1
    155 	REG_FCR2
    156 	REG_FCR3
    157 	REG_FCR4
    158 	REG_FCR5
    159 	REG_FCR6
    160 	REG_FCR7
    161 	REG_FCR8
    162 	REG_FCR9
    163 	REG_FCR10
    164 	REG_FCR11
    165 	REG_FCR12
    166 	REG_FCR13
    167 	REG_FCR14
    168 	REG_FCR15
    169 	REG_FCR16
    170 	REG_FCR17
    171 	REG_FCR18
    172 	REG_FCR19
    173 	REG_FCR20
    174 	REG_FCR21
    175 	REG_FCR22
    176 	REG_FCR23
    177 	REG_FCR24
    178 	REG_FCR25
    179 	REG_FCR26
    180 	REG_FCR27
    181 	REG_FCR28
    182 	REG_FCR29
    183 	REG_FCR30
    184 	REG_FCR31
    185 
    186 	REG_LAST = REG_FCR31 // the last defined register
    187 
    188 	REG_SPECIAL = REG_M0
    189 
    190 	REGZERO = REG_R0 /* set to zero */
    191 	REGSP   = REG_R29
    192 	REGSB   = REG_R28
    193 	REGLINK = REG_R31
    194 	REGRET  = REG_R1
    195 	REGARG  = -1      /* -1 disables passing the first argument in register */
    196 	REGRT1  = REG_R1  /* reserved for runtime, duffzero and duffcopy */
    197 	REGRT2  = REG_R2  /* reserved for runtime, duffcopy */
    198 	REGCTXT = REG_R22 /* context for closures */
    199 	REGG    = REG_R30 /* G */
    200 	REGTMP  = REG_R23 /* used by the linker */
    201 	FREGRET = REG_F0
    202 )
    203 
    204 const (
    205 	BIG = 32766
    206 )
    207 
    208 const (
    209 	/* mark flags */
    210 	FOLL    = 1 << 0
    211 	LABEL   = 1 << 1
    212 	LEAF    = 1 << 2
    213 	SYNC    = 1 << 3
    214 	BRANCH  = 1 << 4
    215 	LOAD    = 1 << 5
    216 	FCMP    = 1 << 6
    217 	NOSCHED = 1 << 7
    218 
    219 	NSCHED = 20
    220 )
    221 
    222 const (
    223 	C_NONE = iota
    224 	C_REG
    225 	C_FREG
    226 	C_FCREG
    227 	C_MREG /* special processor register */
    228 	C_HI
    229 	C_LO
    230 	C_ZCON
    231 	C_SCON /* 16 bit signed */
    232 	C_UCON /* 32 bit signed, low 16 bits 0 */
    233 	C_ADD0CON
    234 	C_AND0CON
    235 	C_ADDCON /* -0x8000 <= v < 0 */
    236 	C_ANDCON /* 0 < v <= 0xFFFF */
    237 	C_LCON   /* other 32 */
    238 	C_DCON   /* other 64 (could subdivide further) */
    239 	C_SACON  /* $n(REG) where n <= int16 */
    240 	C_SECON
    241 	C_LACON /* $n(REG) where int16 < n <= int32 */
    242 	C_LECON
    243 	C_DACON /* $n(REG) where int32 < n */
    244 	C_STCON /* $tlsvar */
    245 	C_SBRA
    246 	C_LBRA
    247 	C_SAUTO
    248 	C_LAUTO
    249 	C_SEXT
    250 	C_LEXT
    251 	C_ZOREG
    252 	C_SOREG
    253 	C_LOREG
    254 	C_GOK
    255 	C_ADDR
    256 	C_TLS
    257 	C_TEXTSIZE
    258 
    259 	C_NCLASS /* must be the last */
    260 )
    261 
    262 const (
    263 	AABSD = obj.ABaseMIPS + obj.A_ARCHSPECIFIC + iota
    264 	AABSF
    265 	AABSW
    266 	AADD
    267 	AADDD
    268 	AADDF
    269 	AADDU
    270 	AADDW
    271 	AAND
    272 	ABEQ
    273 	ABFPF
    274 	ABFPT
    275 	ABGEZ
    276 	ABGEZAL
    277 	ABGTZ
    278 	ABLEZ
    279 	ABLTZ
    280 	ABLTZAL
    281 	ABNE
    282 	ABREAK
    283 	ACLO
    284 	ACLZ
    285 	ACMOVF
    286 	ACMOVN
    287 	ACMOVT
    288 	ACMOVZ
    289 	ACMPEQD
    290 	ACMPEQF
    291 	ACMPGED
    292 	ACMPGEF
    293 	ACMPGTD
    294 	ACMPGTF
    295 	ADIV
    296 	ADIVD
    297 	ADIVF
    298 	ADIVU
    299 	ADIVW
    300 	AGOK
    301 	ALL
    302 	ALLV
    303 	ALUI
    304 	AMOVB
    305 	AMOVBU
    306 	AMOVD
    307 	AMOVDF
    308 	AMOVDW
    309 	AMOVF
    310 	AMOVFD
    311 	AMOVFW
    312 	AMOVH
    313 	AMOVHU
    314 	AMOVW
    315 	AMOVWD
    316 	AMOVWF
    317 	AMOVWL
    318 	AMOVWR
    319 	AMUL
    320 	AMULD
    321 	AMULF
    322 	AMULU
    323 	AMULW
    324 	ANEGD
    325 	ANEGF
    326 	ANEGW
    327 	ANOOP // hardware nop
    328 	ANOR
    329 	AOR
    330 	AREM
    331 	AREMU
    332 	ARFE
    333 	ASC
    334 	ASCV
    335 	ASGT
    336 	ASGTU
    337 	ASLL
    338 	ASQRTD
    339 	ASQRTF
    340 	ASRA
    341 	ASRL
    342 	ASUB
    343 	ASUBD
    344 	ASUBF
    345 	ASUBU
    346 	ASUBW
    347 	ASYNC
    348 	ASYSCALL
    349 	ATEQ
    350 	ATLBP
    351 	ATLBR
    352 	ATLBWI
    353 	ATLBWR
    354 	ATNE
    355 	AWORD
    356 	AXOR
    357 
    358 	/* 64-bit */
    359 	AMOVV
    360 	AMOVVL
    361 	AMOVVR
    362 	ASLLV
    363 	ASRAV
    364 	ASRLV
    365 	ADIVV
    366 	ADIVVU
    367 	AREMV
    368 	AREMVU
    369 	AMULV
    370 	AMULVU
    371 	AADDV
    372 	AADDVU
    373 	ASUBV
    374 	ASUBVU
    375 
    376 	/* 64-bit FP */
    377 	ATRUNCFV
    378 	ATRUNCDV
    379 	ATRUNCFW
    380 	ATRUNCDW
    381 	AMOVWU
    382 	AMOVFV
    383 	AMOVDV
    384 	AMOVVF
    385 	AMOVVD
    386 
    387 	ALAST
    388 
    389 	// aliases
    390 	AJMP = obj.AJMP
    391 	AJAL = obj.ACALL
    392 	ARET = obj.ARET
    393 )
    394