2
0

aoptcpub.pas 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Jonas Maebe, member of the Free Pascal
  4. Development Team
  5. This unit contains several types and constants necessary for the
  6. optimizer to work on the 80x86 architecture
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. ****************************************************************************
  19. }
  20. Unit aoptcpub; { Assembler OPTimizer CPU specific Base }
  21. { enable the following define if memory references can have both a base and }
  22. { index register in 1 operand }
  23. {$define RefsHaveIndexReg}
  24. { enable the following define if memory references can have a scaled index }
  25. { define RefsHaveScale}
  26. { enable the following define if memory references can have a segment }
  27. { override }
  28. { define RefsHaveSegment}
  29. Interface
  30. Uses
  31. aasmcpu,AOptBase;
  32. Type
  33. { type of a normal instruction }
  34. TInstr = Taicpu;
  35. PInstr = ^TInstr;
  36. { ************************************************************************* }
  37. { **************************** TCondRegs ********************************** }
  38. { ************************************************************************* }
  39. { Info about the conditional registers }
  40. TCondRegs = Object
  41. Constructor Init;
  42. Destructor Done;
  43. End;
  44. { ************************************************************************* }
  45. { **************************** TAoptBaseCpu ******************************* }
  46. { ************************************************************************* }
  47. TAoptBaseCpu = Object(TAoptBase)
  48. End;
  49. { ************************************************************************* }
  50. { ******************************* Constants ******************************* }
  51. { ************************************************************************* }
  52. Const
  53. { the maximum number of things (registers, memory, ...) a single instruction }
  54. { changes }
  55. MaxCh = 3;
  56. { the maximum number of operands an instruction has }
  57. MaxOps = 3;
  58. {Oper index of operand that contains the source (reference) with a load }
  59. {instruction }
  60. LoadSrc = 0;
  61. {Oper index of operand that contains the destination (register) with a load }
  62. {instruction }
  63. LoadDst = 1;
  64. {Oper index of operand that contains the source (register) with a store }
  65. {instruction }
  66. StoreSrc = 0;
  67. {Oper index of operand that contains the destination (reference) with a load }
  68. {instruction }
  69. StoreDst = 1;
  70. Implementation
  71. { ************************************************************************* }
  72. { **************************** TCondRegs ********************************** }
  73. { ************************************************************************* }
  74. Constructor TCondRegs.init;
  75. Begin
  76. End;
  77. Destructor TCondRegs.Done; {$ifdef inl} inline; {$endif inl}
  78. Begin
  79. End;
  80. End.
  81. {
  82. $Log$
  83. Revision 1.5 2002-07-07 09:44:31 florian
  84. * powerpc target fixed, very simple units can be compiled
  85. Revision 1.4 2002/05/18 13:34:26 peter
  86. * readded missing revisions
  87. Revision 1.3 2002/05/16 19:46:52 carl
  88. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  89. + try to fix temp allocation (still in ifdef)
  90. + generic constructor calls
  91. + start of tassembler / tmodulebase class cleanup
  92. }