github.com/akaros/go-akaros@v0.0.0-20181004170632-85005d477eab/src/cmd/5g/gg.h (about)

     1  // Copyright 2009 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  #ifndef	EXTERN
     6  #define	EXTERN	extern
     7  #endif
     8  
     9  #include "../gc/go.h"
    10  #include "../5l/5.out.h"
    11  
    12  #define TEXTFLAG reg
    13  
    14  enum
    15  {
    16  	REGALLOC_R0 = 0,
    17  	REGALLOC_RMAX = REGEXT,
    18  	REGALLOC_F0 = NREG,
    19  	REGALLOC_FMAX = REGALLOC_F0 + FREGEXT,
    20  };
    21  
    22  EXTERN	int32	dynloc;
    23  EXTERN	uchar	reg[REGALLOC_FMAX+1];
    24  EXTERN	int32	pcloc;		// instruction counter
    25  EXTERN	Strlit	emptystring;
    26  EXTERN	Prog	zprog;
    27  EXTERN	Node*	newproc;
    28  EXTERN	Node*	deferproc;
    29  EXTERN	Node*	deferreturn;
    30  EXTERN	Node*	panicindex;
    31  EXTERN	Node*	panicslice;
    32  EXTERN	Node*	throwreturn;
    33  extern	long	unmappedzero;
    34  
    35  /*
    36   * gen.c
    37   */
    38  void	compile(Node*);
    39  void	gen(Node*);
    40  Node*	lookdot(Node*, Node*, int);
    41  void	cgen_as(Node*, Node*);
    42  void	cgen_callmeth(Node*, int);
    43  void	cgen_callinter(Node*, Node*, int);
    44  void	cgen_proc(Node*, int);
    45  void	cgen_callret(Node*, Node*);
    46  void	cgen_dcl(Node*);
    47  int	needconvert(Type*, Type*);
    48  void	genconv(Type*, Type*);
    49  void	allocparams(void);
    50  void	checklabels(void);
    51  void	ginscall(Node*, int);
    52  
    53  /*
    54   * cgen
    55   */
    56  void	agen(Node*, Node*);
    57  Prog* cgenindex(Node *, Node *, int);
    58  void	igen(Node*, Node*, Node*);
    59  void agenr(Node *n, Node *a, Node *res);
    60  vlong	fieldoffset(Type*, Node*);
    61  void	sgen(Node*, Node*, int64);
    62  void	gmove(Node*, Node*);
    63  Prog*	gins(int, Node*, Node*);
    64  int	samaddr(Node*, Node*);
    65  void	raddr(Node *n, Prog *p);
    66  Prog*	gcmp(int, Node*, Node*);
    67  Prog*	gshift(int as, Node *lhs, int32 stype, int32 sval, Node *rhs);
    68  Prog *	gregshift(int as, Node *lhs, int32 stype, Node *reg, Node *rhs);
    69  void	naddr(Node*, Addr*, int);
    70  void	cgen_aret(Node*, Node*);
    71  void	cgen_hmul(Node*, Node*, Node*);
    72  void	cgen_shift(int, int, Node*, Node*, Node*);
    73  int	componentgen(Node*, Node*);
    74  
    75  /*
    76   * cgen64.c
    77   */
    78  void	cmp64(Node*, Node*, int, int, Prog*);
    79  void	cgen64(Node*, Node*);
    80  
    81  /*
    82   * gsubr.c
    83   */
    84  void	clearp(Prog*);
    85  Prog*	gbranch(int, Type*, int);
    86  Prog*	prog(int);
    87  void	gconv(int, int);
    88  int	conv2pt(Type*);
    89  vlong	convvtox(vlong, int);
    90  void	fnparam(Type*, int, int);
    91  Prog*	gop(int, Node*, Node*, Node*);
    92  int	optoas(int, Type*);
    93  void	ginit(void);
    94  void	gclean(void);
    95  void	regalloc(Node*, Type*, Node*);
    96  void	regfree(Node*);
    97  Node*	nodarg(Type*, int);
    98  void	nodreg(Node*, Type*, int);
    99  void	nodindreg(Node*, Type*, int);
   100  void	buildtxt(void);
   101  Plist*	newplist(void);
   102  int	isfat(Type*);
   103  int	dotaddable(Node*, Node*);
   104  void	sudoclean(void);
   105  int	sudoaddable(int, Node*, Addr*, int*);
   106  void	afunclit(Addr*, Node*);
   107  void	datagostring(Strlit*, Addr*);
   108  void	split64(Node*, Node*, Node*);
   109  void	splitclean(void);
   110  Node*	ncon(uint32 i);
   111  void	gtrack(Sym*);
   112  
   113  /*
   114   * obj.c
   115   */
   116  void	datastring(char*, int, Addr*);
   117  
   118  /*
   119   * list.c
   120   */
   121  void	listinit(void);
   122  
   123  void	zaddr(Biobuf*, Addr*, int, int);