rgcpu.pas 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. unit rgcpu;
  19. {$INCLUDE fpcdefs.inc}
  20. interface
  21. uses
  22. cpubase,
  23. cpuinfo,
  24. aasmcpu,
  25. aasmtai,
  26. cclasses,globtype,cgbase,aasmbase,rgobj;
  27. type
  28. trgcpu=class(trgobj)
  29. { to keep the same allocation order as with the old routines }
  30. procedure UngetregisterInt(list:taasmoutput;Reg:tregister);override;
  31. function GetExplicitRegisterInt(list:taasmoutput;Reg:tregister):tregister;override;
  32. end;
  33. implementation
  34. uses
  35. cgobj;
  36. function trgcpu.GetExplicitRegisterInt(list:taasmoutput;reg:tregister):tregister;
  37. begin
  38. if reg = R_i0
  39. then
  40. begin
  41. cg.a_reg_alloc(list,Reg);
  42. result := Reg;
  43. end
  44. else result := inherited GetExplicitRegisterInt(list,reg);
  45. end;
  46. procedure trgcpu.UngetregisterInt(list: taasmoutput; reg: tregister);
  47. begin
  48. if reg = R_i0
  49. then
  50. cg.a_reg_dealloc(list,reg)
  51. else
  52. inherited ungetregisterint(list,reg);
  53. end;
  54. initialization
  55. rg := trgcpu.create;
  56. end.
  57. {
  58. $Log$
  59. Revision 1.2 2002-10-11 13:35:14 mazen
  60. *** empty log message ***
  61. }