cpunode.pas 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. {
  2. $Id$
  3. Copyright (c) 2000 by Florian Klaempfl
  4. Includes the i386 code generator
  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 cpunode;
  19. {$i fpcdefs.inc}
  20. interface
  21. implementation
  22. uses
  23. ncgbas,ncgflw,ncgcnv,ncgld,ncgmem,ncgcon,
  24. n386add,n386cal,n386con,n386cnv,n386flw,n386mat,n386mem,
  25. n386set,n386inl,n386opt,
  26. { this not really a node }
  27. n386obj, rgcpu;
  28. end.
  29. {
  30. $Log$
  31. Revision 1.12 2002-05-16 19:46:50 carl
  32. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  33. + try to fix temp allocation (still in ifdef)
  34. + generic constructor calls
  35. + start of tassembler / tmodulebase class cleanup
  36. Revision 1.10 2002/05/13 19:54:37 peter
  37. * removed n386ld and n386util units
  38. * maybe_save/maybe_restore added instead of the old maybe_push
  39. Revision 1.9 2002/04/19 15:39:35 peter
  40. * removed some more routines from cga
  41. * moved location_force_reg/mem to ncgutil
  42. * moved arrayconstructnode secondpass to ncgld
  43. Revision 1.8 2002/03/31 20:26:38 jonas
  44. + a_loadfpu_* and a_loadmm_* methods in tcg
  45. * register allocation is now handled by a class and is mostly processor
  46. independent (+rgobj.pas and i386/rgcpu.pas)
  47. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  48. * some small improvements and fixes to the optimizer
  49. * some register allocation fixes
  50. * some fpuvaroffset fixes in the unary minus node
  51. * push/popusedregisters is now called rg.save/restoreusedregisters and
  52. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  53. also better optimizable)
  54. * fixed and optimized register saving/restoring for new/dispose nodes
  55. * LOC_FPU locations now also require their "register" field to be set to
  56. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  57. - list field removed of the tnode class because it's not used currently
  58. and can cause hard-to-find bugs
  59. Revision 1.6 2001/09/29 21:32:47 jonas
  60. * almost all second pass typeconvnode helpers are now processor independent
  61. * fixed converting boolean to int64/qword
  62. * fixed register allocation bugs which could cause internalerror 10
  63. * isnode and asnode are completely processor indepent now as well
  64. * fpc_do_as now returns its class argument (necessary to be able to use it
  65. properly with compilerproc)
  66. Revision 1.5 2001/09/28 20:39:33 jonas
  67. * changed all flow control structures (except for exception handling
  68. related things) to processor independent code (in new ncgflw unit)
  69. + generic cgobj unit which contains lots of code generator helpers with
  70. global "cg" class instance variable
  71. + cgcpu unit for i386 (implements processor specific routines of the above
  72. unit)
  73. * updated cgbase and cpubase for the new code generator units
  74. * include ncgflw unit in cpunode unit
  75. Revision 1.4 2001/05/18 22:31:06 peter
  76. * tasmnode.pass_2 is independent of cpu, moved to ncgbas
  77. * include ncgbas for independent nodes
  78. Revision 1.3 2001/04/21 13:37:17 peter
  79. * made tclassheader using class of to implement cpu dependent code
  80. Revision 1.2 2000/12/31 11:14:11 jonas
  81. + implemented/fixed docompare() mathods for all nodes (not tested)
  82. + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
  83. and constant strings/chars together
  84. * n386add.pas: don't copy temp strings (of size 256) to another temp string
  85. when adding
  86. Revision 1.1 2000/10/15 09:39:37 peter
  87. * moved cpu*.pas to i386/
  88. * renamed n386 to common cpunode
  89. Revision 1.1 2000/10/14 10:14:47 peter
  90. * moehrendorf oct 2000 rewrite
  91. }