cpupi.pas 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. {*****************************************************************************
  2. $Id$
  3. Copyright (c) 2002 by Florian Klaempfl
  4. This unit contains the CPU specific part of tprocinfo
  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. { This unit contains the CPU specific part of tprocinfo. }
  18. unit cpupi;
  19. {$INCLUDE fpcdefs.inc}
  20. interface
  21. uses
  22. cutils,
  23. cgbase,cpuinfo;
  24. type
  25. TSparcprocinfo=class(TProcInfo)
  26. {overall size of allocated stack space, currently this is used for the PowerPC only}
  27. localsize:aword;
  28. {max. of space need for parameters, currently used by the PowerPC port only}
  29. maxpushedparasize:aword;
  30. constructor create;override;
  31. procedure after_header;override;
  32. procedure after_pass1;override;
  33. end;
  34. implementation
  35. uses
  36. globtype,globals,
  37. aasmtai,
  38. tgobj;
  39. constructor TSparcprocinfo.create;
  40. begin
  41. inherited create;
  42. maxpushedparasize:=0;
  43. localsize:=0;
  44. end;
  45. procedure TSparcprocinfo.after_header;
  46. begin
  47. { this value is necessary for nested procedures }
  48. procdef.localst.address_fixup:=align(procdef.parast.datasize,16);
  49. end;
  50. procedure TSparcprocinfo.after_pass1;
  51. begin
  52. procdef.parast.address_fixup:=align(maxpushedparasize,16);
  53. if cs_asm_source in aktglobalswitches
  54. then
  55. aktproccode.insert(Tai_comment.Create(strpnew('Parameter copies start at: %i6+'+tostr(procdef.parast.address_fixup))));
  56. procdef.localst.address_fixup:=align(procdef.parast.address_fixup+procdef.parast.datasize,16);
  57. if cs_asm_source in aktglobalswitches
  58. then
  59. aktproccode.insert(Tai_comment.Create(strpnew('Locals start at: %o6+'+tostr(procdef.localst.address_fixup))));
  60. procinfo.firsttemp_offset:=align(procdef.localst.address_fixup+procdef.localst.datasize,16);
  61. if cs_asm_source in aktglobalswitches
  62. then
  63. aktproccode.insert(Tai_comment.Create(strpnew('Temp. space start: %o6+'+tostr(procinfo.firsttemp_offset))));
  64. tg.firsttemp:=procinfo.firsttemp_offset;
  65. tg.lasttemp:=procinfo.firsttemp_offset;
  66. end;
  67. begin
  68. cprocinfo:=TSparcprocinfo;
  69. end.
  70. {
  71. $Log$
  72. Revision 1.3 2002-10-10 15:10:39 mazen
  73. * Internal error fixed, but usually i386 parameter model used
  74. Revision 1.2 2002/08/29 11:02:36 mazen
  75. added support for SPARC processors
  76. Revision 1.1 2002/08/23 10:08:28 mazen
  77. *** empty log message ***
  78. Revision 1.2 2002/08/18 20:06:30 peter
  79. * inlining is now also allowed in interface
  80. * renamed write/load to ppuwrite/ppuload
  81. * tnode storing in ppu
  82. * nld,ncon,nbas are already updated for storing in ppu
  83. Revision 1.1 2002/08/17 09:23:49 florian
  84. * first part of procinfo rewrite
  85. }