regvars.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 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 defines.inc}
  20. interface
  21. uses
  22. aasm,
  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,types,
  40. tainst,cgbase,cpuasm,cgobj,cgcpu,cga,rgcpu;
  41. var
  42. parasym : boolean;
  43. {$ifndef i386}
  44. function makereg32(const reg: tregister): tregister;
  45. begin
  46. makereg32 := reg;
  47. end;
  48. {$endif i386}
  49. procedure searchregvars(p : tnamedindexitem);
  50. var
  51. i,j,k : longint;
  52. begin
  53. if (tsym(p).typ=varsym) and (vo_regable in tvarsym(p).varoptions) then
  54. begin
  55. j:=tvarsym(p).refs;
  56. { parameter get a less value }
  57. if parasym then
  58. begin
  59. if cs_littlesize in aktglobalswitches then
  60. dec(j,1)
  61. else
  62. dec(j,100);
  63. end;
  64. { walk through all momentary register variables }
  65. for i:=1 to maxvarregs do
  66. begin
  67. with pregvarinfo(aktprocdef.regvarinfo)^ do
  68. if ((regvars[i]=nil) or (j>regvars_refs[i])) and (j>0) then
  69. begin
  70. for k:=maxvarregs-1 downto i do
  71. begin
  72. regvars[k+1]:=regvars[k];
  73. regvars_para[k+1]:=regvars_para[k];
  74. regvars_refs[k+1]:=regvars_refs[k];
  75. end;
  76. { calc the new refs
  77. tvarsym(p).refs:=j; }
  78. regvars[i]:=tvarsym(p);
  79. regvars_para[i]:=parasym;
  80. regvars_refs[i]:=j;
  81. break;
  82. end;
  83. end;
  84. end;
  85. end;
  86. procedure searchfpuregvars(p : tnamedindexitem);
  87. var
  88. i,j,k : longint;
  89. begin
  90. if (tsym(p).typ=varsym) and (vo_fpuregable in tvarsym(p).varoptions) then
  91. begin
  92. j:=tvarsym(p).refs;
  93. { parameter get a less value }
  94. if parasym then
  95. begin
  96. if cs_littlesize in aktglobalswitches then
  97. dec(j,1)
  98. else
  99. dec(j,100);
  100. end;
  101. { walk through all momentary register variables }
  102. for i:=1 to maxfpuvarregs do
  103. begin
  104. with pregvarinfo(aktprocdef.regvarinfo)^ do
  105. if ((fpuregvars[i]=nil) or (j>fpuregvars_refs[i])) and (j>0) then
  106. begin
  107. for k:=maxfpuvarregs-1 downto i do
  108. begin
  109. fpuregvars[k+1]:=fpuregvars[k];
  110. fpuregvars_para[k+1]:=fpuregvars_para[k];
  111. fpuregvars_refs[k+1]:=fpuregvars_refs[k];
  112. end;
  113. { calc the new refs
  114. tvarsym(p).refs:=j; }
  115. fpuregvars[i]:=tvarsym(p);
  116. fpuregvars_para[i]:=parasym;
  117. fpuregvars_refs[i]:=j;
  118. break;
  119. end;
  120. end;
  121. end;
  122. end;
  123. procedure assign_regvars(p: tnode);
  124. { register variables }
  125. var
  126. regvarinfo: pregvarinfo;
  127. i: longint;
  128. begin
  129. { max. optimizations }
  130. { only if no asm is used }
  131. { and no try statement }
  132. if (cs_regalloc in aktglobalswitches) and
  133. ((procinfo^.flags and (pi_uses_asm or pi_uses_exceptions))=0) then
  134. begin
  135. new(regvarinfo);
  136. fillchar(regvarinfo^,sizeof(regvarinfo^),0);
  137. aktprocdef.regvarinfo := regvarinfo;
  138. if (p.registers32<4) then
  139. begin
  140. parasym:=false;
  141. symtablestack.foreach_static({$ifdef FPCPROCVAR}@{$endif}searchregvars);
  142. { copy parameter into a register ? }
  143. parasym:=true;
  144. symtablestack.next.foreach_static({$ifdef FPCPROCVAR}@{$endif}searchregvars);
  145. { hold needed registers free }
  146. for i:=maxvarregs downto maxvarregs-p.registers32+1 do
  147. begin
  148. regvarinfo^.regvars[i]:=nil;
  149. regvarinfo^.regvars_para[i] := false;
  150. end;
  151. { now assign register }
  152. for i:=1 to maxvarregs-p.registers32 do
  153. begin
  154. if assigned(regvarinfo^.regvars[i]) and
  155. (rg.reg_pushes[varregs[i]] < regvarinfo^.regvars[i].refs) then
  156. begin
  157. { register is no longer available for }
  158. { expressions }
  159. { search the register which is the most }
  160. { unused }
  161. rg.makeregvar(varregs[i]);
  162. { possibly no 32 bit register are needed }
  163. { call by reference/const ? }
  164. if (regvarinfo^.regvars[i].varspez in [vs_var,vs_out]) or
  165. ((regvarinfo^.regvars[i].varspez=vs_const) and
  166. push_addr_param(regvarinfo^.regvars[i].vartype.def)) then
  167. begin
  168. regvarinfo^.regvars[i].reg:=varregs[i];
  169. end
  170. else
  171. {$ifdef i386}
  172. if (regvarinfo^.regvars[i].vartype.def.deftype in [orddef,enumdef]) and
  173. (torddef(regvarinfo^.regvars[i].vartype.def).size=1) then
  174. begin
  175. regvarinfo^.regvars[i].reg:=changeregsize(varregs[i],S_B);
  176. end
  177. else
  178. if (regvarinfo^.regvars[i].vartype.def.deftype in [orddef,enumdef]) and
  179. (torddef(regvarinfo^.regvars[i].vartype.def).size=2) then
  180. begin
  181. regvarinfo^.regvars[i].reg:=changeregsize(varregs[i],S_W);
  182. end
  183. else
  184. {$endif i386}
  185. begin
  186. regvarinfo^.regvars[i].reg:=varregs[i];
  187. end;
  188. { procedure uses this register }
  189. include(rg.usedinproc,varregs[i]);
  190. end
  191. else
  192. begin
  193. regvarinfo^.regvars[i] := nil;
  194. regvarinfo^.regvars_para[i] := false;
  195. end;
  196. end;
  197. end;
  198. if ((p.registersfpu+1)<maxfpuvarregs) then
  199. begin
  200. parasym:=false;
  201. symtablestack.foreach_static({$ifdef FPCPROCVAR}@{$endif}searchfpuregvars);
  202. {$ifdef dummy}
  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. (changeregsize(regvarinfo^.regvars[i].reg,S_L) = reg) then
  257. begin
  258. if rg.regvar_loaded[changeregsize(reg,S_L)] 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(Tairegalloc.dealloc(changeregsize(reg,S_L)));
  274. rg.regvar_loaded[changeregsize(reg,S_L)] := 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. reg32 : tregister;
  284. begin
  285. reg32:=changeregsize(vsym.reg,S_L);
  286. if not rg.regvar_loaded[reg32] then
  287. begin
  288. asml.concat(Tairegalloc.alloc(reg32));
  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. push_addr_param(vsym.vartype.def)) then
  298. opsize := OS_ADDR
  299. else
  300. opsize := def_cgsize(vsym.vartype.def);
  301. cg.a_load_ref_reg(asml,opsize,hr,reg32);
  302. rg.regvar_loaded[reg32] := true;
  303. end;
  304. end;
  305. procedure load_regvar_reg(asml: TAAsmoutput; reg: tregister);
  306. var
  307. i: longint;
  308. regvarinfo: pregvarinfo;
  309. reg32 : tregister;
  310. begin
  311. regvarinfo := pregvarinfo(aktprocdef.regvarinfo);
  312. if not assigned(regvarinfo) then
  313. exit;
  314. reg32 := changeregsize(reg,S_L);
  315. for i := 1 to maxvarregs do
  316. if assigned(regvarinfo^.regvars[i]) and
  317. (changeregsize(regvarinfo^.regvars[i].reg,S_L) = reg32) 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_asm_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_asm_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_asm_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_asm_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. reg32 : 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. reg32:=changeregsize(regvars[i].reg,S_L);
  431. if (rg.regvar_loaded[reg32]) then
  432. asml.concat(Tairegalloc.dealloc(reg32));
  433. end;
  434. end;
  435. end;
  436. end;
  437. end.
  438. {
  439. $Log$
  440. Revision 1.28 2002-04-19 15:46:03 peter
  441. * mangledname rewrite, tprocdef.mangledname is now created dynamicly
  442. in most cases and not written to the ppu
  443. * add mangeledname_prefix() routine to generate the prefix of
  444. manglednames depending on the current procedure, object and module
  445. * removed static procprefix since the mangledname is now build only
  446. on demand from tprocdef.mangledname
  447. Revision 1.27 2002/04/15 19:44:19 peter
  448. * fixed stackcheck that would be called recursively when a stack
  449. error was found
  450. * generic changeregsize(reg,size) for i386 register resizing
  451. * removed some more routines from cga unit
  452. * fixed returnvalue handling
  453. * fixed default stacksize of linux and go32v2, 8kb was a bit small :-)
  454. Revision 1.26 2002/04/15 19:04:04 carl
  455. + reg2str -> std_reg2str()
  456. Revision 1.25 2002/04/06 18:13:01 jonas
  457. * several powerpc-related additions and fixes
  458. Revision 1.24 2002/04/02 17:11:29 peter
  459. * tlocation,treference update
  460. * LOC_CONSTANT added for better constant handling
  461. * secondadd splitted in multiple routines
  462. * location_force_reg added for loading a location to a register
  463. of a specified size
  464. * secondassignment parses now first the right and then the left node
  465. (this is compatible with Kylix). This saves a lot of push/pop especially
  466. with string operations
  467. * adapted some routines to use the new cg methods
  468. Revision 1.23 2002/03/31 20:26:36 jonas
  469. + a_loadfpu_* and a_loadmm_* methods in tcg
  470. * register allocation is now handled by a class and is mostly processor
  471. independent (+rgobj.pas and i386/rgcpu.pas)
  472. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  473. * some small improvements and fixes to the optimizer
  474. * some register allocation fixes
  475. * some fpuvaroffset fixes in the unary minus node
  476. * push/popusedregisters is now called rg.save/restoreusedregisters and
  477. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  478. also better optimizable)
  479. * fixed and optimized register saving/restoring for new/dispose nodes
  480. * LOC_FPU locations now also require their "register" field to be set to
  481. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  482. - list field removed of the tnode class because it's not used currently
  483. and can cause hard-to-find bugs
  484. Revision 1.22 2001/12/29 15:32:13 jonas
  485. * powerpc/cgcpu.pas compiles :)
  486. * several powerpc-related fixes
  487. * cpuasm unit is now based on common tainst unit
  488. + nppcmat unit for powerpc (almost complete)
  489. Revision 1.21 2001/12/03 12:17:02 jonas
  490. * forgot to commit yesterday :( (less unnecessary loading of regvars with
  491. if-statements)
  492. Revision 1.20 2001/11/05 16:49:32 jonas
  493. * constant regvars (addresses of var/out para's and const para's) aren't
  494. saved to memory anymore when their register will be destroyed
  495. * unit has been made mostly processor independent
  496. Revision 1.19 2001/11/02 22:58:06 peter
  497. * procsym definition rewrite
  498. Revision 1.18 2001/08/26 13:36:49 florian
  499. * some cg reorganisation
  500. * some PPC updates
  501. Revision 1.17 2001/04/21 12:03:12 peter
  502. * m68k updates merged from fixes branch
  503. Revision 1.16 2001/04/13 01:22:13 peter
  504. * symtable change to classes
  505. * range check generation and errors fixed, make cycle DEBUG=1 works
  506. * memory leaks fixed
  507. Revision 1.15 2000/12/25 00:07:28 peter
  508. + new tlinkedlist class (merge of old tstringqueue,tcontainer and
  509. tlinkedlist objects)
  510. Revision 1.14 2000/12/05 11:44:32 jonas
  511. + new integer regvar handling, should be much more efficient
  512. Revision 1.13 2000/11/29 00:30:39 florian
  513. * unused units removed from uses clause
  514. * some changes for widestrings
  515. Revision 1.12 2000/11/04 14:25:21 florian
  516. + merged Attila's changes for interfaces, not tested yet
  517. Revision 1.11 2000/10/31 22:02:51 peter
  518. * symtable splitted, no real code changes
  519. Revision 1.10 2000/10/14 10:14:52 peter
  520. * moehrendorf oct 2000 rewrite
  521. Revision 1.9 2000/10/01 19:48:25 peter
  522. * lot of compile updates for cg11
  523. Revision 1.8 2000/09/30 16:08:45 peter
  524. * more cg11 updates
  525. Revision 1.7 2000/09/30 13:08:16 jonas
  526. * regvars are now zeroed at the start of their life if they contain an 8
  527. or 16bit var/parameter, because the full 32bits are used if they are
  528. necessary for a btrl instruction
  529. Revision 1.6 2000/09/24 15:06:27 peter
  530. * use defines.inc
  531. Revision 1.5 2000/08/27 16:11:52 peter
  532. * moved some util functions from globals,cobjects to cutils
  533. * splitted files into finput,fmodule
  534. Revision 1.4 2000/08/17 11:07:51 jonas
  535. * fixed crash when inlining assembler procedures with -Or
  536. Revision 1.3 2000/08/04 05:52:00 jonas
  537. * correct version (I also had a regvars.pp locally, which was used
  538. instead of the regvars.pas on CVS, so I didn't notice the errors :( )
  539. Revision 1.2 2000/08/03 14:36:47 jonas
  540. * fixed inserting of allocated register for regvars (only those for
  541. parameters were done, and sometimes even the wrong ones)
  542. Revision 1.1 2000/08/03 13:17:25 jonas
  543. + allow regvars to be used inside inlined procs, which required the
  544. following changes:
  545. + load regvars in genentrycode/free them in genexitcode (cgai386)
  546. * moved all regvar related code to new regvars unit
  547. + added pregvarinfo type to hcodegen
  548. + added regvarinfo field to tprocinfo (symdef/symdefh)
  549. * deallocate the regvars of the caller in secondprocinline before
  550. inlining the called procedure and reallocate them afterwards
  551. }