cgbase.pas 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl
  4. This units implements some code generator helper routines
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit cgbase;
  19. interface
  20. type
  21. TOpCg = (OP_ADD,OP_AND,OP_DIV,OP_IDIV,OP_IMUL,OP_MUL,OP_NEG,OP_NOT,
  22. OP_OR,OP_SAR,OP_SHL,OP_SHR,OP_SUB,OP_XOR);
  23. TOpCmp = (OC_NONE,OC_EQ,OC_GT,OC_LT,OC_GTE,OC_LTE,OC_NE,OC_BE,OC_B,
  24. OC_AE,OC_A);
  25. TCgSize = (OS_NO,OS_8,OS_16,OS_32,OS_64);
  26. const
  27. { defines the default address size for a processor }
  28. { and defines the natural int size for a processor }
  29. {$ifdef i386}
  30. OS_ADDR = OS_32;
  31. OS_INT = OS_32;
  32. {$endif i386}
  33. {$ifdef alpha}
  34. OS_ADDR = OS_64;
  35. OS_INT = OS_64;
  36. {$endif alpha}
  37. {$ifdef powerpc}
  38. OS_ADDR = OS_32;
  39. OS_INT = OS_32;
  40. {$endif powercc}
  41. {$ifdef ia64}
  42. OS_ADDR = OS_64;
  43. OS_INT = OS_64;
  44. {$endif ia64}
  45. implementation
  46. end.
  47. {
  48. $Log$
  49. Revision 1.2 2000-11-29 00:30:51 florian
  50. * unused units removed from uses clause
  51. * some changes for widestrings
  52. Revision 1.1 2000/07/13 06:30:07 michael
  53. + Initial import
  54. Revision 1.19 2000/03/11 21:11:24 daniel
  55. * Ported hcgdata to new symtable.
  56. * Alignment code changed as suggested by Peter
  57. + Usage of my is operator replacement, is_object
  58. Revision 1.18 2000/02/28 17:23:58 daniel
  59. * Current work of symtable integration committed. The symtable can be
  60. activated by defining 'newst', but doesn't compile yet. Changes in type
  61. checking and oop are completed. What is left is to write a new
  62. symtablestack and adapt the parser to use it.
  63. Revision 1.17 2000/02/20 20:49:46 florian
  64. * newcg is compiling
  65. * fixed the dup id problem reported by Paul Y.
  66. Revision 1.16 2000/02/17 14:48:36 florian
  67. * updated to use old firstpass
  68. Revision 1.15 2000/01/07 01:14:52 peter
  69. * updated copyright to 2000
  70. Revision 1.14 1999/12/24 22:47:42 jonas
  71. * added OC_NONE to the compare forms (to allow unconditional jumps)
  72. Revision 1.13 1999/12/01 12:42:33 peter
  73. * fixed bug 698
  74. * removed some notes about unused vars
  75. Revision 1.12 1999/11/05 13:15:00 florian
  76. * some fixes to get the new cg compiling again
  77. Revision 1.11 1999/10/14 14:57:54 florian
  78. - removed the hcodegen use in the new cg, use cgbase instead
  79. Revision 1.10 1999/10/12 21:20:46 florian
  80. * new codegenerator compiles again
  81. Revision 1.9 1999/09/10 18:48:11 florian
  82. * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
  83. * most things for stored properties fixed
  84. Revision 1.8 1999/08/06 13:26:49 florian
  85. * more changes ...
  86. Revision 1.7 1999/08/05 14:58:10 florian
  87. * some fixes for the floating point registers
  88. * more things for the new code generator
  89. Revision 1.6 1999/08/04 00:23:51 florian
  90. * renamed i386asm and i386base to cpuasm and cpubase
  91. Revision 1.5 1999/08/01 18:22:32 florian
  92. * made it again compilable
  93. Revision 1.4 1999/01/23 23:29:45 florian
  94. * first running version of the new code generator
  95. * when compiling exceptions under Linux fixed
  96. Revision 1.3 1999/01/06 22:58:48 florian
  97. + some stuff for the new code generator
  98. Revision 1.2 1998/12/26 15:20:28 florian
  99. + more changes for the new version
  100. Revision 1.1 1998/12/15 22:18:55 florian
  101. * some code added
  102. }