regvars.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl and Jonas Maebe
  4. This unit handles register variable allocation
  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 regvars;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. aasmbase,aasmtai,aasmcpu,
  23. node,
  24. symsym,
  25. cpubase, cginfo, tgobj, rgobj;
  26. procedure assign_regvars(p: tnode);
  27. procedure load_regvars(asml: TAAsmoutput; p: tnode);
  28. procedure cleanup_regvars(asml: TAAsmoutput);
  29. procedure store_regvar(asml: TAAsmoutput; reg: tregister);
  30. procedure load_regvar(asml: TAAsmoutput; vsym: tvarsym);
  31. procedure load_regvar_reg(asml: TAAsmoutput; reg: tregister);
  32. procedure load_all_regvars(asml: TAAsmoutput);
  33. procedure sync_regvars(list1, list2: taasmoutput; const regvarsloaded1,
  34. regvarsloaded2: regvar_booleanarray);
  35. implementation
  36. uses
  37. globtype,systems,comphook,
  38. cutils,cclasses,verbose,globals,
  39. symconst,symbase,symtype,symdef,paramgr,defbase,
  40. cgbase,cgobj,cgcpu,rgcpu;
  41. procedure searchregvars(p : tnamedindexitem;arg:pointer);
  42. var
  43. i,j,k : longint;
  44. parasym : boolean;
  45. begin
  46. parasym:=pboolean(arg)^;
  47. if (tsym(p).typ=varsym) and (vo_regable in tvarsym(p).varoptions) then
  48. begin
  49. j:=tvarsym(p).refs;
  50. { parameter get a less value }
  51. if parasym then
  52. begin
  53. if cs_littlesize in aktglobalswitches then
  54. dec(j,1)
  55. else
  56. dec(j,100);
  57. end;
  58. { walk through all momentary register variables }
  59. for i:=1 to maxvarregs do
  60. begin
  61. with pregvarinfo(aktprocdef.regvarinfo)^ do
  62. if ((regvars[i]=nil) or (j>regvars_refs[i])) and (j>0) then
  63. begin
  64. for k:=maxvarregs-1 downto i do
  65. begin
  66. regvars[k+1]:=regvars[k];
  67. regvars_para[k+1]:=regvars_para[k];
  68. regvars_refs[k+1]:=regvars_refs[k];
  69. end;
  70. { calc the new refs
  71. tvarsym(p).refs:=j; }
  72. regvars[i]:=tvarsym(p);
  73. regvars_para[i]:=parasym;
  74. regvars_refs[i]:=j;
  75. break;
  76. end;
  77. end;
  78. end;
  79. end;
  80. procedure searchfpuregvars(p : tnamedindexitem;arg:pointer);
  81. var
  82. i,j,k : longint;
  83. parasym : boolean;
  84. begin
  85. parasym:=pboolean(arg)^;
  86. if (tsym(p).typ=varsym) and (vo_fpuregable in tvarsym(p).varoptions) then
  87. begin
  88. j:=tvarsym(p).refs;
  89. { parameter get a less value }
  90. if parasym then
  91. begin
  92. if cs_littlesize in aktglobalswitches then
  93. dec(j,1)
  94. else
  95. dec(j,100);
  96. end;
  97. { walk through all momentary register variables }
  98. for i:=1 to maxfpuvarregs do
  99. begin
  100. with pregvarinfo(aktprocdef.regvarinfo)^ do
  101. if ((fpuregvars[i]=nil) or (j>fpuregvars_refs[i])) and (j>0) then
  102. begin
  103. for k:=maxfpuvarregs-1 downto i do
  104. begin
  105. fpuregvars[k+1]:=fpuregvars[k];
  106. fpuregvars_para[k+1]:=fpuregvars_para[k];
  107. fpuregvars_refs[k+1]:=fpuregvars_refs[k];
  108. end;
  109. { calc the new refs
  110. tvarsym(p).refs:=j; }
  111. fpuregvars[i]:=tvarsym(p);
  112. fpuregvars_para[i]:=parasym;
  113. fpuregvars_refs[i]:=j;
  114. break;
  115. end;
  116. end;
  117. end;
  118. end;
  119. procedure assign_regvars(p: tnode);
  120. { register variables }
  121. var
  122. regvarinfo: pregvarinfo;
  123. i: longint;
  124. parasym : boolean;
  125. begin
  126. { max. optimizations }
  127. { only if no asm is used }
  128. { and no try statement }
  129. if (cs_regalloc in aktglobalswitches) and
  130. ((procinfo.flags and (pi_uses_asm or pi_uses_exceptions))=0) then
  131. begin
  132. new(regvarinfo);
  133. fillchar(regvarinfo^,sizeof(regvarinfo^),0);
  134. aktprocdef.regvarinfo := regvarinfo;
  135. if (p.registers32<4) then
  136. begin
  137. parasym:=false;
  138. symtablestack.foreach_static({$ifdef FPCPROCVAR}@{$endif}searchregvars,@parasym);
  139. { copy parameter into a register ? }
  140. parasym:=true;
  141. symtablestack.next.foreach_static({$ifdef FPCPROCVAR}@{$endif}searchregvars,@parasym);
  142. { hold needed registers free }
  143. for i:=maxvarregs downto maxvarregs-p.registers32+1 do
  144. begin
  145. regvarinfo^.regvars[i]:=nil;
  146. regvarinfo^.regvars_para[i] := false;
  147. end;
  148. { now assign register }
  149. for i:=1 to maxvarregs-p.registers32 do
  150. begin
  151. if assigned(regvarinfo^.regvars[i]) and
  152. (rg.reg_pushes[varregs[i]] < regvarinfo^.regvars[i].refs) then
  153. begin
  154. { register is no longer available for }
  155. { expressions }
  156. { search the register which is the most }
  157. { unused }
  158. rg.makeregvar(varregs[i]);
  159. { possibly no 32 bit register are needed }
  160. { call by reference/const ? }
  161. if (regvarinfo^.regvars[i].varspez in [vs_var,vs_out]) or
  162. ((regvarinfo^.regvars[i].varspez=vs_const) and
  163. paramanager.push_addr_param(regvarinfo^.regvars[i].vartype.def,false)) then
  164. begin
  165. regvarinfo^.regvars[i].reg:=varregs[i];
  166. end
  167. else
  168. if (regvarinfo^.regvars[i].vartype.def.deftype in [orddef,enumdef]) and
  169. (regvarinfo^.regvars[i].vartype.def.size=1) then
  170. begin
  171. regvarinfo^.regvars[i].reg:=rg.makeregsize(varregs[i],OS_8);
  172. end
  173. else
  174. if (regvarinfo^.regvars[i].vartype.def.deftype in [orddef,enumdef]) and
  175. (regvarinfo^.regvars[i].vartype.def.size=2) then
  176. begin
  177. regvarinfo^.regvars[i].reg:=rg.makeregsize(varregs[i],OS_16);
  178. end
  179. else
  180. begin
  181. regvarinfo^.regvars[i].reg:=varregs[i];
  182. end;
  183. { procedure uses this register }
  184. include(rg.usedinproc,varregs[i]);
  185. end
  186. else
  187. begin
  188. regvarinfo^.regvars[i] := nil;
  189. regvarinfo^.regvars_para[i] := false;
  190. end;
  191. end;
  192. end;
  193. if ((p.registersfpu+1)<maxfpuvarregs) then
  194. begin
  195. parasym:=false;
  196. symtablestack.foreach_static({$ifdef FPCPROCVAR}@{$endif}searchfpuregvars,@parasym);
  197. {$ifdef dummy}
  198. { this code should be never enabled because }
  199. { 1. the caller loads parameters into registers }
  200. { 2. (later) the CSE loads a parameter into a }
  201. { register, if necessary }
  202. { (FK) }
  203. { copy parameter into a register ? }
  204. parasym:=true;
  205. symtablestack.next.foreach_static({$ifdef FPCPROCVAR}@{$endif}searchregvars);
  206. {$endif dummy}
  207. { hold needed registers free }
  208. { in non leaf procedures we must be very careful }
  209. { with assigning registers }
  210. if aktmaxfpuregisters=-1 then
  211. begin
  212. if (procinfo.flags and pi_do_call)<>0 then
  213. begin
  214. for i:=maxfpuvarregs downto 2 do
  215. regvarinfo^.fpuregvars[i]:=nil;
  216. end
  217. else
  218. begin
  219. for i:=maxfpuvarregs downto maxfpuvarregs-p.registersfpu do
  220. regvarinfo^.fpuregvars[i]:=nil;
  221. end;
  222. end
  223. else
  224. begin
  225. for i:=aktmaxfpuregisters+1 to maxfpuvarregs do
  226. regvarinfo^.fpuregvars[i]:=nil;
  227. end;
  228. { now assign register }
  229. for i:=1 to maxfpuvarregs do
  230. begin
  231. if assigned(regvarinfo^.fpuregvars[i]) then
  232. begin
  233. {$ifdef i386}
  234. { reserve place on the FPU stack }
  235. regvarinfo^.fpuregvars[i].reg:=trgcpu(rg).correct_fpuregister(R_ST0,i);
  236. {$else i386}
  237. rg.makeregvar(regvarinfo^.fpuregvars[i].reg);
  238. {$endif i386}
  239. end;
  240. end;
  241. end;
  242. end;
  243. end;
  244. procedure store_regvar(asml: TAAsmoutput; reg: tregister);
  245. var
  246. i: longint;
  247. hr: treference;
  248. regvarinfo: pregvarinfo;
  249. vsym: tvarsym;
  250. begin
  251. regvarinfo := pregvarinfo(aktprocdef.regvarinfo);
  252. if not assigned(regvarinfo) then
  253. exit;
  254. for i := 1 to maxvarregs do
  255. if assigned(regvarinfo^.regvars[i]) and
  256. (rg.makeregsize(regvarinfo^.regvars[i].reg,OS_INT) = reg) then
  257. begin
  258. if rg.regvar_loaded[rg.makeregsize(reg,OS_INT)] then
  259. begin
  260. vsym := tvarsym(regvarinfo^.regvars[i]);
  261. { we only have to store the regvar back to memory if it's }
  262. { possible that it's been modified (JM) }
  263. if not(vsym.varspez in [vs_const,vs_var,vs_out]) then
  264. begin
  265. reference_reset(hr);
  266. if vsym.owner.symtabletype in [inlinelocalsymtable,localsymtable] then
  267. hr.offset:=-vsym.address+vsym.owner.address_fixup
  268. else
  269. hr.offset:=vsym.address+vsym.owner.address_fixup;
  270. hr.base:=procinfo.framepointer;
  271. cg.a_load_reg_ref(asml,def_cgsize(vsym.vartype.def),vsym.reg,hr);
  272. end;
  273. asml.concat(tai_regalloc.dealloc(rg.makeregsize(reg,OS_INT)));
  274. rg.regvar_loaded[rg.makeregsize(reg,OS_INT)] := false;
  275. end;
  276. break;
  277. end;
  278. end;
  279. procedure load_regvar(asml: TAAsmoutput; vsym: tvarsym);
  280. var
  281. hr: treference;
  282. opsize: tcgsize;
  283. reg : tregister;
  284. begin
  285. reg:=rg.makeregsize(vsym.reg,OS_INT);
  286. if not rg.regvar_loaded[reg] then
  287. begin
  288. asml.concat(tai_regalloc.alloc(reg));
  289. reference_reset(hr);
  290. if vsym.owner.symtabletype in [inlinelocalsymtable,localsymtable] then
  291. hr.offset:=-vsym.address+vsym.owner.address_fixup
  292. else
  293. hr.offset:=vsym.address+vsym.owner.address_fixup;
  294. hr.base:=procinfo.framepointer;
  295. if (vsym.varspez in [vs_var,vs_out]) or
  296. ((vsym.varspez=vs_const) and
  297. paramanager.push_addr_param(vsym.vartype.def,false)) then
  298. opsize := OS_ADDR
  299. else
  300. opsize := def_cgsize(vsym.vartype.def);
  301. cg.a_load_ref_reg(asml,opsize,hr,reg);
  302. rg.regvar_loaded[reg] := true;
  303. end;
  304. end;
  305. procedure load_regvar_reg(asml: TAAsmoutput; reg: tregister);
  306. var
  307. i: longint;
  308. regvarinfo: pregvarinfo;
  309. reg_spare : tregister;
  310. begin
  311. regvarinfo := pregvarinfo(aktprocdef.regvarinfo);
  312. if not assigned(regvarinfo) then
  313. exit;
  314. reg_spare := rg.makeregsize(reg,OS_INT);
  315. for i := 1 to maxvarregs do
  316. if assigned(regvarinfo^.regvars[i]) and
  317. (rg.makeregsize(regvarinfo^.regvars[i].reg,OS_INT) = reg_spare) then
  318. load_regvar(asml,tvarsym(regvarinfo^.regvars[i]))
  319. end;
  320. procedure load_all_regvars(asml: TAAsmoutput);
  321. var
  322. i: longint;
  323. regvarinfo: pregvarinfo;
  324. begin
  325. regvarinfo := pregvarinfo(aktprocdef.regvarinfo);
  326. if not assigned(regvarinfo) then
  327. exit;
  328. for i := 1 to maxvarregs do
  329. if assigned(regvarinfo^.regvars[i]) {and
  330. (makereg32(regvarinfo^.regvars[i].reg) in [R_EAX,R_EBX,R_ECX,R_EDX])} then
  331. load_regvar(asml,tvarsym(regvarinfo^.regvars[i]))
  332. end;
  333. procedure load_regvars(asml: TAAsmoutput; p: tnode);
  334. var
  335. i: longint;
  336. regvarinfo: pregvarinfo;
  337. begin
  338. if (cs_regalloc in aktglobalswitches) and
  339. ((procinfo.flags and (pi_uses_asm or pi_uses_exceptions))=0) then
  340. begin
  341. regvarinfo := pregvarinfo(aktprocdef.regvarinfo);
  342. { can happen when inlining assembler procedures (JM) }
  343. if not assigned(regvarinfo) then
  344. exit;
  345. for i:=1 to maxvarregs do
  346. begin
  347. if assigned(regvarinfo^.regvars[i]) then
  348. begin
  349. if cs_asm_source in aktglobalswitches then
  350. asml.insert(tai_comment.Create(strpnew(regvarinfo^.regvars[i].name+
  351. ' with weight '+tostr(regvarinfo^.regvars[i].refs)+' assigned to register '+
  352. std_reg2str[regvarinfo^.regvars[i].reg])));
  353. if (status.verbosity and v_debug)=v_debug then
  354. Message3(cg_d_register_weight,std_reg2str[regvarinfo^.regvars[i].reg],
  355. tostr(regvarinfo^.regvars[i].refs),regvarinfo^.regvars[i].name);
  356. end;
  357. end;
  358. for i:=1 to maxfpuvarregs do
  359. begin
  360. if assigned(regvarinfo^.fpuregvars[i]) then
  361. begin
  362. {$ifdef i386}
  363. { reserve place on the FPU stack }
  364. regvarinfo^.fpuregvars[i].reg:=trgcpu(rg).correct_fpuregister(R_ST0,i-1);
  365. asml.concat(Taicpu.op_none(A_FLDZ,S_NO));
  366. {$endif i386}
  367. end;
  368. end;
  369. {$ifdef i386}
  370. if assigned(p) then
  371. if cs_asm_source in aktglobalswitches then
  372. asml.insert(tai_comment.Create(strpnew(tostr(p.registersfpu)+
  373. ' registers on FPU stack used by temp. expressions')));
  374. {$endif i386}
  375. for i:=1 to maxfpuvarregs do
  376. begin
  377. if assigned(regvarinfo^.fpuregvars[i]) then
  378. begin
  379. if cs_asm_source in aktglobalswitches then
  380. asml.insert(tai_comment.Create(strpnew(regvarinfo^.fpuregvars[i].name+
  381. ' with weight '+tostr(regvarinfo^.fpuregvars[i].refs)+' assigned to register '+
  382. std_reg2str[regvarinfo^.fpuregvars[i].reg])));
  383. if (status.verbosity and v_debug)=v_debug then
  384. Message3(cg_d_register_weight,std_reg2str[regvarinfo^.fpuregvars[i].reg],
  385. tostr(regvarinfo^.fpuregvars[i].refs),regvarinfo^.fpuregvars[i].name);
  386. end;
  387. end;
  388. if cs_asm_source in aktglobalswitches then
  389. asml.insert(tai_comment.Create(strpnew('Register variable assignment:')));
  390. end;
  391. end;
  392. procedure sync_regvars(list1, list2: taasmoutput; const regvarsloaded1,
  393. regvarsloaded2: regvar_booleanarray);
  394. var
  395. counter: tregister;
  396. begin
  397. for counter := low(rg.regvar_loaded) to high(rg.regvar_loaded) do
  398. begin
  399. rg.regvar_loaded[counter] := regvarsloaded1[counter] and
  400. regvarsloaded2[counter];
  401. if regvarsloaded1[counter] xor regvarsloaded2[counter] then
  402. if regvarsloaded1[counter] then
  403. load_regvar_reg(list2,counter)
  404. else
  405. load_regvar_reg(list1,counter);
  406. end;
  407. end;
  408. procedure cleanup_regvars(asml: TAAsmoutput);
  409. var
  410. i: longint;
  411. reg : tregister;
  412. begin
  413. { can happen when inlining assembler procedures (JM) }
  414. if not assigned(aktprocdef.regvarinfo) then
  415. exit;
  416. if (cs_regalloc in aktglobalswitches) and
  417. ((procinfo.flags and (pi_uses_asm or pi_uses_exceptions))=0) then
  418. with pregvarinfo(aktprocdef.regvarinfo)^ do
  419. begin
  420. {$ifdef i386}
  421. for i:=1 to maxfpuvarregs do
  422. if assigned(fpuregvars[i]) then
  423. { ... and clean it up }
  424. asml.concat(Taicpu.op_reg(A_FSTP,S_NO,R_ST0));
  425. {$endif i386}
  426. for i := 1 to maxvarregs do
  427. begin
  428. if assigned(regvars[i]) then
  429. begin
  430. reg:=rg.makeregsize(regvars[i].reg,OS_INT);
  431. if (rg.regvar_loaded[reg]) then
  432. asml.concat(tai_regalloc.dealloc(reg));
  433. end;
  434. end;
  435. end;
  436. end;
  437. end.
  438. {
  439. $Log$
  440. Revision 1.41 2002-08-25 19:25:20 peter
  441. * sym.insert_in_data removed
  442. * symtable.insertvardata/insertconstdata added
  443. * removed insert_in_data call from symtable.insert, it needs to be
  444. called separatly. This allows to deref the address calculation
  445. * procedures now calculate the parast addresses after the procedure
  446. directives are parsed. This fixes the cdecl parast problem
  447. * push_addr_param has an extra argument that specifies if cdecl is used
  448. or not
  449. Revision 1.40 2002/08/18 20:06:25 peter
  450. * inlining is now also allowed in interface
  451. * renamed write/load to ppuwrite/ppuload
  452. * tnode storing in ppu
  453. * nld,ncon,nbas are already updated for storing in ppu
  454. Revision 1.39 2002/08/17 09:23:41 florian
  455. * first part of procinfo rewrite
  456. Revision 1.38 2002/08/06 20:55:22 florian
  457. * first part of ppc calling conventions fix
  458. Revision 1.37 2002/07/20 11:57:57 florian
  459. * types.pas renamed to defbase.pas because D6 contains a types
  460. unit so this would conflicts if D6 programms are compiled
  461. + Willamette/SSE2 instructions to assembler added
  462. Revision 1.36 2002/07/11 14:41:30 florian
  463. * start of the new generic parameter handling
  464. Revision 1.35 2002/07/01 18:46:25 peter
  465. * internal linker
  466. * reorganized aasm layer
  467. Revision 1.34 2002/06/24 12:43:00 jonas
  468. * fixed errors found with new -CR code from Peter when cycling with -O2p3r
  469. Revision 1.33 2002/05/18 13:34:17 peter
  470. * readded missing revisions
  471. Revision 1.32 2002/05/16 19:46:44 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.30 2002/05/12 16:53:10 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.29 2002/04/21 15:23:34 carl
  493. + changeregsize -> makeregsize
  494. Revision 1.28 2002/04/19 15:46:03 peter
  495. * mangledname rewrite, tprocdef.mangledname is now created dynamicly
  496. in most cases and not written to the ppu
  497. * add mangeledname_prefix() routine to generate the prefix of
  498. manglednames depending on the current procedure, object and module
  499. * removed static procprefix since the mangledname is now build only
  500. on demand from tprocdef.mangledname
  501. Revision 1.27 2002/04/15 19:44:19 peter
  502. * fixed stackcheck that would be called recursively when a stack
  503. error was found
  504. * generic changeregsize(reg,size) for i386 register resizing
  505. * removed some more routines from cga unit
  506. * fixed returnvalue handling
  507. * fixed default stacksize of linux and go32v2, 8kb was a bit small :-)
  508. Revision 1.26 2002/04/15 19:04:04 carl
  509. + reg2str -> std_reg2str()
  510. Revision 1.25 2002/04/06 18:13:01 jonas
  511. * several powerpc-related additions and fixes
  512. Revision 1.24 2002/04/02 17:11:29 peter
  513. * tlocation,treference update
  514. * LOC_CONSTANT added for better constant handling
  515. * secondadd splitted in multiple routines
  516. * location_force_reg added for loading a location to a register
  517. of a specified size
  518. * secondassignment parses now first the right and then the left node
  519. (this is compatible with Kylix). This saves a lot of push/pop especially
  520. with string operations
  521. * adapted some routines to use the new cg methods
  522. Revision 1.23 2002/03/31 20:26:36 jonas
  523. + a_loadfpu_* and a_loadmm_* methods in tcg
  524. * register allocation is now handled by a class and is mostly processor
  525. independent (+rgobj.pas and i386/rgcpu.pas)
  526. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  527. * some small improvements and fixes to the optimizer
  528. * some register allocation fixes
  529. * some fpuvaroffset fixes in the unary minus node
  530. * push/popusedregisters is now called rg.save/restoreusedregisters and
  531. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  532. also better optimizable)
  533. * fixed and optimized register saving/restoring for new/dispose nodes
  534. * LOC_FPU locations now also require their "register" field to be set to
  535. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  536. - list field removed of the tnode class because it's not used currently
  537. and can cause hard-to-find bugs
  538. }