regvars.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  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,defutil,
  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. r : Tregister;
  126. begin
  127. { max. optimizations }
  128. { only if no asm is used }
  129. { and no try statement }
  130. if (cs_regalloc in aktglobalswitches) and
  131. ((procinfo.flags and (pi_uses_asm or pi_uses_exceptions))=0) then
  132. begin
  133. new(regvarinfo);
  134. fillchar(regvarinfo^,sizeof(regvarinfo^),0);
  135. aktprocdef.regvarinfo := regvarinfo;
  136. if (p.registers32<4) then
  137. begin
  138. parasym:=false;
  139. symtablestack.foreach_static({$ifdef FPCPROCVAR}@{$endif}searchregvars,@parasym);
  140. { copy parameter into a register ? }
  141. parasym:=true;
  142. symtablestack.next.foreach_static({$ifdef FPCPROCVAR}@{$endif}searchregvars,@parasym);
  143. { hold needed registers free }
  144. for i:=maxvarregs downto maxvarregs-p.registers32+1 do
  145. begin
  146. regvarinfo^.regvars[i]:=nil;
  147. regvarinfo^.regvars_para[i] := false;
  148. end;
  149. { now assign register }
  150. for i:=1 to maxvarregs-p.registers32 do
  151. begin
  152. if assigned(regvarinfo^.regvars[i]) and
  153. (rg.reg_pushes[varregs[i]] < regvarinfo^.regvars[i].refs) then
  154. begin
  155. { register is no longer available for }
  156. { expressions }
  157. { search the register which is the most }
  158. { unused }
  159. r.enum:=varregs[i];
  160. rg.makeregvar(r);
  161. { possibly no 32 bit register are needed }
  162. { call by reference/const ? }
  163. if (regvarinfo^.regvars[i].varspez in [vs_var,vs_out]) or
  164. ((regvarinfo^.regvars[i].varspez=vs_const) and
  165. paramanager.push_addr_param(regvarinfo^.regvars[i].vartype.def,aktprocdef.proccalloption)) then
  166. begin
  167. r.enum:=varregs[i];
  168. regvarinfo^.regvars[i].reg:=r;
  169. end
  170. else
  171. if (regvarinfo^.regvars[i].vartype.def.deftype in [orddef,enumdef]) and
  172. (regvarinfo^.regvars[i].vartype.def.size=1) then
  173. begin
  174. r.enum:=varregs[i];
  175. regvarinfo^.regvars[i].reg:=rg.makeregsize(r,OS_8);
  176. end
  177. else
  178. if (regvarinfo^.regvars[i].vartype.def.deftype in [orddef,enumdef]) and
  179. (regvarinfo^.regvars[i].vartype.def.size=2) then
  180. begin
  181. r.enum:=varregs[i];
  182. regvarinfo^.regvars[i].reg:=rg.makeregsize(r,OS_16);
  183. end
  184. else
  185. begin
  186. r.enum:=varregs[i];
  187. regvarinfo^.regvars[i].reg:=r;
  188. end;
  189. { procedure uses this register }
  190. include(rg.usedinproc,varregs[i]);
  191. end
  192. else
  193. begin
  194. regvarinfo^.regvars[i] := nil;
  195. regvarinfo^.regvars_para[i] := false;
  196. end;
  197. end;
  198. end;
  199. if ((p.registersfpu+1)<maxfpuvarregs) then
  200. begin
  201. parasym:=false;
  202. symtablestack.foreach_static({$ifdef FPCPROCVAR}@{$endif}searchfpuregvars,@parasym);
  203. {$ifdef dummy}
  204. { this code should be never enabled because }
  205. { 1. the caller loads parameters into registers }
  206. { 2. (later) the CSE loads a parameter into a }
  207. { register, if necessary }
  208. { (FK) }
  209. { copy parameter into a register ? }
  210. parasym:=true;
  211. symtablestack.next.foreach_static({$ifdef FPCPROCVAR}@{$endif}searchregvars);
  212. {$endif dummy}
  213. { hold needed registers free }
  214. { in non leaf procedures we must be very careful }
  215. { with assigning registers }
  216. if aktmaxfpuregisters=-1 then
  217. begin
  218. if (procinfo.flags and pi_do_call)<>0 then
  219. begin
  220. for i:=maxfpuvarregs downto 2 do
  221. regvarinfo^.fpuregvars[i]:=nil;
  222. end
  223. else
  224. begin
  225. for i:=maxfpuvarregs downto maxfpuvarregs-p.registersfpu do
  226. regvarinfo^.fpuregvars[i]:=nil;
  227. end;
  228. end
  229. else
  230. begin
  231. for i:=aktmaxfpuregisters+1 to maxfpuvarregs do
  232. regvarinfo^.fpuregvars[i]:=nil;
  233. end;
  234. { now assign register }
  235. for i:=1 to maxfpuvarregs do
  236. begin
  237. if assigned(regvarinfo^.fpuregvars[i]) then
  238. begin
  239. {$ifdef i386}
  240. { reserve place on the FPU stack }
  241. r.enum:=R_ST0;
  242. regvarinfo^.fpuregvars[i].reg:=trgcpu(rg).correct_fpuregister(r,i);
  243. {$else i386}
  244. rg.makeregvar(regvarinfo^.fpuregvars[i].reg);
  245. {$endif i386}
  246. end;
  247. end;
  248. end;
  249. end;
  250. end;
  251. procedure store_regvar(asml: TAAsmoutput; reg: tregister);
  252. var
  253. i: longint;
  254. hr: treference;
  255. regvarinfo: pregvarinfo;
  256. vsym: tvarsym;
  257. begin
  258. if reg.enum>lastreg then
  259. internalerror(200301081);
  260. regvarinfo := pregvarinfo(aktprocdef.regvarinfo);
  261. if not assigned(regvarinfo) then
  262. exit;
  263. for i := 1 to maxvarregs do
  264. if assigned(regvarinfo^.regvars[i]) and
  265. (rg.makeregsize(regvarinfo^.regvars[i].reg,OS_INT).enum = reg.enum) then
  266. begin
  267. if rg.regvar_loaded[rg.makeregsize(reg,OS_INT).enum] then
  268. begin
  269. vsym := tvarsym(regvarinfo^.regvars[i]);
  270. { we only have to store the regvar back to memory if it's }
  271. { possible that it's been modified (JM) }
  272. if not(vsym.varspez in [vs_const,vs_var,vs_out]) then
  273. begin
  274. reference_reset(hr);
  275. if vsym.owner.symtabletype in [inlinelocalsymtable,localsymtable] then
  276. hr.offset:=-vsym.address+vsym.owner.address_fixup
  277. else
  278. hr.offset:=vsym.address+vsym.owner.address_fixup;
  279. hr.base:=procinfo.framepointer;
  280. cg.a_load_reg_ref(asml,def_cgsize(vsym.vartype.def),vsym.reg,hr);
  281. end;
  282. asml.concat(tai_regalloc.dealloc(rg.makeregsize(reg,OS_INT)));
  283. rg.regvar_loaded[rg.makeregsize(reg,OS_INT).enum] := false;
  284. end;
  285. break;
  286. end;
  287. end;
  288. procedure load_regvar(asml: TAAsmoutput; vsym: tvarsym);
  289. var
  290. hr: treference;
  291. opsize: tcgsize;
  292. reg : tregister;
  293. begin
  294. reg:=rg.makeregsize(vsym.reg,OS_INT);
  295. if reg.enum>lastreg then
  296. internalerror(200301081);
  297. if not rg.regvar_loaded[reg.enum] then
  298. begin
  299. asml.concat(tai_regalloc.alloc(reg));
  300. reference_reset(hr);
  301. if vsym.owner.symtabletype in [inlinelocalsymtable,localsymtable] then
  302. hr.offset:=-vsym.address+vsym.owner.address_fixup
  303. else
  304. hr.offset:=vsym.address+vsym.owner.address_fixup;
  305. hr.base:=procinfo.framepointer;
  306. if (vsym.varspez in [vs_var,vs_out]) or
  307. ((vsym.varspez=vs_const) and
  308. paramanager.push_addr_param(vsym.vartype.def,aktprocdef.proccalloption)) then
  309. opsize := OS_ADDR
  310. else
  311. opsize := def_cgsize(vsym.vartype.def);
  312. cg.a_load_ref_reg(asml,opsize,hr,reg);
  313. rg.regvar_loaded[reg.enum] := true;
  314. end;
  315. end;
  316. procedure load_regvar_reg(asml: TAAsmoutput; reg: tregister);
  317. var
  318. i: longint;
  319. regvarinfo: pregvarinfo;
  320. reg_spare : tregister;
  321. begin
  322. regvarinfo := pregvarinfo(aktprocdef.regvarinfo);
  323. if not assigned(regvarinfo) then
  324. exit;
  325. reg_spare := rg.makeregsize(reg,OS_INT);
  326. if reg_spare.enum>lastreg then
  327. internalerror(2003010801);
  328. for i := 1 to maxvarregs do
  329. if assigned(regvarinfo^.regvars[i]) and
  330. (rg.makeregsize(regvarinfo^.regvars[i].reg,OS_INT).enum = reg_spare.enum) then
  331. load_regvar(asml,tvarsym(regvarinfo^.regvars[i]))
  332. end;
  333. procedure load_all_regvars(asml: TAAsmoutput);
  334. var
  335. i: longint;
  336. regvarinfo: pregvarinfo;
  337. begin
  338. regvarinfo := pregvarinfo(aktprocdef.regvarinfo);
  339. if not assigned(regvarinfo) then
  340. exit;
  341. for i := 1 to maxvarregs do
  342. if assigned(regvarinfo^.regvars[i]) {and
  343. (makereg32(regvarinfo^.regvars[i].reg) in [R_EAX,R_EBX,R_ECX,R_EDX])} then
  344. load_regvar(asml,tvarsym(regvarinfo^.regvars[i]))
  345. end;
  346. procedure load_regvars(asml: TAAsmoutput; p: tnode);
  347. var
  348. i: longint;
  349. regvarinfo: pregvarinfo;
  350. r:Tregister;
  351. begin
  352. if (cs_regalloc in aktglobalswitches) and
  353. ((procinfo.flags and (pi_uses_asm or pi_uses_exceptions))=0) then
  354. begin
  355. regvarinfo := pregvarinfo(aktprocdef.regvarinfo);
  356. { can happen when inlining assembler procedures (JM) }
  357. if not assigned(regvarinfo) then
  358. exit;
  359. for i:=1 to maxvarregs do
  360. begin
  361. if assigned(regvarinfo^.regvars[i]) then
  362. begin
  363. if cs_asm_source in aktglobalswitches then
  364. asml.insert(tai_comment.Create(strpnew(regvarinfo^.regvars[i].name+
  365. ' with weight '+tostr(regvarinfo^.regvars[i].refs)+' assigned to register '+
  366. std_reg2str[regvarinfo^.regvars[i].reg.enum])));
  367. if (status.verbosity and v_debug)=v_debug then
  368. Message3(cg_d_register_weight,std_reg2str[regvarinfo^.regvars[i].reg.enum],
  369. tostr(regvarinfo^.regvars[i].refs),regvarinfo^.regvars[i].name);
  370. end;
  371. end;
  372. for i:=1 to maxfpuvarregs do
  373. begin
  374. if assigned(regvarinfo^.fpuregvars[i]) then
  375. begin
  376. {$ifdef i386}
  377. r.enum:=R_ST0;
  378. { reserve place on the FPU stack }
  379. regvarinfo^.fpuregvars[i].reg:=trgcpu(rg).correct_fpuregister(r,i-1);
  380. asml.concat(Taicpu.op_none(A_FLDZ,S_NO));
  381. {$endif i386}
  382. end;
  383. end;
  384. {$ifdef i386}
  385. if assigned(p) then
  386. if cs_asm_source in aktglobalswitches then
  387. asml.insert(tai_comment.Create(strpnew(tostr(p.registersfpu)+
  388. ' registers on FPU stack used by temp. expressions')));
  389. {$endif i386}
  390. for i:=1 to maxfpuvarregs do
  391. begin
  392. if assigned(regvarinfo^.fpuregvars[i]) then
  393. begin
  394. if cs_asm_source in aktglobalswitches then
  395. asml.insert(tai_comment.Create(strpnew(regvarinfo^.fpuregvars[i].name+
  396. ' with weight '+tostr(regvarinfo^.fpuregvars[i].refs)+' assigned to register '+
  397. std_reg2str[regvarinfo^.fpuregvars[i].reg.enum])));
  398. if (status.verbosity and v_debug)=v_debug then
  399. Message3(cg_d_register_weight,std_reg2str[regvarinfo^.fpuregvars[i].reg.enum],
  400. tostr(regvarinfo^.fpuregvars[i].refs),regvarinfo^.fpuregvars[i].name);
  401. end;
  402. end;
  403. if cs_asm_source in aktglobalswitches then
  404. asml.insert(tai_comment.Create(strpnew('Register variable assignment:')));
  405. end;
  406. end;
  407. procedure sync_regvars(list1, list2: taasmoutput; const regvarsloaded1,
  408. regvarsloaded2: regvar_booleanarray);
  409. var
  410. counter: tregister;
  411. begin
  412. for counter.enum := low(rg.regvar_loaded) to high(rg.regvar_loaded) do
  413. begin
  414. rg.regvar_loaded[counter.enum] := regvarsloaded1[counter.enum] and
  415. regvarsloaded2[counter.enum];
  416. if regvarsloaded1[counter.enum] xor regvarsloaded2[counter.enum] then
  417. if regvarsloaded1[counter.enum] then
  418. load_regvar_reg(list2,counter)
  419. else
  420. load_regvar_reg(list1,counter);
  421. end;
  422. end;
  423. procedure cleanup_regvars(asml: TAAsmoutput);
  424. var
  425. i: longint;
  426. r,reg : tregister;
  427. begin
  428. { can happen when inlining assembler procedures (JM) }
  429. if not assigned(aktprocdef.regvarinfo) then
  430. exit;
  431. if (cs_regalloc in aktglobalswitches) and
  432. ((procinfo.flags and (pi_uses_asm or pi_uses_exceptions))=0) then
  433. with pregvarinfo(aktprocdef.regvarinfo)^ do
  434. begin
  435. {$ifdef i386}
  436. r.enum:=R_ST0;
  437. for i:=1 to maxfpuvarregs do
  438. if assigned(fpuregvars[i]) then
  439. { ... and clean it up }
  440. asml.concat(Taicpu.op_reg(A_FSTP,S_NO,r));
  441. {$endif i386}
  442. for i := 1 to maxvarregs do
  443. begin
  444. if assigned(regvars[i]) then
  445. begin
  446. reg:=rg.makeregsize(regvars[i].reg,OS_INT);
  447. if reg.enum>lastreg then
  448. internalerror(200201081);
  449. if (rg.regvar_loaded[reg.enum]) then
  450. asml.concat(tai_regalloc.dealloc(reg));
  451. end;
  452. end;
  453. end;
  454. end;
  455. end.
  456. {
  457. $Log$
  458. Revision 1.44 2003-01-08 18:43:57 daniel
  459. * Tregister changed into a record
  460. Revision 1.43 2002/11/25 17:43:24 peter
  461. * splitted defbase in defutil,symutil,defcmp
  462. * merged isconvertable and is_equal into compare_defs(_ext)
  463. * made operator search faster by walking the list only once
  464. Revision 1.42 2002/11/18 17:31:59 peter
  465. * pass proccalloption to ret_in_xxx and push_xxx functions
  466. Revision 1.41 2002/08/25 19:25:20 peter
  467. * sym.insert_in_data removed
  468. * symtable.insertvardata/insertconstdata added
  469. * removed insert_in_data call from symtable.insert, it needs to be
  470. called separatly. This allows to deref the address calculation
  471. * procedures now calculate the parast addresses after the procedure
  472. directives are parsed. This fixes the cdecl parast problem
  473. * push_addr_param has an extra argument that specifies if cdecl is used
  474. or not
  475. Revision 1.40 2002/08/18 20:06:25 peter
  476. * inlining is now also allowed in interface
  477. * renamed write/load to ppuwrite/ppuload
  478. * tnode storing in ppu
  479. * nld,ncon,nbas are already updated for storing in ppu
  480. Revision 1.39 2002/08/17 09:23:41 florian
  481. * first part of procinfo rewrite
  482. Revision 1.38 2002/08/06 20:55:22 florian
  483. * first part of ppc calling conventions fix
  484. Revision 1.37 2002/07/20 11:57:57 florian
  485. * types.pas renamed to defbase.pas because D6 contains a types
  486. unit so this would conflicts if D6 programms are compiled
  487. + Willamette/SSE2 instructions to assembler added
  488. Revision 1.36 2002/07/11 14:41:30 florian
  489. * start of the new generic parameter handling
  490. Revision 1.35 2002/07/01 18:46:25 peter
  491. * internal linker
  492. * reorganized aasm layer
  493. Revision 1.34 2002/06/24 12:43:00 jonas
  494. * fixed errors found with new -CR code from Peter when cycling with -O2p3r
  495. Revision 1.33 2002/05/18 13:34:17 peter
  496. * readded missing revisions
  497. Revision 1.32 2002/05/16 19:46:44 carl
  498. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  499. + try to fix temp allocation (still in ifdef)
  500. + generic constructor calls
  501. + start of tassembler / tmodulebase class cleanup
  502. Revision 1.30 2002/05/12 16:53:10 peter
  503. * moved entry and exitcode to ncgutil and cgobj
  504. * foreach gets extra argument for passing local data to the
  505. iterator function
  506. * -CR checks also class typecasts at runtime by changing them
  507. into as
  508. * fixed compiler to cycle with the -CR option
  509. * fixed stabs with elf writer, finally the global variables can
  510. be watched
  511. * removed a lot of routines from cga unit and replaced them by
  512. calls to cgobj
  513. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  514. u32bit then the other is typecasted also to u32bit without giving
  515. a rangecheck warning/error.
  516. * fixed pascal calling method with reversing also the high tree in
  517. the parast, detected by tcalcst3 test
  518. Revision 1.29 2002/04/21 15:23:34 carl
  519. + changeregsize -> makeregsize
  520. Revision 1.28 2002/04/19 15:46:03 peter
  521. * mangledname rewrite, tprocdef.mangledname is now created dynamicly
  522. in most cases and not written to the ppu
  523. * add mangeledname_prefix() routine to generate the prefix of
  524. manglednames depending on the current procedure, object and module
  525. * removed static procprefix since the mangledname is now build only
  526. on demand from tprocdef.mangledname
  527. Revision 1.27 2002/04/15 19:44:19 peter
  528. * fixed stackcheck that would be called recursively when a stack
  529. error was found
  530. * generic changeregsize(reg,size) for i386 register resizing
  531. * removed some more routines from cga unit
  532. * fixed returnvalue handling
  533. * fixed default stacksize of linux and go32v2, 8kb was a bit small :-)
  534. Revision 1.26 2002/04/15 19:04:04 carl
  535. + reg2str -> std_reg2str()
  536. Revision 1.25 2002/04/06 18:13:01 jonas
  537. * several powerpc-related additions and fixes
  538. Revision 1.24 2002/04/02 17:11:29 peter
  539. * tlocation,treference update
  540. * LOC_CONSTANT added for better constant handling
  541. * secondadd splitted in multiple routines
  542. * location_force_reg added for loading a location to a register
  543. of a specified size
  544. * secondassignment parses now first the right and then the left node
  545. (this is compatible with Kylix). This saves a lot of push/pop especially
  546. with string operations
  547. * adapted some routines to use the new cg methods
  548. Revision 1.23 2002/03/31 20:26:36 jonas
  549. + a_loadfpu_* and a_loadmm_* methods in tcg
  550. * register allocation is now handled by a class and is mostly processor
  551. independent (+rgobj.pas and i386/rgcpu.pas)
  552. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  553. * some small improvements and fixes to the optimizer
  554. * some register allocation fixes
  555. * some fpuvaroffset fixes in the unary minus node
  556. * push/popusedregisters is now called rg.save/restoreusedregisters and
  557. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  558. also better optimizable)
  559. * fixed and optimized register saving/restoring for new/dispose nodes
  560. * LOC_FPU locations now also require their "register" field to be set to
  561. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  562. - list field removed of the tnode class because it's not used currently
  563. and can cause hard-to-find bugs
  564. }