cpupi.pas 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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
  27. 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 TSparcprocinfo.create;
  41. begin
  42. inherited create;
  43. maxpushedparasize:=0;
  44. localsize:=0;
  45. end;
  46. procedure TSparcprocinfo.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 TSparcprocinfo.after_pass1;
  52. begin
  53. procdef.parast.address_fixup:=align(maxpushedparasize,16);
  54. WriteLn('Parameter copies start at: %i6+'+tostr(procdef.parast.address_fixup));
  55. procdef.localst.address_fixup:=align(procdef.parast.address_fixup+procdef.parast.datasize,16);
  56. WriteLn(strpnew('Locals start at: %o6+'+tostr(procdef.localst.address_fixup)));
  57. procinfo.firsttemp_offset:=align(procdef.localst.address_fixup+procdef.localst.datasize,16);
  58. WriteLn('Temp. space start: %o6+'+tostr(procinfo.firsttemp_offset));
  59. tg.firsttemp:=procinfo.firsttemp_offset;
  60. tg.lasttemp:=procinfo.firsttemp_offset;
  61. end;
  62. begin
  63. cprocinfo:=TSparcprocinfo;
  64. end.
  65. {
  66. $Log$
  67. Revision 1.4 2002-10-20 19:01:38 mazen
  68. + op_raddr_reg and op_caddr_reg added to fix functions prologue
  69. Revision 1.3 2002/10/10 15:10:39 mazen
  70. * Internal error fixed, but usually i386 parameter model used
  71. Revision 1.2 2002/08/29 11:02:36 mazen
  72. added support for SPARC processors
  73. Revision 1.1 2002/08/23 10:08:28 mazen
  74. *** empty log message ***
  75. Revision 1.2 2002/08/18 20:06:30 peter
  76. * inlining is now also allowed in interface
  77. * renamed write/load to ppuwrite/ppuload
  78. * tnode storing in ppu
  79. * nld,ncon,nbas are already updated for storing in ppu
  80. Revision 1.1 2002/08/17 09:23:49 florian
  81. * first part of procinfo rewrite
  82. }