github.com/akaros/go-akaros@v0.0.0-20181004170632-85005d477eab/src/cmd/8g/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 "../8l/8.out.h"
    11  
    12  #define TEXTFLAG from.scale
    13  
    14  // foptoas flags
    15  enum
    16  {
    17  	Frev = 1<<0,
    18  	Fpop = 1<<1,
    19  	Fpop2 = 1<<2,
    20  };
    21  
    22  EXTERN	int32	dynloc;
    23  EXTERN	uchar	reg[D_NONE];
    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*	panicdiv;
    33  EXTERN	Node*	throwreturn;
    34  extern	uint32	unmappedzero;
    35  
    36  
    37  /*
    38   * ggen.c
    39   */
    40  void	compile(Node*);
    41  void	gen(Node*);
    42  Node*	lookdot(Node*, Node*, int);
    43  void	cgen_as(Node*, Node*);
    44  void	cgen_callmeth(Node*, int);
    45  void	cgen_callinter(Node*, Node*, int);
    46  void	cgen_proc(Node*, int);
    47  void	cgen_callret(Node*, Node*);
    48  void	cgen_div(int, Node*, Node*, Node*);
    49  void	cgen_bmul(int, Node*, Node*, Node*);
    50  void	cgen_hmul(Node*, Node*, Node*);
    51  void	cgen_shift(int, int, Node*, Node*, Node*);
    52  void	cgen_float(Node*, Node*);
    53  void	bgen_float(Node *n, int true, int likely, Prog *to);
    54  void	cgen_dcl(Node*);
    55  int	needconvert(Type*, Type*);
    56  void	genconv(Type*, Type*);
    57  void	allocparams(void);
    58  void	checklabels(void);
    59  void	ginscall(Node*, int);
    60  
    61  /*
    62   * cgen.c
    63   */
    64  void	agen(Node*, Node*);
    65  void	igen(Node*, Node*, Node*);
    66  vlong	fieldoffset(Type*, Node*);
    67  void	sgen(Node*, Node*, int64);
    68  void	gmove(Node*, Node*);
    69  Prog*	gins(int, Node*, Node*);
    70  int	samaddr(Node*, Node*);
    71  void	naddr(Node*, Addr*, int);
    72  void	cgen_aret(Node*, Node*);
    73  Node*	ncon(uint32);
    74  void	mgen(Node*, Node*, Node*);
    75  void	mfree(Node*);
    76  int	componentgen(Node*, Node*);
    77  
    78  /*
    79   * cgen64.c
    80   */
    81  void	cmp64(Node*, Node*, int, int, Prog*);
    82  void	cgen64(Node*, Node*);
    83  
    84  /*
    85   * gsubr.c
    86   */
    87  void	clearp(Prog*);
    88  Prog*	gbranch(int, Type*, int);
    89  Prog*	prog(int);
    90  void	gconv(int, int);
    91  int	conv2pt(Type*);
    92  vlong	convvtox(vlong, int);
    93  void	fnparam(Type*, int, int);
    94  Prog*	gop(int, Node*, Node*, Node*);
    95  int	optoas(int, Type*);
    96  int	foptoas(int, Type*, int);
    97  void	ginit(void);
    98  void	gclean(void);
    99  void	regalloc(Node*, Type*, Node*);
   100  void	regfree(Node*);
   101  Node*	nodarg(Type*, int);
   102  void	nodreg(Node*, Type*, int);
   103  void	nodindreg(Node*, Type*, int);
   104  void	nodconst(Node*, Type*, int64);
   105  void	gconreg(int, vlong, int);
   106  void	buildtxt(void);
   107  Plist*	newplist(void);
   108  int	isfat(Type*);
   109  void	sudoclean(void);
   110  int	sudoaddable(int, Node*, Addr*);
   111  int	dotaddable(Node*, Node*);
   112  void	afunclit(Addr*, Node*);
   113  void	split64(Node*, Node*, Node*);
   114  void	splitclean(void);
   115  void	nswap(Node*, Node*);
   116  void	gtrack(Sym*);
   117  /*
   118   * cplx.c
   119   */
   120  int	complexop(Node*, Node*);
   121  void	complexmove(Node*, Node*);
   122  void	complexgen(Node*, Node*);
   123  
   124  /*
   125   * gobj.c
   126   */
   127  void	datastring(char*, int, Addr*);
   128  void	datagostring(Strlit*, Addr*);
   129  
   130  /*
   131   * list.c
   132   */
   133  void	listinit(void);
   134  
   135  void	zaddr(Biobuf*, Addr*, int, int);