tgcpu.pas 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. {
  2. $Id$
  3. Copyright (C) 1998-2000 by Florian Klaempfl
  4. This unit handles the temporary variables stuff for PowerPC
  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 tgcpu;
  19. interface
  20. uses
  21. globals,
  22. cgbase,verbose,aasm,
  23. node,
  24. cpuinfo,cpubase,cpuasm;
  25. const
  26. { this value is used in tsaved, if the register isn't saved }
  27. reg_not_saved = $7fffffff;
  28. type
  29. tpushed = array[R_NO..R_NO] of boolean;
  30. tsaved = array[R_NO..R_NO] of longint;
  31. var
  32. { tries to hold the amount of times which the current tree is processed }
  33. t_times : longint;
  34. function getregisterint : tregister;
  35. procedure ungetregisterint(r : tregister);
  36. { tries to allocate the passed register, if possible }
  37. function getexplicitregisterint(r : tregister) : tregister;
  38. function getregisterfpu : tregister;
  39. function ungetregisterfpu : tregister;
  40. procedure ungetregister(r : tregister);
  41. procedure cleartempgen;
  42. procedure del_reference(const ref : treference);
  43. procedure del_locref(const location : tlocation);
  44. procedure del_location(const l : tlocation);
  45. { pushs and restores registers }
  46. procedure pushusedregisters(var pushed : tpushed;b : byte);
  47. procedure popusedregisters(const pushed : tpushed);
  48. { saves and restores used registers to temp. values }
  49. procedure saveusedregisters(var saved : tsaved;b : byte);
  50. procedure restoreusedregisters(const saved : tsaved);
  51. { increments the push count of all registers in b}
  52. procedure incrementregisterpushed(regs : tregisterset);
  53. procedure clearregistercount;
  54. procedure resetusableregisters;
  55. type
  56. regvar_longintarray = array[0..32+32-1] of longint;
  57. regvar_booleanarray = array[0..32+32-1] of boolean;
  58. regvar_ptreearray = array[0..32+32-1] of tnode;
  59. var
  60. unused,usableregs : tregisterset;
  61. usedinproc : set of TREGISTER;
  62. { count, how much a register must be pushed if it is used as register }
  63. { variable }
  64. reg_pushes : regvar_longintarray;
  65. is_reg_var : regvar_booleanarray;
  66. implementation
  67. uses
  68. globtype,temp_gen;
  69. function getregisterint : tregister;
  70. begin
  71. end;
  72. procedure ungetregisterint(r : tregister);
  73. begin
  74. end;
  75. { tries to allocate the passed register, if possible }
  76. function getexplicitregisterint(r : tregister) : tregister;
  77. begin
  78. end;
  79. function getregisterfpu : tregister;
  80. begin
  81. end;
  82. function ungetregisterfpu : tregister;
  83. begin
  84. end;
  85. procedure ungetregister(r : tregister);
  86. begin
  87. end;
  88. procedure cleartempgen;
  89. begin
  90. end;
  91. procedure del_reference(const ref : treference);
  92. begin
  93. end;
  94. procedure del_locref(const location : tlocation);
  95. begin
  96. end;
  97. procedure del_location(const l : tlocation);
  98. begin
  99. end;
  100. { pushs and restores registers }
  101. procedure pushusedregisters(var pushed : tpushed;b : byte);
  102. begin
  103. end;
  104. procedure popusedregisters(const pushed : tpushed);
  105. begin
  106. end;
  107. { saves and restores used registers to temp. values }
  108. procedure saveusedregisters(var saved : tsaved;b : byte);
  109. begin
  110. end;
  111. procedure restoreusedregisters(const saved : tsaved);
  112. begin
  113. end;
  114. { increments the push count of all registers in b}
  115. procedure incrementregisterpushed(regs : tregisterset);
  116. begin
  117. end;
  118. procedure clearregistercount;
  119. begin
  120. end;
  121. procedure resetusableregisters;
  122. begin
  123. end;
  124. begin
  125. resetusableregisters;
  126. end.
  127. {
  128. $Log$
  129. Revision 1.2 2001-12-29 15:28:58 jonas
  130. * powerpc/cgcpu.pas compiles :)
  131. * several powerpc-related fixes
  132. * cpuasm unit is now based on common tainst unit
  133. + nppcmat unit for powerpc (almost complete)
  134. Revision 1.1 2001/08/26 13:31:04 florian
  135. * some cg reorganisation
  136. * some PPC updates
  137. Revision 1.2 2001/08/26 13:23:23 florian
  138. * some cg reorganisation
  139. * some PPC updates
  140. Revision 1.1 2000/07/13 06:30:13 michael
  141. + Initial import
  142. Revision 1.3 2000/01/07 01:14:58 peter
  143. * updated copyright to 2000
  144. Revision 1.2 1999/08/04 12:59:26 jonas
  145. * all tokes now start with an underscore
  146. * PowerPC compiles!!
  147. Revision 1.1 1999/08/03 23:37:53 jonas
  148. + initial implementation for PowerPC based on the Alpha stuff
  149. }