cpupi.pas 3.3 KB

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