2 #include "../6c/6.out.h"
6 * Intel 386 with AMD64 extensions
18 typedef struct Adr Adr;
19 typedef struct Prog Prog;
20 typedef struct Case Case;
22 typedef struct Var Var;
23 typedef struct Reg Reg;
24 typedef struct Rgn Rgn;
25 typedef struct Renv Renv;
46 uchar scale; /* doubles as width in DATA op */
88 long rpo; /* reverse post ordering */
102 long loop; /* could be shorter */
137 EXTERN Node constnode;
138 EXTERN Node fconstnode;
139 EXTERN Node vconstnode;
140 EXTERN long continpc;
145 EXTERN long maxargsafe;
149 EXTERN Node* nodsafe;
150 EXTERN long nrathole;
154 EXTERN Node lregnode;
155 EXTERN Node qregnode;
156 EXTERN char string[NSNAME];
157 EXTERN Sym* symrathole;
160 EXTERN int reg[D_NONE];
161 EXTERN long exregoffset;
162 EXTERN long exfregoffset;
163 EXTERN uchar typechlpv[NTYPE];
165 #define BLOAD(r) band(bnot(r->refbehind), r->refahead)
166 #define BSTORE(r) band(bnot(r->calbehind), r->calahead)
167 #define LOAD(r) (~r->refbehind.b[z] & r->refahead.b[z])
168 #define STORE(r) (~r->calbehind.b[z] & r->calahead.b[z])
170 #define bset(a,n) ((a).b[(n)/32]&(1L<<(n)%32))
177 EXTERN Rgn region[NRGN];
188 EXTERN long exregbits;
197 EXTERN Var var[NVAR];
202 extern char* anames[];
207 void codgen(Node*, Node*);
210 void usedset(Node*, int);
213 int bcomplex(Node*, Node*);
218 void zeroregm(Node*);
219 void cgen(Node*, Node*);
220 void reglcgen(Node*, Node*, Node*);
221 void lcgen(Node*, Node*);
222 void bcgen(Node*, int);
223 void boolgen(Node*, int, Node*);
224 void sugen(Node*, Node*, long);
225 int needreg(Node*, int);
226 int hardconst(Node*);
232 int vaddr(Node*, int);
233 void loadpair(Node*, Node*);
234 int cgen64(Node*, Node*);
235 void testv(Node*, int);
243 void gargs(Node*, Node*, Node*);
244 void garg1(Node*, Node*, Node*, int, Node**);
245 Node* nodconst(long);
246 Node* nodfconst(double);
247 Node* nodgconst(vlong, Type*);
248 int nodreg(Node*, Node*, int);
249 int isreg(Node*, int);
250 void regret(Node*, Node*);
251 void regalloc(Node*, Node*, Node*);
253 void regialloc(Node*, Node*, Node*);
254 void regsalloc(Node*, Node*);
255 void regaalloc1(Node*, Node*);
256 void regaalloc(Node*, Node*);
257 void regind(Node*, Node*);
258 void gprep(Node*, Node*);
259 void naddr(Node*, Adr*);
260 void gcmp(int, Node*, vlong);
261 void gmove(Node*, Node*);
262 void gins(int a, Node*, Node*);
263 void gopcode(int, Type*, Node*, Node*);
264 int samaddr(Node*, Node*);
266 void patch(Prog*, long);
268 void gpseudo(int, Sym*, Node*);
273 int swcmp(const void*, const void*);
275 void swit1(C1*, int, long, Node*);
277 void bitload(Node*, Node*, Node*, Node*, Node*);
278 void bitstore(Node*, Node*, Node*, Node*, Node*);
279 long outstring(char*, long);
280 void nullwarn(Node*, Node*);
281 void sextern(Sym*, Node*, long, long);
282 void gextern(Sym*, Node*, long, long);
284 void ieeedtod(Ieee*, double);
302 int rcmp(const void*, const void*);
304 void addmove(Reg*, int, int, int);
305 Bits mkvar(Reg*, Adr*);
306 void prop(Reg*, Bits, Bits);
307 void loopit(Reg*, long);
308 void synch(Reg*, Bits);
309 ulong allreg(ulong, Rgn*);
310 void paint1(Reg*, int);
311 ulong paint2(Reg*, int);
312 void paint3(Reg*, int, long, int);
313 void addreg(Adr*, int);
326 int copy1(Adr*, Adr*, Reg*, int);
327 int copyu(Prog*, Adr*, Adr*);
329 int copyas(Adr*, Adr*);
330 int copyau(Adr*, Adr*);
331 int copysub(Adr*, Adr*, Adr*, int);
332 int copysub1(Prog*, Adr*, Adr*, int);
342 #define isregtype(t) ((t)>= D_AX && (t)<=D_R15)
354 void com64init(void);
364 void sdivgen(Node*, Node*, Node*, Node*);
365 void udivgen(Node*, Node*, Node*, Node*);
366 void sdiv2(long, int, Node*, Node*);
367 void smod2(long, int, Node*, Node*);
368 void mulgen(Type*, Node*, Node*);
369 void genmuladd(Node*, Node*, int, Node*);
370 void shiftit(Type*, Node*, Node*);
372 #pragma varargck type "A" int
373 #pragma varargck type "B" Bits
374 #pragma varargck type "D" Adr*
375 #pragma varargck type "P" Prog*
376 #pragma varargck type "R" int
377 #pragma varargck type "S" char*
379 #define D_X7 (D_X0+7)
381 void fgopcode(int, Node*, Node*, int, int);