2 #include "../8c/8.out.h"
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 long continpc;
144 EXTERN long maxargsafe;
148 EXTERN Node* nodsafe;
149 EXTERN long nrathole;
154 EXTERN Node fregnode0;
155 EXTERN Node fregnode1;
156 EXTERN char string[NSNAME];
157 EXTERN Sym* symrathole;
160 EXTERN int reg[D_NONE];
161 EXTERN long exregoffset;
162 EXTERN long exfregoffset;
164 #define BLOAD(r) band(bnot(r->refbehind), r->refahead)
165 #define BSTORE(r) band(bnot(r->calbehind), r->calahead)
166 #define LOAD(r) (~r->refbehind.b[z] & r->refahead.b[z])
167 #define STORE(r) (~r->calbehind.b[z] & r->calahead.b[z])
169 #define bset(a,n) ((a).b[(n)/32]&(1L<<(n)%32))
176 EXTERN Rgn region[NRGN];
187 EXTERN long exregbits;
196 EXTERN Var var[NVAR];
201 extern char* anames[];
206 void codgen(Node*, Node*);
209 void usedset(Node*, int);
212 int bcomplex(Node*, Node*);
217 void zeroregm(Node*);
218 void cgen(Node*, Node*);
219 void reglcgen(Node*, Node*, Node*);
220 void lcgen(Node*, Node*);
221 void bcgen(Node*, int);
222 void boolgen(Node*, int, Node*);
223 void sugen(Node*, Node*, long);
224 int needreg(Node*, int);
229 int vaddr(Node*, int);
230 void loadpair(Node*, Node*);
231 int cgen64(Node*, Node*);
232 void testv(Node*, int);
240 void gargs(Node*, Node*, Node*);
241 void garg1(Node*, Node*, Node*, int, Node**);
242 Node* nodconst(long);
244 Node* nodfconst(double);
245 int nodreg(Node*, Node*, int);
246 int isreg(Node*, int);
247 void regret(Node*, Node*);
248 void regalloc(Node*, Node*, Node*);
250 void regialloc(Node*, Node*, Node*);
251 void regsalloc(Node*, Node*);
252 void regaalloc1(Node*, Node*);
253 void regaalloc(Node*, Node*);
254 void regind(Node*, Node*);
255 void gprep(Node*, Node*);
256 void naddr(Node*, Adr*);
257 void gmove(Node*, Node*);
258 void gins(int a, Node*, Node*);
259 void fgopcode(int, Node*, Node*, int, int);
260 void gopcode(int, Type*, Node*, Node*);
261 int samaddr(Node*, Node*);
263 void patch(Prog*, long);
265 void gpseudo(int, Sym*, Node*);
270 int swcmp(const void*, const void*);
272 void swit1(C1*, int, long, Node*);
274 void bitload(Node*, Node*, Node*, Node*, Node*);
275 void bitstore(Node*, Node*, Node*, Node*, Node*);
276 long outstring(char*, long);
277 void nullwarn(Node*, Node*);
278 void sextern(Sym*, Node*, long, long);
279 void gextern(Sym*, Node*, long, long);
281 void ieeedtod(Ieee*, double);
299 int rcmp(const void*, const void*);
301 void addmove(Reg*, int, int, int);
302 Bits mkvar(Reg*, Adr*, int);
303 void prop(Reg*, Bits, Bits);
304 void loopit(Reg*, long);
305 void synch(Reg*, Bits);
306 ulong allreg(ulong, Rgn*);
307 void paint1(Reg*, int);
308 ulong paint2(Reg*, int);
309 void paint3(Reg*, int, long, int);
310 void addreg(Adr*, int);
323 int copy1(Adr*, Adr*, Reg*, int);
324 int copyu(Prog*, Adr*, Adr*);
326 int copyas(Adr*, Adr*);
327 int copyau(Adr*, Adr*);
328 int copysub(Adr*, Adr*, Adr*, int);
329 int copysub1(Prog*, Adr*, Adr*, int);
344 void com64init(void);
354 void sdivgen(Node*, Node*, Node*, Node*);
355 void udivgen(Node*, Node*, Node*, Node*);
356 void sdiv2(long, int, Node*, Node*);
357 void smod2(long, int, Node*, Node*);
358 void mulgen(Type*, Node*, Node*);
359 void genmuladd(Node*, Node*, int, Node*);
360 void shiftit(Type*, Node*, Node*);
362 #pragma varargck type "A" int
363 #pragma varargck type "B" Bits
364 #pragma varargck type "D" Adr*
365 #pragma varargck type "P" Prog*
366 #pragma varargck type "R" int
367 #pragma varargck type "S" char*
369 /* wrecklessly steal a field */