rgcpu.pas 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. This unit implements the powerpc 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. aasmbase,aasmtai,
  24. cpubase,
  25. rgobj;
  26. type
  27. trgcpu = class(trgobj)
  28. function getexplicitregisterint(list: taasmoutput; reg: tregister): tregister; override;
  29. procedure ungetregisterint(list: taasmoutput; reg: tregister); override;
  30. end;
  31. implementation
  32. uses
  33. cgobj;
  34. function trgcpu.getexplicitregisterint(list: taasmoutput; reg: tregister): tregister;
  35. begin
  36. if reg = R_0 then
  37. begin
  38. cg.a_reg_alloc(list,reg);
  39. result := reg;
  40. end
  41. else result := inherited getexplicitregisterint(list,reg);
  42. end;
  43. procedure trgcpu.ungetregisterint(list: taasmoutput; reg: tregister);
  44. begin
  45. if reg = R_0 then
  46. cg.a_reg_dealloc(list,reg)
  47. else
  48. inherited ungetregisterint(list,reg);
  49. end;
  50. initialization
  51. rg := trgcpu.create;
  52. end.
  53. {
  54. $Log$
  55. Revision 1.1 2002-09-29 23:42:45 florian
  56. * several fixes to get forward with alpha compilation
  57. Revision 1.3 2002/07/07 09:44:32 florian
  58. * powerpc target fixed, very simple units can be compiled
  59. Revision 1.2 2002/05/16 19:46:53 carl
  60. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  61. + try to fix temp allocation (still in ifdef)
  62. + generic constructor calls
  63. + start of tassembler / tmodulebase class cleanup
  64. Revision 1.1 2002/04/06 18:13:02 jonas
  65. * several powerpc-related additions and fixes
  66. }