arith.h.new 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef LANG_CEM_CEMCOM_ANSI_ARITH_H
  2. #define LANG_CEM_CEMCOM_ANSI_ARITH_H
  3. /*
  4. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  5. * See the copyright notice in the ACK home directory, in the file "Copyright".
  6. */
  7. /* $Id$ */
  8. /* COMPILER ARITHMETIC */
  9. /* Normally the compiler does its internal arithmetics in longs
  10. native to the source machine, which is always good for local
  11. compilations, and generally OK too for cross compilations
  12. downwards and sidewards. For upwards cross compilation and
  13. to save storage on small machines, SPECIAL_ARITHMETICS will
  14. be handy.
  15. */
  16. #include "spec_arith.h"
  17. #ifndef SPECIAL_ARITHMETICS
  18. #include <em_arith.h> /* obtain definition of "arith" */
  19. #else /* SPECIAL_ARITHMETICS */
  20. /* All preprocessor arithmetic should be done in longs.
  21. */
  22. #include <stdint.h>
  23. typedef int32_t arith; /* dummy */
  24. #endif /* SPECIAL_ARITHMETICS */
  25. #define arith_size (sizeof(arith))
  26. #define arith_sign ((arith) 1 << (arith_size * 8 - 1))
  27. #define max_arith (~arith_sign)
  28. struct expr;
  29. struct type;
  30. /* lang/cem/cemcom.ansi/arith.c */
  31. void arithbalance(struct expr **e1p, int oper, struct expr **e2p);
  32. void relbalance(struct expr **e1p, int oper, struct expr **e2p);
  33. void ch3pointer(struct expr **expp, int oper, struct type *tp);
  34. int any2arith(struct expr **expp, int oper);
  35. void erroneous2int(struct expr **expp);
  36. struct expr *arith2arith(struct type *tp, int oper, struct expr *expr);
  37. int int2int(struct expr **expp, struct type *tp);
  38. void int2float(struct expr **expp, struct type *tp);
  39. void float2int(struct expr **expp, struct type *tp);
  40. void float2float(struct expr **expp, struct type *tp);
  41. void array2pointer(struct expr *exp);
  42. void function2pointer(struct expr *exp);
  43. void string2pointer(struct expr *ex);
  44. void opnd2integral(struct expr **expp, int oper);
  45. void opnd2logical(struct expr **expp, int oper);
  46. void opnd2test(struct expr **expp, int oper);
  47. void any2opnd(struct expr **expp, int oper);
  48. void any2parameter(struct expr **expp);
  49. void field2arith(struct expr **expp);
  50. void switch_sign_fp(struct expr *expr);
  51. #endif /* LANG_CEM_CEMCOM_ANSI_ARITH_H */