2
0

aoptcpub.pas 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. {
  2. Copyright (c) 1998-2009 by Jonas Maebe and David Zhang
  3. This unit contains several types and constants necessary for the
  4. optimizer to work on the MIPSEL architecture
  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 aoptcpub; { Assembler OPTimizer CPU specific Base }
  19. {$i fpcdefs.inc}
  20. { enable the following define if memory references can have both a base and }
  21. { index register in 1 operand }
  22. {$define RefsHaveIndexReg}
  23. { enable the following define if memory references can have a scaled index }
  24. { define RefsHaveScale}
  25. { enable the following define if memory references can have a segment }
  26. { override }
  27. { define RefsHaveSegment}
  28. Interface
  29. Uses
  30. cpubase,aasmcpu,AOptBase;
  31. Type
  32. { type of a normal instruction }
  33. TInstr = Taicpu;
  34. PInstr = ^TInstr;
  35. { ************************************************************************* }
  36. { **************************** TCondRegs ********************************** }
  37. { ************************************************************************* }
  38. { Info about the conditional registers }
  39. TCondRegs = Object
  40. Constructor Init;
  41. Destructor Done;
  42. End;
  43. { ************************************************************************* }
  44. { **************************** TAoptBaseCpu ******************************* }
  45. { ************************************************************************* }
  46. TAoptBaseCpu = class(TAoptBase)
  47. End;
  48. { ************************************************************************* }
  49. { ******************************* Constants ******************************* }
  50. { ************************************************************************* }
  51. Const
  52. { the maximum number of things (registers, memory, ...) a single instruction }
  53. { changes }
  54. MaxCh = 3;
  55. { the maximum number of operands an instruction has }
  56. MaxOps = 3;
  57. {Oper index of operand that contains the source (reference) with a load }
  58. {instruction }
  59. LoadSrc = 0;
  60. {Oper index of operand that contains the destination (register) with a load }
  61. {instruction }
  62. LoadDst = 1;
  63. {Oper index of operand that contains the source (register) with a store }
  64. {instruction }
  65. StoreSrc = 0;
  66. {Oper index of operand that contains the destination (reference) with a load }
  67. {instruction }
  68. StoreDst = 1;
  69. aopt_uncondjmp = A_J;
  70. aopt_condjmp = A_BEQ;
  71. Implementation
  72. { ************************************************************************* }
  73. { **************************** TCondRegs ********************************** }
  74. { ************************************************************************* }
  75. Constructor TCondRegs.init;
  76. Begin
  77. End;
  78. Destructor TCondRegs.Done; {$ifdef inl} inline; {$endif inl}
  79. Begin
  80. End;
  81. End.