rgcpu.pas 22 KB

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