ncpucall.pas 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. {******************************************************************************
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Generate SPARC assembler for in call nodes
  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. UNIT ncpucall;
  18. {$INCLUDE fpcdefs.inc}
  19. interface
  20. uses
  21. symdef,node,ncal,ncgcal;
  22. type
  23. TSparcCallNode=class(TCgCallNode)
  24. function pass_1:TNode;override;
  25. {Under SPARC, the frame pointer is automatically set by the SAVE instruction
  26. which is part of the stardrad calling mechanism. This function will do nothing.
  27. the frame pointer register is the stack pointer register of the caller, and is
  28. set when generating function prologue in cgcpu.tcgSPARC.g_stackframe_entry}
  29. procedure load_framepointer;override;
  30. end;
  31. implementation
  32. uses
  33. globtype,systems,
  34. cutils,verbose,globals,
  35. symconst,symbase,symsym,symtable,defbase,paramgr,
  36. {$ifdef GDB}
  37. {$ifdef delphi}
  38. sysutils,
  39. {$else}
  40. strings,
  41. {$endif}
  42. gdb,
  43. {$endif GDB}
  44. cginfo,cgbase,pass_2,
  45. cpuinfo,cpubase,aasmbase,aasmtai,aasmcpu,
  46. nmem,nld,ncnv,
  47. ncgutil,cgobj,tgobj,regvars,rgobj,rgcpu,cg64f32,cgcpu,cpupi;
  48. function TSparcCallNode.pass_1:TNode;
  49. begin
  50. result:=inherited pass_1;
  51. if assigned(result)
  52. then
  53. exit;
  54. if ProcDefinition is TProcDef
  55. then
  56. begin
  57. if TProcDef(procdefinition).parast.datasize>TSparcProcInfo(procinfo).maxpushedparasize
  58. then
  59. TSparcProcInfo(procinfo).maxpushedparasize:=TProcdef(procdefinition).parast.datasize
  60. end
  61. else
  62. InternalError(2002101001);
  63. end;
  64. procedure TSparcCallNode.load_framepointer;
  65. begin
  66. InternalError(2002101000);
  67. end;
  68. begin
  69. ccallnode:=TSparcCallNode;
  70. end.
  71. {
  72. $Log$
  73. Revision 1.4 2002-10-10 19:57:52 mazen
  74. * Just to update repsitory
  75. Revision 1.3 2002/09/30 19:12:14 mazen
  76. * function prologue fixed
  77. Revision 1.2 2002/08/30 13:16:23 mazen
  78. *call parameter handling is now based on the new param manager
  79. Revision 1.2 2002/08/17 09:23:49 florian
  80. * first part of procinfo rewrite
  81. Revision 1.1 2002/08/13 21:40:59 florian
  82. * more fixes for ppc calling conventions
  83. }