rgcpu.pas 21 KB

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