optbase.pas 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by the Free Pascal development team
  4. This routine contains the basic tables and information
  5. for the generic optimizers and cpu specific optimizations.
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. {# This unit should define cpu specific information which is required
  20. for the optimizers.
  21. }
  22. unit optbase;
  23. interface
  24. uses cpuinfo, cpubase;
  25. {*****************************************************************************
  26. Opcode propeties (needed for optimizer)
  27. *****************************************************************************}
  28. {$ifndef NOOPT}
  29. Type
  30. {What an instruction can change}
  31. TInsChange = (Ch_None,
  32. {Read from a register}
  33. Ch_REAX, Ch_RECX, Ch_REDX, Ch_REBX, Ch_RESP, Ch_REBP, Ch_RESI, Ch_REDI,
  34. {write from a register}
  35. Ch_WEAX, Ch_WECX, Ch_WEDX, Ch_WEBX, Ch_WESP, Ch_WEBP, Ch_WESI, Ch_WEDI,
  36. {read and write from/to a register}
  37. Ch_RWEAX, Ch_RWECX, Ch_RWEDX, Ch_RWEBX, Ch_RWESP, Ch_RWEBP, Ch_RWESI, Ch_RWEDI,
  38. {modify the contents of a register with the purpose of using
  39. this changed content afterwards (add/sub/..., but e.g. not rep
  40. or movsd)}
  41. Ch_MEAX, Ch_MECX, Ch_MEDX, Ch_MEBX, Ch_MESP, Ch_MEBP, Ch_MESI, Ch_MEDI,
  42. Ch_CDirFlag {clear direction flag}, Ch_SDirFlag {set dir flag},
  43. Ch_RFlags, Ch_WFlags, Ch_RWFlags, Ch_FPU,
  44. Ch_Rop1, Ch_Wop1, Ch_RWop1,Ch_Mop1,
  45. Ch_Rop2, Ch_Wop2, Ch_RWop2,Ch_Mop2,
  46. Ch_Rop3, Ch_WOp3, Ch_RWOp3,Ch_Mop3,
  47. Ch_WMemEDI,
  48. Ch_All
  49. );
  50. const
  51. MaxCh = 3; { Max things a instruction can change }
  52. type
  53. TInsProp = packed record
  54. Ch : Array[1..MaxCh] of TInsChange;
  55. end;
  56. const
  57. InsProp : array[tasmop] of TInsProp =
  58. {$i i386prop.inc}
  59. {$endif NOOPT}
  60. implementation
  61. end.
  62. {
  63. $Log$
  64. Revision 1.3 2004-06-20 08:55:31 florian
  65. * logs truncated
  66. }