rgcpu.pas 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. This unit implements the i386 specific class for the register
  5. allocator
  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. unit rgcpu;
  20. {$i fpcdefs.inc}
  21. interface
  22. uses
  23. cpubase,
  24. cpuinfo,
  25. aasmbase,aasmtai,
  26. cclasses,globtype,cgbase,rgobj,rgx86;
  27. type
  28. trgcpu = class(trgx86)
  29. procedure add_constraints(reg:Tregister);override;
  30. end;
  31. implementation
  32. uses
  33. systems,
  34. verbose;
  35. const
  36. { This value is used in tsaved. If the array value is equal
  37. to this, then this means that this register is not used.}
  38. reg_not_saved = $7fffffff;
  39. {************************************************************************
  40. trgcpu
  41. *************************************************************************}
  42. procedure trgcpu.add_constraints(reg:Tregister);
  43. var
  44. supreg : tsuperregister;
  45. begin
  46. if getsubreg(reg) in [R_SUBL,R_SUBH] then
  47. begin
  48. supreg:=getsupreg(reg);
  49. {These registers have no 8-bit subregister, so add interferences.}
  50. add_edge(supreg,RS_ESI);
  51. add_edge(supreg,RS_EDI);
  52. add_edge(supreg,RS_EBP);
  53. end;
  54. end;
  55. end.
  56. {
  57. $Log$
  58. Revision 1.43 2004-06-20 08:55:31 florian
  59. * logs truncated
  60. Revision 1.42 2004/01/12 16:39:40 peter
  61. * sparc updates, mostly float related
  62. }