ncpucall.pas 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. {*****************************************************************************}
  2. { File : ncpucall.pas }
  3. { Author : Mazen NEIFER }
  4. { Project : Free Pascal Compiler (FPC) }
  5. { Creation date : 2002\26\26 }
  6. { Last modification date : 2002\07\01 }
  7. { Licence : GPL }
  8. { Bug report : [email protected] }
  9. {*****************************************************************************}
  10. {
  11. $Id$
  12. Copyright (c) 1998-2002 by Florian Klaempfl
  13. Generate SPARC assembler for in call nodes
  14. This program is free software; you can redistribute it and/or modify
  15. it under the terms of the GNU General Public License as published bymethodpointer
  16. the Free Software Foundation; either version 2 of the License, or
  17. (at your option) any later version.
  18. This program is distributed in the hope that it will be useful,
  19. but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. GNU General Public License for more details.
  22. You should have received a copy of the GNU General Public License
  23. along with this program; if not, write to the Free Software
  24. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  25. ****************************************************************************}
  26. UNIT ncpucall;
  27. {$INCLUDE fpcdefs.inc}
  28. interface
  29. uses
  30. symdef,node,ncal,ncgcal;
  31. type
  32. TSparccallnode = class(tcgcallnode)
  33. function pass_1 : tnode;override;
  34. {Under SPARC, the frame pointer is automatically set by the SAVE instruction
  35. which is part of the stardrad calling mechanism. This function will do nothing
  36. else than adding the function prologue, which is in some case loading the
  37. correct value into the frame pointer register!}
  38. procedure load_framepointer;override;
  39. end;
  40. implementation
  41. uses
  42. globtype,systems,
  43. cutils,verbose,globals,
  44. symconst,symbase,symsym,symtable,defbase,paramgr,
  45. {$ifdef GDB}
  46. {$ifdef delphi}
  47. sysutils,
  48. {$else}
  49. strings,
  50. {$endif}
  51. gdb,
  52. {$endif GDB}
  53. cginfo,cgbase,pass_2,
  54. cpuinfo,cpubase,aasmbase,aasmtai,aasmcpu,
  55. nmem,nld,ncnv,
  56. ncgutil,cgobj,tgobj,regvars,rgobj,rgcpu,cg64f32,cgcpu,cpupi;
  57. function TSparccallnode.pass_1 : tnode;
  58. begin
  59. result:=inherited pass_1;
  60. if assigned(result) then
  61. exit;
  62. if procdefinition is tprocdef then
  63. begin
  64. if tprocdef(procdefinition).parast.datasize>TSparcprocinfo(procinfo).maxpushedparasize then
  65. TSparcprocinfo(procinfo).maxpushedparasize:=tprocdef(procdefinition).parast.datasize
  66. end
  67. else
  68. begin
  69. {!!!!}
  70. end;
  71. end;
  72. procedure TSparcCallNode.load_framepointer;
  73. begin
  74. exprasmList.concat(TAiCpu.Op_reg_const_reg(A_SAVE,S_L,stack_pointer_reg,-tprocdef(procdefinition).parast.datasize,stack_pointer_reg));
  75. end;
  76. begin
  77. ccallnode:=TSparccallnode;
  78. end.
  79. {
  80. $Log$
  81. Revision 1.3 2002-09-30 19:12:14 mazen
  82. * function prologue fixed
  83. Revision 1.2 2002/08/30 13:16:23 mazen
  84. *call parameter handling is now based on the new param manager
  85. Revision 1.2 2002/08/17 09:23:49 florian
  86. * first part of procinfo rewrite
  87. Revision 1.1 2002/08/13 21:40:59 florian
  88. * more fixes for ppc calling conventions
  89. }