rgcpu.pas 22 KB

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