github.com/razvanm/vanadium-go-1.3@v0.0.0-20160721203343-4a65068e5915/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  enum
    32  {
    33  	NSNAME = 8,
    34  	NSYM = 50,
    35  	NREG = 16,
    36  };
    37  #include "../ld/textflag.h"
    38  
    39  /* -1 disables use of REGARG */
    40  #define	REGARG		-1
    41  /*c2go enum { REGARG = -1 }; */
    42  
    43  enum
    44  {
    45  	REGRET = 0,
    46  	/* compiler allocates R1 up as temps */
    47  	/* compiler allocates register variables R3 up */
    48  	/* compiler allocates external registers R10 down */
    49  	REGEXT = 10,
    50  	/* these two registers are declared in runtime.h */
    51  	REGG = REGEXT-0,
    52  	REGM = REGEXT-1,
    53  
    54  	REGTMP = 11,
    55  	REGSP = 13,
    56  	REGLINK = 14,
    57  	REGPC = 15,
    58  	
    59  	NFREG = 16,
    60  	FREGRET = 0,
    61  	FREGEXT = 7,
    62  	FREGTMP = 15,
    63  };
    64  /* compiler allocates register variables F0 up */
    65  /* compiler allocates external registers F7 down */
    66  
    67  enum
    68  {
    69  	C_NONE,
    70  	C_REG,
    71  	C_REGREG,
    72  	C_REGREG2,
    73  	C_SHIFT,
    74  	C_FREG,
    75  	C_PSR,
    76  	C_FCR,
    77  
    78  	C_RCON,		/* 0xff rotated */
    79  	C_NCON,		/* ~RCON */
    80  	C_SCON,		/* 0xffff */
    81  	C_LCON,
    82  	C_LCONADDR,
    83  	C_ZFCON,
    84  	C_SFCON,
    85  	C_LFCON,
    86  
    87  	C_RACON,
    88  	C_LACON,
    89  
    90  	C_SBRA,
    91  	C_LBRA,
    92  
    93  	C_HAUTO,	/* halfword insn offset (-0xff to 0xff) */
    94  	C_FAUTO,	/* float insn offset (0 to 0x3fc, word aligned) */
    95  	C_HFAUTO,	/* both H and F */
    96  	C_SAUTO,	/* -0xfff to 0xfff */
    97  	C_LAUTO,
    98  
    99  	C_HOREG,
   100  	C_FOREG,
   101  	C_HFOREG,
   102  	C_SOREG,
   103  	C_ROREG,
   104  	C_SROREG,	/* both nil and R */
   105  	C_LOREG,
   106  
   107  	C_PC,
   108  	C_SP,
   109  	C_HREG,
   110  
   111  	C_ADDR,		/* reference to relocatable address */
   112  
   113  	C_GOK,
   114  
   115  	C_NCLASS,	/* must be the last */
   116  };
   117  
   118  enum
   119  {
   120  	AXXX,
   121  
   122  	AAND,
   123  	AEOR,
   124  	ASUB,
   125  	ARSB,
   126  	AADD,
   127  	AADC,
   128  	ASBC,
   129  	ARSC,
   130  	ATST,
   131  	ATEQ,
   132  	ACMP,
   133  	ACMN,
   134  	AORR,
   135  	ABIC,
   136  
   137  	AMVN,
   138  
   139  	AB,
   140  	ABL,
   141  
   142  /*
   143   * Do not reorder or fragment the conditional branch
   144   * opcodes, or the predication code will break
   145   */
   146  	ABEQ,
   147  	ABNE,
   148  	ABCS,
   149  	ABHS,
   150  	ABCC,
   151  	ABLO,
   152  	ABMI,
   153  	ABPL,
   154  	ABVS,
   155  	ABVC,
   156  	ABHI,
   157  	ABLS,
   158  	ABGE,
   159  	ABLT,
   160  	ABGT,
   161  	ABLE,
   162  
   163  	AMOVWD,
   164  	AMOVWF,
   165  	AMOVDW,
   166  	AMOVFW,
   167  	AMOVFD,
   168  	AMOVDF,
   169  	AMOVF,
   170  	AMOVD,
   171  
   172  	ACMPF,
   173  	ACMPD,
   174  	AADDF,
   175  	AADDD,
   176  	ASUBF,
   177  	ASUBD,
   178  	AMULF,
   179  	AMULD,
   180  	ADIVF,
   181  	ADIVD,
   182  	ASQRTF,
   183  	ASQRTD,
   184  	AABSF,
   185  	AABSD,
   186  
   187  	ASRL,
   188  	ASRA,
   189  	ASLL,
   190  	AMULU,
   191  	ADIVU,
   192  	AMUL,
   193  	ADIV,
   194  	AMOD,
   195  	AMODU,
   196  
   197  	AMOVB,
   198  	AMOVBS,
   199  	AMOVBU,
   200  	AMOVH,
   201  	AMOVHS,
   202  	AMOVHU,
   203  	AMOVW,
   204  	AMOVM,
   205  	ASWPBU,
   206  	ASWPW,
   207  
   208  	ANOP,
   209  	ARFE,
   210  	ASWI,
   211  	AMULA,
   212  
   213  	ADATA,
   214  	AGLOBL,
   215  	AGOK,
   216  	AHISTORY,
   217  	ANAME,
   218  	ARET,
   219  	ATEXT,
   220  	AWORD,
   221  	ADYNT_,
   222  	AINIT_,
   223  	ABCASE,
   224  	ACASE,
   225  
   226  	AEND,
   227  
   228  	AMULL,
   229  	AMULAL,
   230  	AMULLU,
   231  	AMULALU,
   232  
   233  	ABX,
   234  	ABXRET,
   235  	ADWORD,
   236  
   237  	ASIGNAME,
   238  
   239  	ALDREX,
   240  	ASTREX,
   241  	
   242  	ALDREXD,
   243  	ASTREXD,
   244  
   245  	APLD,
   246  
   247  	AUNDEF,
   248  
   249  	ACLZ,
   250  
   251  	AMULWT,
   252  	AMULWB,
   253  	AMULAWT,
   254  	AMULAWB,
   255  	
   256  	AUSEFIELD,
   257  	ATYPE,
   258  	AFUNCDATA,
   259  	APCDATA,
   260  	ACHECKNIL,
   261  	AVARDEF,
   262  	AVARKILL,
   263  	ADUFFCOPY,
   264  	ADUFFZERO,
   265  	ADATABUNDLE,
   266  	ADATABUNDLEEND,
   267  
   268  	AMRC, // MRC/MCR
   269  
   270  	ALAST,
   271  };
   272  
   273  /* scond byte */
   274  enum
   275  {
   276  	C_SCOND = (1<<4)-1,
   277  	C_SBIT = 1<<4,
   278  	C_PBIT = 1<<5,
   279  	C_WBIT = 1<<6,
   280  	C_FBIT = 1<<7,	/* psr flags-only */
   281  	C_UBIT = 1<<7,	/* up bit, unsigned bit */
   282  
   283  	C_SCOND_EQ = 0,
   284  	C_SCOND_NE = 1,
   285  	C_SCOND_HS = 2,
   286  	C_SCOND_LO = 3,
   287  	C_SCOND_MI = 4,
   288  	C_SCOND_PL = 5,
   289  	C_SCOND_VS = 6,
   290  	C_SCOND_VC = 7,
   291  	C_SCOND_HI = 8,
   292  	C_SCOND_LS = 9,
   293  	C_SCOND_GE = 10,
   294  	C_SCOND_LT = 11,
   295  	C_SCOND_GT = 12,
   296  	C_SCOND_LE = 13,
   297  	C_SCOND_NONE = 14,
   298  	C_SCOND_NV = 15,
   299  
   300  	/* D_SHIFT type */
   301  	SHIFT_LL = 0<<5,
   302  	SHIFT_LR = 1<<5,
   303  	SHIFT_AR = 2<<5,
   304  	SHIFT_RR = 3<<5,
   305  };
   306  
   307  enum
   308  {
   309  /* type/name */
   310  	D_GOK = 0,
   311  	D_NONE = 1,
   312  
   313  /* type */
   314  	D_BRANCH = (D_NONE+1),
   315  	D_OREG = (D_NONE+2),
   316  	D_CONST = (D_NONE+7),
   317  	D_FCONST = (D_NONE+8),
   318  	D_SCONST = (D_NONE+9),
   319  	D_PSR = (D_NONE+10),
   320  	D_REG = (D_NONE+12),
   321  	D_FREG = (D_NONE+13),
   322  	D_FILE = (D_NONE+16),
   323  	D_OCONST = (D_NONE+17),
   324  	D_FILE1 = (D_NONE+18),
   325  
   326  	D_SHIFT = (D_NONE+19),
   327  	D_FPCR = (D_NONE+20),
   328  	D_REGREG = (D_NONE+21), // (reg, reg)
   329  	D_ADDR = (D_NONE+22),
   330  
   331  	D_SBIG = (D_NONE+23),
   332  	D_CONST2 = (D_NONE+24),
   333  
   334  	D_REGREG2 = (D_NONE+25), // reg, reg
   335  
   336  /* name */
   337  	D_EXTERN = (D_NONE+3),
   338  	D_STATIC = (D_NONE+4),
   339  	D_AUTO = (D_NONE+5),
   340  	D_PARAM = (D_NONE+6),
   341  };
   342  
   343  /*
   344   * this is the ranlib header
   345   */
   346  #define	SYMDEF	"__.GOSYMDEF"
   347  /*c2go extern char SYMDEF[]; */