rgcpu.pas 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. This unit implements the i386 specific class for the register
  5. allocator
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. unit rgcpu;
  20. {$i fpcdefs.inc}
  21. interface
  22. uses
  23. cpubase,
  24. cpuinfo,
  25. aasmbase,aasmtai,aasmcpu,
  26. cclasses,globtype,cgbase,cginfo,rgobj;
  27. type
  28. trgcpu = class(trgobj)
  29. fpuvaroffset : byte;
  30. { to keep the same allocation order as with the old routines }
  31. {$ifdef newra}
  32. procedure add_constraints(reg:Tnewregister);override;
  33. {$else}
  34. function getregisterint(list:Taasmoutput;size:Tcgsize):Tregister;override;
  35. function getaddressregister(list:Taasmoutput):Tregister;override;
  36. procedure ungetregisterint(list:Taasmoutput;r:Tregister); override;
  37. function getexplicitregisterint(list:Taasmoutput;r:Tnewregister):Tregister;override;
  38. {$endif newra}
  39. function getregisterfpu(list: taasmoutput;size:TCGSize) : tregister; override;
  40. procedure ungetregisterfpu(list: taasmoutput; r : tregister); override;
  41. procedure ungetreference(list: taasmoutput; const ref : treference); override;
  42. {# Returns a subset register of the register r with the specified size.
  43. WARNING: There is no clearing of the upper parts of the register,
  44. if a 8-bit / 16-bit register is converted to a 32-bit register.
  45. It is up to the code generator to correctly zero fill the register
  46. }
  47. function makeregsize(reg: tregister; size: tcgsize): tregister; override;
  48. { pushes and restores registers }
  49. {$ifndef newra}
  50. procedure pushusedintregisters(list:Taasmoutput;
  51. var pushed:Tpushedsavedint;
  52. const s:Tsupregset);
  53. {$endif}
  54. {$ifdef SUPPORT_MMX}
  55. procedure pushusedotherregisters(list:Taasmoutput;
  56. var pushed:Tpushedsavedother;
  57. const s:Tregisterset);
  58. {$endif SUPPORT_MMX}
  59. {$ifndef newra}
  60. procedure popusedintregisters(list:Taasmoutput;
  61. const pushed:Tpushedsavedint);
  62. {$endif}
  63. {$ifdef SUPPORT_MMX}
  64. procedure popusedotherregisters(list:Taasmoutput;
  65. const pushed:Tpushedsavedother);
  66. {$endif SUPPORT_MMX}
  67. {$ifndef newra}
  68. procedure saveusedintregisters(list:Taasmoutput;
  69. var saved:Tpushedsavedint;
  70. const s:Tsupregset);override;
  71. {$endif}
  72. procedure saveusedotherregisters(list:Taasmoutput;
  73. var saved:Tpushedsavedother;
  74. const s:Tregisterset);override;
  75. {$ifndef newra}
  76. procedure restoreusedintregisters(list:Taasmoutput;
  77. const saved:Tpushedsavedint);override;
  78. {$endif}
  79. procedure restoreusedotherregisters(list:Taasmoutput;
  80. const saved:Tpushedsavedother);override;
  81. procedure resetusableregisters;override;
  82. { corrects the fpu stack register by ofs }
  83. function correct_fpuregister(r : tregister;ofs : byte) : tregister;
  84. end;
  85. implementation
  86. uses
  87. systems,
  88. globals,verbose,
  89. tgobj;
  90. {************************************************************************}
  91. { trgcpu }
  92. {************************************************************************}
  93. {$ifdef newra}
  94. procedure Trgcpu.add_constraints(reg:Tnewregister);
  95. begin
  96. if reg and $ff in [R_SUBL,R_SUBH] then
  97. begin
  98. {These registers have no 8-bit subregister, so add interferences.}
  99. add_edge(reg shr 8,RS_ESI);
  100. add_edge(reg shr 8,RS_EDI);
  101. add_edge(reg shr 8,RS_EBP);
  102. end;
  103. end;
  104. {$endif}
  105. {$ifndef newra}
  106. function trgcpu.getregisterint(list:Taasmoutput;size:Tcgsize):Tregister;
  107. var subreg:Tsubregister;
  108. begin
  109. subreg:=cgsize2subreg(size);
  110. if countunusedregsint=0 then
  111. internalerror(10);
  112. result.enum:=R_INTREGISTER;
  113. {$ifdef TEMPREGDEBUG}
  114. if curptree^.usableregsint-countunusedregsint>curptree^.registers32 then
  115. internalerror(10);
  116. {$endif TEMPREGDEBUG}
  117. {$ifdef EXTTEMPREGDEBUG}
  118. if curptree^.usableregs-countunusedregistersint>curptree^^.reallyusedregs then
  119. curptree^.reallyusedregs:=curptree^^.usableregs-countunusedregistersint;
  120. {$endif EXTTEMPREGDEBUG}
  121. if RS_EAX in unusedregsint then
  122. begin
  123. dec(countunusedregsint);
  124. exclude(unusedregsint,RS_EAX);
  125. include(usedintinproc,RS_EAX);
  126. result.number:=RS_EAX shl 8 or subreg;
  127. {$ifdef TEMPREGDEBUG}
  128. reg_user[R_EAX]:=curptree^;
  129. {$endif TEMPREGDEBUG}
  130. exprasmlist.concat(tai_regalloc.alloc(result));
  131. end
  132. else if RS_EDX in unusedregsint then
  133. begin
  134. dec(countunusedregsint);
  135. exclude(unusedregsint,RS_EDX);
  136. include(usedintinproc,RS_EDX);
  137. result.number:=RS_EDX shl 8 or subreg;
  138. {$ifdef TEMPREGDEBUG}
  139. reg_user[R_EDX]:=curptree^;
  140. {$endif TEMPREGDEBUG}
  141. exprasmlist.concat(tai_regalloc.alloc(result));
  142. end
  143. else if RS_EBX in unusedregsint then
  144. begin
  145. dec(countunusedregsint);
  146. exclude(unusedregsint,RS_EBX);
  147. include(usedintinproc,RS_EBX);
  148. result.number:=RS_EBX shl 8 or subreg;
  149. {$ifdef TEMPREGDEBUG}
  150. reg_user[R_EBX]:=curptree^;
  151. {$endif TEMPREGDEBUG}
  152. exprasmlist.concat(tai_regalloc.alloc(result));
  153. end
  154. else if RS_ECX in unusedregsint then
  155. begin
  156. dec(countunusedregsint);
  157. exclude(unusedregsint,RS_ECX);
  158. include(usedintinproc,RS_ECX);
  159. result.number:=RS_ECX shl 8 or subreg;
  160. {$ifdef TEMPREGDEBUG}
  161. reg_user[R_ECX]:=curptree^;
  162. {$endif TEMPREGDEBUG}
  163. exprasmlist.concat(tai_regalloc.alloc(result));
  164. end
  165. else
  166. internalerror(10);
  167. {$ifdef TEMPREGDEBUG}
  168. testregisters;
  169. {$endif TEMPREGDEBUG}
  170. end;
  171. function trgcpu.getaddressregister(list:Taasmoutput):Tregister;
  172. begin
  173. if countunusedregsaddr>0 then
  174. begin
  175. result.enum:=R_INTREGISTER;
  176. {$ifdef TEMPREGDEBUG}
  177. if curptree^.usableregsaddr-countunusedregsaddr>curptree^.registers32 then
  178. internalerror(10);
  179. {$endif TEMPREGDEBUG}
  180. {$ifdef EXTTEMPREGDEBUG}
  181. if curptree^.usableregs-countunusedregistersaddr>curptree^^.reallyusedregs then
  182. curptree^.reallyusedregs:=curptree^^.usableregs-countunusedregistersaddr;
  183. {$endif EXTTEMPREGDEBUG}
  184. if RS_ESI in unusedregsaddr then
  185. begin
  186. dec(countunusedregsaddr);
  187. exclude(unusedregsaddr,RS_ESI);
  188. include(usedaddrinproc,RS_ESI);
  189. result.number:=NR_ESI;
  190. {$ifdef TEMPREGDEBUG}
  191. reg_user[R_ESI]:=curptree^;
  192. {$endif TEMPREGDEBUG}
  193. exprasmlist.concat(tai_regalloc.alloc(result));
  194. end
  195. else
  196. internalerror(10);
  197. end
  198. else
  199. result:=getregisterint(list,OS_ADDR);
  200. end;
  201. procedure trgcpu.ungetregisterint(list: taasmoutput; r : tregister);
  202. var supreg:Tsuperregister;
  203. begin
  204. if r.enum=R_NO then
  205. exit;
  206. if r.enum<>R_INTREGISTER then
  207. internalerror(200301234);
  208. supreg:=r.number shr 8;
  209. if (supreg in [RS_EDI]) then
  210. begin
  211. list.concat(tai_regalloc.DeAlloc(r));
  212. exit;
  213. end;
  214. if not(supreg in [RS_EAX,RS_EBX,RS_ECX,RS_EDX,RS_ESI]) then
  215. exit;
  216. inherited ungetregisterint(list,r);
  217. end;
  218. function trgcpu.getexplicitregisterint(list:Taasmoutput;r:Tnewregister):Tregister;
  219. var r2:Tregister;
  220. begin
  221. if (r shr 8) in [RS_EDI] then
  222. begin
  223. r2.enum:=R_INTREGISTER;
  224. r2.number:=r;
  225. list.concat(Tai_regalloc.alloc(r2));
  226. getexplicitregisterint:=r2;
  227. exit;
  228. end;
  229. result:=inherited getexplicitregisterint(list,r);
  230. end;
  231. {$endif newra}
  232. function trgcpu.getregisterfpu(list: taasmoutput;size: TCGSize) : tregister;
  233. begin
  234. { note: don't return R_ST0, see comments above implementation of }
  235. { a_loadfpu_* methods in cgcpu (JM) }
  236. result.enum := R_ST;
  237. end;
  238. procedure trgcpu.ungetregisterfpu(list : taasmoutput; r : tregister);
  239. begin
  240. { nothing to do, fpu stack management is handled by the load/ }
  241. { store operations in cgcpu (JM) }
  242. end;
  243. procedure trgcpu.ungetreference(list: taasmoutput; const ref : treference);
  244. begin
  245. if (ref.base.number<>NR_NO) and (ref.base.number<>NR_FRAME_POINTER_REG) then
  246. ungetregisterint(list,ref.base);
  247. if (ref.index.number<>NR_NO) and (ref.index.number<>NR_FRAME_POINTER_REG) then
  248. ungetregisterint(list,ref.index);
  249. end;
  250. {$ifndef newra}
  251. procedure trgcpu.pushusedintregisters(list:Taasmoutput;
  252. var pushed:Tpushedsavedint;
  253. const s:Tsupregset);
  254. var r:Tsuperregister;
  255. r2:Tregister;
  256. begin
  257. usedintinproc:=usedintinproc+s;
  258. for r:=firstsaveintreg to lastsaveintreg do
  259. begin
  260. r2.enum:=R_INTREGISTER;
  261. r2.number:=r shl 8 or R_SUBWHOLE;
  262. pushed[r].pushed:=false;
  263. { if the register is used by the calling subroutine }
  264. if not(r in is_reg_var_int) and (r in s) and
  265. { and is present in use }
  266. not(r in unusedregsint) then
  267. begin
  268. { then save it }
  269. list.concat(Taicpu.Op_reg(A_PUSH,S_L,r2));
  270. include(unusedregsint,r);
  271. {$ifndef newra}
  272. inc(countunusedregsint);
  273. {$endif}
  274. pushed[r].pushed:=true;
  275. end;
  276. end;
  277. {$ifdef TEMPREGDEBUG}
  278. testregisters;
  279. {$endif TEMPREGDEBUG}
  280. end;
  281. {$endif}
  282. {$ifdef SUPPORT_MMX}
  283. procedure trgcpu.pushusedotherregisters(list:Taasmoutput;
  284. var pushed:Tpushedsavedother;
  285. const s:Tregisterset);
  286. var r:Toldregister;
  287. r2:Tregister;
  288. hr:Treference;
  289. begin
  290. usedinproc:=usedinproc+s;
  291. for r:=R_MM0 to R_MM6 do
  292. begin
  293. pushed[r].pushed:=false;
  294. { if the register is used by the calling subroutine }
  295. if not is_reg_var_other[r] and
  296. (r in s) and
  297. { and is present in use }
  298. not(r in unusedregsmm) then
  299. begin
  300. r2.enum:=R_ESP;
  301. list.concat(Taicpu.Op_const_reg(A_SUB,S_L,8,r2));
  302. reference_reset_base(hr,r2,0);
  303. r2.enum:=r;
  304. list.concat(Taicpu.Op_reg_ref(A_MOVQ,S_NO,r2,hr));
  305. include(unusedregsmm,r);
  306. {$ifndef newra}
  307. inc(countunusedregsmm);
  308. {$endif}
  309. pushed[r].pushed:=true;
  310. end;
  311. end;
  312. {$ifdef TEMPREGDEBUG}
  313. testregisters;
  314. {$endif TEMPREGDEBUG}
  315. end;
  316. {$endif SUPPORT_MMX}
  317. {$ifndef newra}
  318. procedure trgcpu.popusedintregisters(list:Taasmoutput;
  319. const pushed:Tpushedsavedint);
  320. var r:Tsuperregister;
  321. r2:Tregister;
  322. begin
  323. { restore in reverse order: }
  324. for r:=lastsaveintreg downto firstsaveintreg do
  325. if pushed[r].pushed then
  326. begin
  327. r2.enum:=R_INTREGISTER;
  328. r2.number:=r shl 8 or R_SUBWHOLE;
  329. list.concat(Taicpu.op_reg(A_POP,S_L,r2));
  330. if not (r in unusedregsint) then
  331. { internalerror(10)
  332. in cg386cal we always restore regs
  333. that appear as used
  334. due to a unused tmep storage PM }
  335. else
  336. {$ifndef newra}dec(countunusedregsint){$endif};
  337. exclude(unusedregsint,r);
  338. end;
  339. {$ifdef TEMPREGDEBUG}
  340. testregisters;
  341. {$endif TEMPREGDEBUG}
  342. end;
  343. {$endif}
  344. {$ifdef SUPPORT_MMX}
  345. procedure trgcpu.popusedotherregisters(list:Taasmoutput;
  346. const pushed:Tpushedsavedother);
  347. var r:Toldregister;
  348. r2,r3:Tregister;
  349. hr:Treference;
  350. begin
  351. { restore in reverse order: }
  352. for r:=R_MM6 downto R_MM0 do
  353. if pushed[r].pushed then
  354. begin
  355. r2.enum:=R_ESP;
  356. reference_reset_base(hr,r2,0);
  357. r3.enum:=r;
  358. list.concat(Taicpu.op_ref_reg(A_MOVQ,S_NO,hr,r3));
  359. list.concat(Taicpu.op_const_reg(A_ADD,S_L,8,r2));
  360. if not (r in unusedregsmm) then
  361. { internalerror(10)
  362. in cg386cal we always restore regs
  363. that appear as used
  364. due to a unused tmep storage PM }
  365. else
  366. {$ifndef newra}dec(countunusedregsmm){$endif};
  367. exclude(unusedregsmm,r);
  368. end;
  369. {$ifdef TEMPREGDEBUG}
  370. testregisters;
  371. {$endif TEMPREGDEBUG}
  372. end;
  373. {$endif SUPPORT_MMX}
  374. {$ifndef newra}
  375. procedure trgcpu.saveusedintregisters(list:Taasmoutput;
  376. var saved:Tpushedsavedint;
  377. const s:Tsupregset);
  378. begin
  379. if (aktoptprocessor in [class386,classP5]) or
  380. (CS_LittleSize in aktglobalswitches) then
  381. pushusedintregisters(list,saved,s)
  382. else
  383. inherited saveusedintregisters(list,saved,s);
  384. end;
  385. {$endif}
  386. procedure trgcpu.saveusedotherregisters(list:Taasmoutput;var saved:Tpushedsavedother;
  387. const s:tregisterset);
  388. begin
  389. {$ifdef SUPPORT_MMX}
  390. if (aktoptprocessor in [class386,classP5]) or
  391. (CS_LittleSize in aktglobalswitches) then
  392. pushusedotherregisters(list,saved,s)
  393. else
  394. {$endif SUPPORT_MMX}
  395. inherited saveusedotherregisters(list,saved,s);
  396. end;
  397. {$ifndef newra}
  398. procedure trgcpu.restoreusedintregisters(list:Taasmoutput;
  399. const saved:tpushedsavedint);
  400. begin
  401. if (aktoptprocessor in [class386,classP5]) or
  402. (CS_LittleSize in aktglobalswitches) then
  403. popusedintregisters(list,saved)
  404. else
  405. inherited restoreusedintregisters(list,saved);
  406. end;
  407. {$endif}
  408. procedure trgcpu.restoreusedotherregisters(list:Taasmoutput;
  409. const saved:tpushedsavedother);
  410. begin
  411. {$ifdef SUPPORT_MMX}
  412. if (aktoptprocessor in [class386,classP5]) or
  413. (CS_LittleSize in aktglobalswitches) then
  414. popusedotherregisters(list,saved)
  415. else
  416. {$endif SUPPORT_MMX}
  417. inherited restoreusedotherregisters(list,saved);
  418. end;
  419. procedure trgcpu.resetusableregisters;
  420. begin
  421. inherited resetusableregisters;
  422. fpuvaroffset := 0;
  423. end;
  424. function trgcpu.correct_fpuregister(r : tregister;ofs : byte) : tregister;
  425. begin
  426. correct_fpuregister.enum:=Toldregister(longint(r.enum)+ofs);
  427. end;
  428. function trgcpu.makeregsize(reg: tregister; size: tcgsize): tregister;
  429. begin
  430. if reg.enum<>R_INTREGISTER then
  431. internalerror(200306032);
  432. result.enum:=R_INTREGISTER;
  433. result.number:=(reg.number and (not $ff)) or cgsize2subreg(size);
  434. end;
  435. initialization
  436. rg := trgcpu.create(7); {We use 7 int registers on i386.}
  437. end.
  438. {
  439. $Log$
  440. Revision 1.25 2003-06-03 21:11:09 peter
  441. * cg.a_load_* get a from and to size specifier
  442. * makeregsize only accepts newregister
  443. * i386 uses generic tcgnotnode,tcgunaryminus
  444. Revision 1.24 2003/06/03 13:01:59 daniel
  445. * Register allocator finished
  446. Revision 1.23 2003/06/01 21:38:06 peter
  447. * getregisterfpu size parameter added
  448. * op_const_reg size parameter added
  449. * sparc updates
  450. Revision 1.22 2003/05/16 14:33:31 peter
  451. * regvar fixes
  452. Revision 1.21 2003/04/25 08:25:26 daniel
  453. * Ifdefs around a lot of calls to cleartempgen
  454. * Fixed registers that are allocated but not freed in several nodes
  455. * Tweak to register allocator to cause less spills
  456. * 8-bit registers now interfere with esi,edi and ebp
  457. Compiler can now compile rtl successfully when using new register
  458. allocator
  459. Revision 1.20 2003/04/23 14:42:08 daniel
  460. * Further register allocator work. Compiler now smaller with new
  461. allocator than without.
  462. * Somebody forgot to adjust ppu version number
  463. Revision 1.19 2003/04/22 10:09:35 daniel
  464. + Implemented the actual register allocator
  465. + Scratch registers unavailable when new register allocator used
  466. + maybe_save/maybe_restore unavailable when new register allocator used
  467. Revision 1.18 2003/04/21 19:16:50 peter
  468. * count address regs separate
  469. Revision 1.17 2003/03/28 19:16:57 peter
  470. * generic constructor working for i386
  471. * remove fixed self register
  472. * esi added as address register for i386
  473. Revision 1.16 2003/03/17 15:52:57 peter
  474. * SUPPORT_MMX define compile fix
  475. Revision 1.15 2003/03/08 13:59:17 daniel
  476. * Work to handle new register notation in ag386nsm
  477. + Added newra version of Ti386moddivnode
  478. Revision 1.14 2003/03/08 08:59:07 daniel
  479. + $define newra will enable new register allocator
  480. + getregisterint will return imaginary registers with $newra
  481. + -sr switch added, will skip register allocation so you can see
  482. the direct output of the code generator before register allocation
  483. Revision 1.13 2003/03/07 21:57:53 daniel
  484. * Improved getregisterint
  485. Revision 1.12 2003/02/19 22:00:16 daniel
  486. * Code generator converted to new register notation
  487. - Horribily outdated todo.txt removed
  488. Revision 1.11 2003/01/08 18:43:57 daniel
  489. * Tregister changed into a record
  490. Revision 1.10 2002/10/05 12:43:29 carl
  491. * fixes for Delphi 6 compilation
  492. (warning : Some features do not work under Delphi)
  493. Revision 1.9 2002/08/17 09:23:48 florian
  494. * first part of procinfo rewrite
  495. Revision 1.8 2002/07/01 18:46:34 peter
  496. * internal linker
  497. * reorganized aasm layer
  498. Revision 1.7 2002/05/16 19:46:52 carl
  499. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  500. + try to fix temp allocation (still in ifdef)
  501. + generic constructor calls
  502. + start of tassembler / tmodulebase class cleanup
  503. Revision 1.6 2002/05/12 16:53:18 peter
  504. * moved entry and exitcode to ncgutil and cgobj
  505. * foreach gets extra argument for passing local data to the
  506. iterator function
  507. * -CR checks also class typecasts at runtime by changing them
  508. into as
  509. * fixed compiler to cycle with the -CR option
  510. * fixed stabs with elf writer, finally the global variables can
  511. be watched
  512. * removed a lot of routines from cga unit and replaced them by
  513. calls to cgobj
  514. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  515. u32bit then the other is typecasted also to u32bit without giving
  516. a rangecheck warning/error.
  517. * fixed pascal calling method with reversing also the high tree in
  518. the parast, detected by tcalcst3 test
  519. Revision 1.5 2002/04/21 15:43:32 carl
  520. * changeregsize -> rg.makeregsize
  521. * changeregsize moved from cpubase to here
  522. Revision 1.4 2002/04/15 19:44:22 peter
  523. * fixed stackcheck that would be called recursively when a stack
  524. error was found
  525. * generic changeregsize(reg,size) for i386 register resizing
  526. * removed some more routines from cga unit
  527. * fixed returnvalue handling
  528. * fixed default stacksize of linux and go32v2, 8kb was a bit small :-)
  529. Revision 1.3 2002/04/04 19:06:13 peter
  530. * removed unused units
  531. * use tlocation.size in cg.a_*loc*() routines
  532. Revision 1.2 2002/04/02 17:11:39 peter
  533. * tlocation,treference update
  534. * LOC_CONSTANT added for better constant handling
  535. * secondadd splitted in multiple routines
  536. * location_force_reg added for loading a location to a register
  537. of a specified size
  538. * secondassignment parses now first the right and then the left node
  539. (this is compatible with Kylix). This saves a lot of push/pop especially
  540. with string operations
  541. * adapted some routines to use the new cg methods
  542. Revision 1.1 2002/03/31 20:26:40 jonas
  543. + a_loadfpu_* and a_loadmm_* methods in tcg
  544. * register allocation is now handled by a class and is mostly processor
  545. independent (+rgobj.pas and i386/rgcpu.pas)
  546. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  547. * some small improvements and fixes to the optimizer
  548. * some register allocation fixes
  549. * some fpuvaroffset fixes in the unary minus node
  550. * push/popusedregisters is now called rg.save/restoreusedregisters and
  551. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  552. also better optimizable)
  553. * fixed and optimized register saving/restoring for new/dispose nodes
  554. * LOC_FPU locations now also require their "register" field to be set to
  555. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  556. - list field removed of the tnode class because it's not used currently
  557. and can cause hard-to-find bugs
  558. }