n386inl.pas 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Generate i386 inline 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. }
  18. unit n386inl;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. nx86inl;
  23. type
  24. ti386inlinenode = class(tx86inlinenode)
  25. end;
  26. implementation
  27. uses
  28. ninl;
  29. begin
  30. cinlinenode:=ti386inlinenode;
  31. end.
  32. {
  33. $Log$
  34. Revision 1.73 2004-02-05 01:24:08 florian
  35. * several fixes to compile x86-64 system
  36. Revision 1.72 2004/02/03 22:32:54 peter
  37. * renamed xNNbittype to xNNinttype
  38. * renamed registers32 to registersint
  39. * replace some s32bit,u32bit with torddef([su]inttype).def.typ
  40. Revision 1.71 2004/02/02 20:41:59 florian
  41. + added prefetch(const mem) support
  42. Revision 1.70 2003/10/10 17:48:14 peter
  43. * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
  44. * tregisteralloctor renamed to trgobj
  45. * removed rgobj from a lot of units
  46. * moved location_* and reference_* to cgobj
  47. * first things for mmx register allocation
  48. Revision 1.69 2003/10/09 21:31:37 daniel
  49. * Register allocator splitted, ans abstract now
  50. Revision 1.68 2003/10/01 20:34:49 peter
  51. * procinfo unit contains tprocinfo
  52. * cginfo renamed to cgbase
  53. * moved cgmessage to verbose
  54. * fixed ppc and sparc compiles
  55. Revision 1.67 2003/09/28 21:48:20 peter
  56. * fix register leaks
  57. Revision 1.66 2003/09/07 22:09:35 peter
  58. * preparations for different default calling conventions
  59. * various RA fixes
  60. Revision 1.65 2003/09/03 15:55:01 peter
  61. * NEWRA branch merged
  62. Revision 1.64.2.2 2003/08/31 15:46:26 peter
  63. * more updates for tregister
  64. Revision 1.64.2.1 2003/08/29 17:29:00 peter
  65. * next batch of updates
  66. Revision 1.64 2003/07/02 22:18:04 peter
  67. * paraloc splitted in callerparaloc,calleeparaloc
  68. * sparc calling convention updates
  69. Revision 1.63 2003/06/03 13:01:59 daniel
  70. * Register allocator finished
  71. Revision 1.62 2003/06/01 21:38:06 peter
  72. * getregisterfpu size parameter added
  73. * op_const_reg size parameter added
  74. * sparc updates
  75. Revision 1.61 2003/05/30 23:49:18 jonas
  76. * a_load_loc_reg now has an extra size parameter for the destination
  77. register (properly fixes what I worked around in revision 1.106 of
  78. ncgutil.pas)
  79. Revision 1.60 2003/04/23 09:50:31 peter
  80. * wrong location_copy for include/exclude
  81. Revision 1.59 2003/04/22 23:50:23 peter
  82. * firstpass uses expectloc
  83. * checks if there are differences between the expectloc and
  84. location.loc from secondpass in EXTDEBUG
  85. Revision 1.58 2003/04/22 14:33:38 peter
  86. * removed some notes/hints
  87. Revision 1.57 2003/04/22 10:09:35 daniel
  88. + Implemented the actual register allocator
  89. + Scratch registers unavailable when new register allocator used
  90. + maybe_save/maybe_restore unavailable when new register allocator used
  91. Revision 1.56 2003/02/19 22:00:15 daniel
  92. * Code generator converted to new register notation
  93. - Horribily outdated todo.txt removed
  94. Revision 1.55 2003/01/08 18:43:57 daniel
  95. * Tregister changed into a record
  96. Revision 1.54 2002/11/25 17:43:26 peter
  97. * splitted defbase in defutil,symutil,defcmp
  98. * merged isconvertable and is_equal into compare_defs(_ext)
  99. * made operator search faster by walking the list only once
  100. Revision 1.53 2002/09/07 15:25:10 peter
  101. * old logs removed and tabs fixed
  102. Revision 1.52 2002/08/02 07:44:31 jonas
  103. * made assigned() handling generic
  104. * add nodes now can also evaluate constant expressions at compile time
  105. that contain nil nodes
  106. Revision 1.51 2002/07/26 11:16:35 jonas
  107. * fixed (actual and potential) range errors
  108. Revision 1.50 2002/07/25 18:02:33 carl
  109. + added generic inline nodes
  110. Revision 1.49 2002/07/20 11:58:02 florian
  111. * types.pas renamed to defbase.pas because D6 contains a types
  112. unit so this would conflicts if D6 programms are compiled
  113. + Willamette/SSE2 instructions to assembler added
  114. Revision 1.48 2002/07/11 14:41:33 florian
  115. * start of the new generic parameter handling
  116. Revision 1.47 2002/07/07 09:52:34 florian
  117. * powerpc target fixed, very simple units can be compiled
  118. * some basic stuff for better callparanode handling, far from being finished
  119. Revision 1.46 2002/07/01 18:46:33 peter
  120. * internal linker
  121. * reorganized aasm layer
  122. Revision 1.45 2002/07/01 16:23:56 peter
  123. * cg64 patch
  124. * basics for currency
  125. * asnode updates for class and interface (not finished)
  126. Revision 1.44 2002/05/18 13:34:25 peter
  127. * readded missing revisions
  128. Revision 1.43 2002/05/16 19:46:51 carl
  129. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  130. + try to fix temp allocation (still in ifdef)
  131. + generic constructor calls
  132. + start of tassembler / tmodulebase class cleanup
  133. Revision 1.41 2002/05/13 19:54:38 peter
  134. * removed n386ld and n386util units
  135. * maybe_save/maybe_restore added instead of the old maybe_push
  136. Revision 1.40 2002/05/12 16:53:17 peter
  137. * moved entry and exitcode to ncgutil and cgobj
  138. * foreach gets extra argument for passing local data to the
  139. iterator function
  140. * -CR checks also class typecasts at runtime by changing them
  141. into as
  142. * fixed compiler to cycle with the -CR option
  143. * fixed stabs with elf writer, finally the global variables can
  144. be watched
  145. * removed a lot of routines from cga unit and replaced them by
  146. calls to cgobj
  147. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  148. u32bit then the other is typecasted also to u32bit without giving
  149. a rangecheck warning/error.
  150. * fixed pascal calling method with reversing also the high tree in
  151. the parast, detected by tcalcst3 test
  152. Revision 1.39 2002/04/23 19:16:35 peter
  153. * add pinline unit that inserts compiler supported functions using
  154. one or more statements
  155. * moved finalize and setlength from ninl to pinline
  156. Revision 1.38 2002/04/21 15:35:54 carl
  157. * changeregsize -> rg.makeregsize
  158. Revision 1.37 2002/04/19 15:39:35 peter
  159. * removed some more routines from cga
  160. * moved location_force_reg/mem to ncgutil
  161. * moved arrayconstructnode secondpass to ncgld
  162. Revision 1.36 2002/04/15 19:44:21 peter
  163. * fixed stackcheck that would be called recursively when a stack
  164. error was found
  165. * generic changeregsize(reg,size) for i386 register resizing
  166. * removed some more routines from cga unit
  167. * fixed returnvalue handling
  168. * fixed default stacksize of linux and go32v2, 8kb was a bit small :-)
  169. Revision 1.35 2002/04/04 19:06:11 peter
  170. * removed unused units
  171. * use tlocation.size in cg.a_*loc*() routines
  172. Revision 1.34 2002/04/02 17:11:36 peter
  173. * tlocation,treference update
  174. * LOC_CONSTANT added for better constant handling
  175. * secondadd splitted in multiple routines
  176. * location_force_reg added for loading a location to a register
  177. of a specified size
  178. * secondassignment parses now first the right and then the left node
  179. (this is compatible with Kylix). This saves a lot of push/pop especially
  180. with string operations
  181. * adapted some routines to use the new cg methods
  182. Revision 1.33 2002/03/31 20:26:39 jonas
  183. + a_loadfpu_* and a_loadmm_* methods in tcg
  184. * register allocation is now second_d by a class and is mostly processor
  185. independent (+rgobj.pas and i386/rgcpu.pas)
  186. * temp allocation is now second_d by a class (+tgobj.pas, -i386\tgcpu.pas)
  187. * some small improvements and fixes to the optimizer
  188. * some register allocation fixes
  189. * some fpuvaroffset fixes in the unary minus node
  190. * push/popusedregisters is now called rg.save/restoreusedregisters and
  191. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  192. also better optimizable)
  193. * fixed and optimized register saving/restoring for new/dispose nodes
  194. * LOC_FPU locations now also require their "register" field to be set to
  195. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  196. - list field removed of the tnode class because it's not used currently
  197. and can cause hard-to-find bugs
  198. Revision 1.32 2002/03/04 19:10:14 peter
  199. * removed compiler warnings
  200. }