Pristine Ack-5.5
[Ack-5.5.git] / util / ego / share / global.h
1 /* $Id: global.h,v 1.7 1994/06/24 10:30:02 ceriel Exp $ */
2 /*
3  * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4  * See the copyright notice in the ACK home directory, in the file "Copyright".
5  */
6 /*  G L O B A L   V A R I A B L E S   */
7
8 /* sizes of TARGET machine */
9
10 extern int ps;          /* pointer size */
11 extern int ws;          /* word size    */
12
13 /* sizes of SOURCE machine (i.e. machine on which
14  * the optimizer runs)
15  */
16
17 /* number of bits in a byte */
18 #define BYTELENGTH 8
19
20 #if BYTELENGTH==8
21 #define DIVBL(a)        ((a) >> 3)
22 #define MODBL(a)        ((a) & (int)07)
23 #else
24 #define DIVBL(a)        (a/BYTELENGTH)
25 #define MODBL(a)        (a%BYTELENGTH)
26 #endif
27
28 #define WORDLENGTH      (sizeof(int)*BYTELENGTH)
29
30 #define DIVWL(a)        (WORDLENGTH==16 ? \
31                           ((a)>>4) : \
32                           (WORDLENGTH==32 ? \
33                             ((a)>>5) : \
34                             ((a)/(8*(int)sizeof(int)))))
35 #define MODWL(a)        (WORDLENGTH==16 ? \
36                           ((a)&(int)017) : \
37                           (WORDLENGTH==32 ? \
38                             ((a)&(int)037) : \
39                             ((a)%(8*(int)sizeof(int)))))
40
41 #define UNKNOWN_SIZE (-1)
42
43 extern proc_p curproc;  /* current procedure */
44
45 extern char *filename; /* name of current input file */
46
47 extern lset mesregs;    /* set of MES ms_reg pseudos */
48
49 extern short time_space_ratio; /* 0   if optimizing for space only,
50                                  * 100 if optimizing for time only,
51                                  * else something 'in between'.
52                                  */