cginfo.pas 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl
  4. This unit exports some types and constants for the code generation
  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 cginfo;
  19. {$i defines.inc}
  20. interface
  21. type
  22. TOpCg = (OP_NONE,
  23. OP_ADD,OP_AND,OP_DIV,OP_IDIV,OP_IMUL,OP_MUL,OP_NEG,OP_NOT,
  24. OP_OR,OP_SAR,OP_SHL,OP_SHR,OP_SUB,OP_XOR
  25. );
  26. TOpCmp = (OC_NONE,OC_EQ,OC_GT,OC_LT,OC_GTE,OC_LTE,OC_NE,OC_BE,OC_B,
  27. OC_AE,OC_A);
  28. { OS_NO is also used memory references with large data that can
  29. not be loaded in a register directly }
  30. TCgSize = (OS_NO,
  31. { integer registers }
  32. OS_8,OS_16,OS_32,OS_64,OS_S8,OS_S16,OS_S32,OS_S64,
  33. { single,double,extended,comp }
  34. OS_F32,OS_F64,OS_F80,OS_C64,
  35. { multi-media sizes: split in byte, word, dword, ... }
  36. { entities, then the signed counterparts }
  37. OS_M8,OS_M16,OS_M32,OS_M64,OS_M128,OS_MS8,OS_MS16,OS_MS32,
  38. OS_MS64,OS_MS128);
  39. const
  40. { defines the default address size for a processor, }
  41. { the natural int size for a processor, }
  42. { the maximum float size for a processor, }
  43. { the size of a vector register for a processor }
  44. {$ifdef i386}
  45. OS_ADDR = OS_32;
  46. OS_INT = OS_32;
  47. OS_FLOAT = OS_F80;
  48. OS_VECTOR = OS_M64;
  49. {$endif i386}
  50. {$ifdef m68k}
  51. OS_ADDR = OS_32;
  52. OS_INT = OS_32;
  53. OS_FLOAT = OS_F??; { processor supports 64bit, but does the compiler? }
  54. OS_VECTOR = OS_NO;
  55. {$endif m68k}
  56. {$ifdef alpha}
  57. OS_ADDR = OS_64;
  58. OS_INT = OS_64;
  59. OS_FLOAT = OS_F??;
  60. OS_VECTOR = OS_NO;
  61. {$endif alpha}
  62. {$ifdef powerpc}
  63. OS_ADDR = OS_32;
  64. OS_INT = OS_32;
  65. OS_FLOAT = OS_F64;
  66. OS_VECTOR = OS_M128;
  67. {$endif powercc}
  68. {$ifdef ia64}
  69. OS_ADDR = OS_64;
  70. OS_INT = OS_64;
  71. OS_FLOAT = OS_F??;
  72. OS_VECTOR = OS_NO; { the normal registers can also be used as vectors }
  73. {$endif ia64}
  74. const
  75. TCGSize2Size : Array[tcgsize] of integer =
  76. (0,1,2,4,8,1,2,4,8,
  77. 4,8,10,8,
  78. 1,2,4,8,16,1,2,4,8,16);
  79. implementation
  80. end.
  81. {
  82. $Log$
  83. Revision 1.2 2002-04-19 15:46:01 peter
  84. * mangledname rewrite, tprocdef.mangledname is now created dynamicly
  85. in most cases and not written to the ppu
  86. * add mangeledname_prefix() routine to generate the prefix of
  87. manglednames depending on the current procedure, object and module
  88. * removed static procprefix since the mangledname is now build only
  89. on demand from tprocdef.mangledname
  90. Revision 1.1 2002/04/02 18:09:47 jonas
  91. + initial implementation (Peter forgot to commit it)
  92. }