nppccal.pas 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. {
  2. $Id$
  3. Copyright (c) 2002 by Florian Klaempfl
  4. Implements the PowerPC specific part of 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 bymethodpointer
  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. unit nppccal;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. symdef,node,ncal,ncgcal;
  23. type
  24. tppccallnode = class(tcgcallnode)
  25. procedure extra_call_code;override;
  26. end;
  27. implementation
  28. uses
  29. globtype,systems,
  30. cutils,verbose,globals,
  31. symconst,symbase,symsym,symtable,defutil,paramgr,
  32. {$ifdef GDB}
  33. {$ifdef delphi}
  34. sysutils,
  35. {$else}
  36. strings,
  37. {$endif}
  38. gdb,
  39. {$endif GDB}
  40. cgbase,pass_2,
  41. cpuinfo,cpubase,aasmbase,aasmtai,aasmcpu,
  42. nmem,nld,ncnv,
  43. ncgutil,cgobj,tgobj,regvars,rgobj,rgcpu,
  44. cg64f32,cgcpu,cpupi,procinfo;
  45. procedure tppccallnode.extra_call_code;
  46. begin
  47. if assigned(varargsparas) then
  48. begin
  49. if va_uses_float_reg in varargsparas.varargsinfo then
  50. exprasmlist.concat(taicpu.op_const_const_const(A_CREQV,6,6,6))
  51. else
  52. exprasmlist.concat(taicpu.op_const_const_const(A_CRXOR,6,6,6));
  53. end;
  54. end;
  55. begin
  56. ccallnode:=tppccallnode;
  57. end.
  58. {
  59. $Log$
  60. Revision 1.23 2003-12-28 22:09:12 florian
  61. + setting of bit 6 of cr for c var args on ppc implemented
  62. Revision 1.22 2003/10/01 20:34:49 peter
  63. * procinfo unit contains tprocinfo
  64. * cginfo renamed to cgbase
  65. * moved cgmessage to verbose
  66. * fixed ppc and sparc compiles
  67. Revision 1.21 2003/09/03 19:35:24 peter
  68. * powerpc compiles again
  69. Revision 1.20 2003/07/08 21:24:59 peter
  70. * sparc fixes
  71. Revision 1.19 2003/07/06 20:25:03 jonas
  72. * fixed ppc compiler
  73. Revision 1.18 2003/06/13 21:19:32 peter
  74. * current_procdef removed, use current_procinfo.procdef instead
  75. Revision 1.17 2003/06/04 11:58:58 jonas
  76. * calculate localsize also in g_return_from_proc since it's now called
  77. before g_stackframe_entry (still have to fix macos)
  78. * compilation fixes (cycle doesn't work yet though)
  79. Revision 1.16 2003/05/25 14:32:42 jonas
  80. * fixed register numbering bug
  81. Revision 1.15 2003/05/24 11:47:27 jonas
  82. * fixed framepointer storage: it's now always stored at r1+12, which is
  83. a place in the link area reserved for compiler use.
  84. Revision 1.14 2003/05/23 18:51:26 jonas
  85. * fixed support for nested procedures and more parameters than those
  86. which fit in registers (untested/probably not working: calling a
  87. nested procedure from a deeper nested procedure)
  88. Revision 1.13 2003/05/18 15:15:59 florian
  89. + added abi field to tsysteminfo
  90. Revision 1.12 2003/05/16 23:15:51 jonas
  91. * workaround for nested procedures until Peter fixes it properly :)
  92. Revision 1.11 2003/05/16 20:00:39 jonas
  93. * powerpc nested procedure fixes, should work completely now if all
  94. local variables of the parent procedure are declared before the
  95. nested procedures are declared
  96. Revision 1.10 2003/04/27 11:21:36 peter
  97. * aktprocdef renamed to current_procinfo.procdef
  98. * procinfo renamed to current_procinfo
  99. * procinfo will now be stored in current_module so it can be
  100. cleaned up properly
  101. * gen_main_procsym changed to create_main_proc and release_main_proc
  102. to also generate a tprocinfo structure
  103. * fixed unit implicit initfinal
  104. Revision 1.9 2003/04/27 10:41:47 florian
  105. * fixed nested procedures to get them working as before
  106. Revision 1.8 2003/04/27 07:48:05 peter
  107. * updated for removed lexlevel
  108. Revision 1.7 2003/04/24 11:24:00 florian
  109. * fixed several issues with nested procedures
  110. Revision 1.6 2003/04/23 12:35:35 florian
  111. * fixed several issues with powerpc
  112. + applied a patch from Jonas for nested function calls (PowerPC only)
  113. * ...
  114. Revision 1.5 2003/04/04 15:38:56 peter
  115. * moved generic code from n386cal to ncgcal, i386 now also
  116. uses the generic ncgcal
  117. Revision 1.4 2002/12/05 14:28:12 florian
  118. * some variant <-> dyn. array stuff
  119. Revision 1.3 2002/11/25 17:43:28 peter
  120. * splitted defbase in defutil,symutil,defcmp
  121. * merged isconvertable and is_equal into compare_defs(_ext)
  122. * made operator search faster by walking the list only once
  123. Revision 1.2 2002/08/17 09:23:49 florian
  124. * first part of procinfo rewrite
  125. Revision 1.1 2002/08/13 21:40:59 florian
  126. * more fixes for ppc calling conventions
  127. }