global.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* $Id$ */
  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. /* sizes of TARGET machine */
  8. extern int ps; /* pointer size */
  9. extern int ws; /* word size */
  10. /* sizes of SOURCE machine (i.e. machine on which
  11. * the optimizer runs)
  12. */
  13. /* number of bits in a byte */
  14. #define BYTELENGTH 8
  15. #if BYTELENGTH==8
  16. #define DIVBL(a) ((a) >> 3)
  17. #define MODBL(a) ((a) & (int)07)
  18. #else
  19. #define DIVBL(a) (a/BYTELENGTH)
  20. #define MODBL(a) (a%BYTELENGTH)
  21. #endif
  22. #define WORDLENGTH (sizeof(int)*BYTELENGTH)
  23. #define DIVWL(a) (WORDLENGTH==16 ? \
  24. ((a)>>4) : \
  25. (WORDLENGTH==32 ? \
  26. ((a)>>5) : \
  27. ((a)/(8*(int)sizeof(int)))))
  28. #define MODWL(a) (WORDLENGTH==16 ? \
  29. ((a)&(int)017) : \
  30. (WORDLENGTH==32 ? \
  31. ((a)&(int)037) : \
  32. ((a)%(8*(int)sizeof(int)))))
  33. #define UNKNOWN_SIZE (-1)
  34. extern proc_p curproc; /* current procedure */
  35. extern char *filename; /* name of current input file */
  36. extern lset mesregs; /* set of MES ms_reg pseudos */
  37. extern short time_space_ratio; /* 0 if optimizing for space only,
  38. * 100 if optimizing for time only,
  39. * else something 'in between'.
  40. */