ncpucall.pas 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 push_framepointer;override;
  30. end;
  31. implementation
  32. uses
  33. systems,
  34. cutils,verbose,
  35. paramgr,
  36. cgbase,
  37. nmem,nld,ncnv,
  38. cgobj,tgobj,rgobj,rgcpu,cgcpu,cpupi;
  39. function TSparcCallNode.pass_1:TNode;
  40. begin
  41. result:=inherited pass_1;
  42. if assigned(result)
  43. then
  44. exit;
  45. if ProcDefinition is TProcDef
  46. then
  47. with TProcDef(procdefinition).parast do
  48. if datasize>TSparcProcInfo(current_procinfo).maxpushedparasize
  49. then
  50. TSparcProcInfo(current_procinfo).maxpushedparasize:=datasize;
  51. end;
  52. procedure TSparcCallNode.push_framepointer;
  53. begin
  54. end;
  55. begin
  56. ccallnode:=TSparcCallNode;
  57. end.
  58. {
  59. $Log$
  60. Revision 1.12 2003-06-13 21:19:32 peter
  61. * current_procdef removed, use current_procinfo.procdef instead
  62. Revision 1.11 2003/04/28 09:49:58 mazen
  63. - InternalError removed from TSparcCallNode.push_framepointer as it is called by common coplier code.
  64. Revision 1.10 2003/04/27 11:21:36 peter
  65. * aktprocdef renamed to current_procinfo.procdef
  66. * procinfo renamed to current_procinfo
  67. * procinfo will now be stored in current_module so it can be
  68. cleaned up properly
  69. * gen_main_procsym changed to create_main_proc and release_main_proc
  70. to also generate a tprocinfo structure
  71. * fixed unit implicit initfinal
  72. Revision 1.9 2003/04/04 15:38:56 peter
  73. * moved generic code from n386cal to ncgcal, i386 now also
  74. uses the generic ncgcal
  75. Revision 1.8 2003/02/05 22:44:55 mazen
  76. * making UNIT lower case.
  77. Revision 1.7 2003/02/04 21:50:54 mazen
  78. * fixing internal errors related to notn when compiling RTL
  79. Revision 1.6 2003/01/22 22:30:03 mazen
  80. - internal errors rmoved from a_loar_reg_reg when reg sizes differs from 32
  81. Revision 1.5 2002/11/14 21:42:08 mazen
  82. * fixing return value variable address
  83. Revision 1.4 2002/10/10 19:57:52 mazen
  84. * Just to update repsitory
  85. Revision 1.3 2002/09/30 19:12:14 mazen
  86. * function prologue fixed
  87. Revision 1.2 2002/08/30 13:16:23 mazen
  88. *call parameter handling is now based on the new param manager
  89. Revision 1.2 2002/08/17 09:23:49 florian
  90. * first part of procinfo rewrite
  91. Revision 1.1 2002/08/13 21:40:59 florian
  92. * more fixes for ppc calling conventions
  93. }