regvars.pas 25 KB

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