ncgflw.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Generate assembler for nodes that influence the flow which are
  5. the same for all (most?) processors
  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 ncgflw;
  20. {$i fpcdefs.inc}
  21. interface
  22. uses
  23. node,nflw;
  24. type
  25. tcgwhilerepeatnode = class(twhilerepeatnode)
  26. procedure pass_2;override;
  27. end;
  28. tcgifnode = class(tifnode)
  29. procedure pass_2;override;
  30. end;
  31. tcgfornode = class(tfornode)
  32. procedure pass_2;override;
  33. end;
  34. tcgexitnode = class(texitnode)
  35. procedure pass_2;override;
  36. end;
  37. tcgbreaknode = class(tbreaknode)
  38. procedure pass_2;override;
  39. end;
  40. tcgcontinuenode = class(tcontinuenode)
  41. procedure pass_2;override;
  42. end;
  43. tcggotonode = class(tgotonode)
  44. procedure pass_2;override;
  45. end;
  46. tcglabelnode = class(tlabelnode)
  47. procedure pass_2;override;
  48. end;
  49. tcgfailnode = class(tfailnode)
  50. procedure pass_2;override;
  51. end;
  52. implementation
  53. uses
  54. verbose,globals,systems,globtype,
  55. symconst,symsym,aasm,types,
  56. cginfo,cgbase,pass_2,
  57. cpubase,cpuasm,cpuinfo,
  58. nld,ncon,
  59. tgobj,rgobj,
  60. ncgutil,
  61. regvars,cgobj,cgcpu,cg64f32;
  62. {*****************************************************************************
  63. Second_While_RepeatN
  64. *****************************************************************************}
  65. procedure tcgwhilerepeatnode.pass_2;
  66. var
  67. lcont,lbreak,lloop,
  68. oldclabel,oldblabel : tasmlabel;
  69. otlabel,oflabel : tasmlabel;
  70. begin
  71. getlabel(lloop);
  72. getlabel(lcont);
  73. getlabel(lbreak);
  74. { arrange continue and breaklabels: }
  75. oldclabel:=aktcontinuelabel;
  76. oldblabel:=aktbreaklabel;
  77. load_all_regvars(exprasmlist);
  78. { handling code at the end as it is much more efficient, and makes
  79. while equal to repeat loop, only the end true/false is swapped (PFV) }
  80. if nodetype=whilen then
  81. cg.a_jmp_always(exprasmlist,lcont);
  82. { align loop target }
  83. exprasmList.concat(Tai_align.Create(aktalignment.loopalign));
  84. cg.a_label(exprasmlist,lloop);
  85. aktcontinuelabel:=lcont;
  86. aktbreaklabel:=lbreak;
  87. rg.cleartempgen;
  88. if assigned(right) then
  89. secondpass(right);
  90. load_all_regvars(exprasmlist);
  91. cg.a_label(exprasmlist,lcont);
  92. otlabel:=truelabel;
  93. oflabel:=falselabel;
  94. if nodetype=whilen then
  95. begin
  96. truelabel:=lloop;
  97. falselabel:=lbreak;
  98. end
  99. { repeatn }
  100. else
  101. begin
  102. truelabel:=lbreak;
  103. falselabel:=lloop;
  104. end;
  105. rg.cleartempgen;
  106. secondpass(left);
  107. maketojumpbool(exprasmlist,left,lr_load_regvars);
  108. cg.a_label(exprasmlist,lbreak);
  109. truelabel:=otlabel;
  110. falselabel:=oflabel;
  111. aktcontinuelabel:=oldclabel;
  112. aktbreaklabel:=oldblabel;
  113. { a break/continue in a while/repeat block can't be seen outside }
  114. flowcontrol:=flowcontrol-[fc_break,fc_continue];
  115. end;
  116. {*****************************************************************************
  117. tcgIFNODE
  118. *****************************************************************************}
  119. procedure tcgifnode.pass_2;
  120. var
  121. hl,otlabel,oflabel : tasmlabel;
  122. org_regvar_loaded,
  123. then_regvar_loaded,
  124. else_regvar_loaded : regvar_booleanarray;
  125. org_list,
  126. then_list,
  127. else_list : taasmoutput;
  128. begin
  129. otlabel:=truelabel;
  130. oflabel:=falselabel;
  131. getlabel(truelabel);
  132. getlabel(falselabel);
  133. rg.cleartempgen;
  134. secondpass(left);
  135. { save regvars loaded in the beginning so that we can restore them }
  136. { when processing the else-block }
  137. if cs_regalloc in aktglobalswitches then
  138. begin
  139. org_list := exprasmlist;
  140. exprasmlist := taasmoutput.create;
  141. end;
  142. maketojumpbool(exprasmlist,left,lr_dont_load_regvars);
  143. if cs_regalloc in aktglobalswitches then
  144. org_regvar_loaded := rg.regvar_loaded;
  145. if assigned(right) then
  146. begin
  147. cg.a_label(exprasmlist,truelabel);
  148. rg.cleartempgen;
  149. secondpass(right);
  150. end;
  151. { save current asmlist (previous instructions + then-block) and }
  152. { loaded regvar state and create new clean ones }
  153. if cs_regalloc in aktglobalswitches then
  154. begin
  155. then_regvar_loaded := rg.regvar_loaded;
  156. rg.regvar_loaded := org_regvar_loaded;
  157. then_list := exprasmlist;
  158. exprasmlist := taasmoutput.create;
  159. end;
  160. if assigned(t1) then
  161. begin
  162. if assigned(right) then
  163. begin
  164. getlabel(hl);
  165. { do go back to if line !! }
  166. if not(cs_regalloc in aktglobalswitches) then
  167. aktfilepos:=exprasmList.getlasttaifilepos^
  168. else
  169. aktfilepos:=then_list.getlasttaifilepos^;
  170. cg.a_jmp_always(exprasmlist,hl);
  171. end;
  172. cg.a_label(exprasmlist,falselabel);
  173. rg.cleartempgen;
  174. secondpass(t1);
  175. { save current asmlist (previous instructions + else-block) }
  176. { and loaded regvar state and create a new clean list }
  177. if cs_regalloc in aktglobalswitches then
  178. begin
  179. else_regvar_loaded := rg.regvar_loaded;
  180. else_list := exprasmlist;
  181. exprasmlist := taasmoutput.create;
  182. end;
  183. if assigned(right) then
  184. cg.a_label(exprasmlist,hl);
  185. end
  186. else
  187. begin
  188. if cs_regalloc in aktglobalswitches then
  189. begin
  190. else_regvar_loaded := rg.regvar_loaded;
  191. else_list := exprasmlist;
  192. exprasmlist := taasmoutput.create;
  193. end;
  194. cg.a_label(exprasmlist,falselabel);
  195. end;
  196. if not(assigned(right)) then
  197. begin
  198. cg.a_label(exprasmlist,truelabel);
  199. end;
  200. if cs_regalloc in aktglobalswitches then
  201. begin
  202. { add loads of regvars at the end of the then- and else-blocks }
  203. { so that at the end of both blocks the same regvars are loaded }
  204. { no else block? }
  205. if not assigned(t1) then
  206. sync_regvars(org_list,then_list,org_regvar_loaded,
  207. then_regvar_loaded)
  208. { no then block? }
  209. else if not assigned(right) then
  210. sync_regvars(org_list,else_list,org_regvar_loaded,
  211. else_regvar_loaded)
  212. { both else and then blocks }
  213. else
  214. sync_regvars(then_list,else_list,then_regvar_loaded,
  215. else_regvar_loaded);
  216. { add all lists together }
  217. org_list.concatlist(then_list);
  218. then_list.free;
  219. org_list.concatlist(else_list);
  220. else_list.free;
  221. org_list.concatlist(exprasmlist);
  222. exprasmlist.free;
  223. exprasmlist := org_list;
  224. end;
  225. truelabel:=otlabel;
  226. falselabel:=oflabel;
  227. end;
  228. {*****************************************************************************
  229. SecondFor
  230. *****************************************************************************}
  231. procedure tcgfornode.pass_2;
  232. var
  233. l3,oldclabel,oldblabel : tasmlabel;
  234. omitfirstcomp,temptovalue : boolean;
  235. hs : byte;
  236. temp1 : treference;
  237. hop : topcg;
  238. hcond : topcmp;
  239. opsize : tcgsize;
  240. count_var_is_signed : boolean;
  241. begin
  242. oldclabel:=aktcontinuelabel;
  243. oldblabel:=aktbreaklabel;
  244. getlabel(aktcontinuelabel);
  245. getlabel(aktbreaklabel);
  246. getlabel(l3);
  247. { could we spare the first comparison ? }
  248. omitfirstcomp:=false;
  249. if right.nodetype=ordconstn then
  250. if tassignmentnode(left).right.nodetype=ordconstn then
  251. omitfirstcomp:=((nf_backward in flags) and
  252. (tordconstnode(tassignmentnode(left).right).value>=tordconstnode(right).value))
  253. or (not(nf_backward in flags) and
  254. (tordconstnode(tassignmentnode(left).right).value<=tordconstnode(right).value));
  255. { only calculate reference }
  256. rg.cleartempgen;
  257. secondpass(t2);
  258. hs := t2.resulttype.def.size;
  259. opsize := def_cgsize(t2.resulttype.def);
  260. { first set the to value
  261. because the count var can be in the expression !! }
  262. rg.cleartempgen;
  263. secondpass(right);
  264. { calculate pointer value and check if changeable and if so }
  265. { load into temporary variable }
  266. if right.nodetype<>ordconstn then
  267. begin
  268. temp1.symbol:=nil;
  269. tg.gettempofsizereference(exprasmlist,hs,temp1);
  270. temptovalue:=true;
  271. if (right.location.loc=LOC_REGISTER) or
  272. (right.location.loc=LOC_CREGISTER) then
  273. begin
  274. cg.a_load_reg_ref(exprasmlist,opsize,
  275. right.location.register,temp1);
  276. rg.ungetregister(exprasmlist,right.location.register);
  277. end
  278. else
  279. cg.g_concatcopy(exprasmlist,right.location.reference,temp1,
  280. hs,true,false);
  281. end
  282. else
  283. temptovalue:=false;
  284. { produce start assignment }
  285. rg.cleartempgen;
  286. secondpass(left);
  287. count_var_is_signed:=is_signed(t2.resulttype.def);
  288. if nf_backward in flags then
  289. if count_var_is_signed then
  290. hcond:=OC_LT
  291. else
  292. hcond:=OC_B
  293. else
  294. if count_var_is_signed then
  295. hcond:=OC_GT
  296. else
  297. hcond:=OC_A;
  298. load_all_regvars(exprasmlist);
  299. if temptovalue then
  300. begin
  301. cg.a_cmp_ref_loc_label(exprasmlist,opsize,hcond,
  302. temp1,t2.location,aktbreaklabel);
  303. end
  304. else
  305. begin
  306. if not(omitfirstcomp) then
  307. begin
  308. cg.a_cmp_const_loc_label(exprasmlist,opsize,hcond,
  309. aword(tordconstnode(right).value),
  310. t2.location,aktbreaklabel);
  311. end;
  312. end;
  313. { align loop target }
  314. exprasmList.concat(Tai_align.Create(aktalignment.loopalign));
  315. cg.a_label(exprasmlist,l3);
  316. { help register must not be in instruction block }
  317. rg.cleartempgen;
  318. if assigned(t1) then
  319. begin
  320. secondpass(t1);
  321. load_all_regvars(exprasmlist);
  322. end;
  323. cg.a_label(exprasmlist,aktcontinuelabel);
  324. { makes no problems there }
  325. rg.cleartempgen;
  326. if nf_backward in flags then
  327. if count_var_is_signed then
  328. hcond:=OC_LTE
  329. else
  330. hcond:=OC_BE
  331. else
  332. if count_var_is_signed then
  333. hcond:=OC_GTE
  334. else
  335. hcond:=OC_AE;
  336. load_all_regvars(exprasmlist);
  337. { produce comparison and the corresponding }
  338. { jump }
  339. if temptovalue then
  340. begin
  341. cg.a_cmp_ref_loc_label(exprasmlist,opsize,hcond,temp1,
  342. t2.location,aktbreaklabel);
  343. end
  344. else
  345. begin
  346. cg.a_cmp_const_loc_label(exprasmlist,opsize,hcond,
  347. aword(tordconstnode(right).value),t2.location,aktbreaklabel);
  348. end;
  349. { according to count direction DEC or INC... }
  350. { must be after the test because of 0 to 255 for bytes !! }
  351. if nf_backward in flags then
  352. hop:=OP_SUB
  353. else
  354. hop:=OP_ADD;
  355. cg.a_op_const_loc(exprasmlist,hop,1,t2.location);
  356. cg.a_jmp_always(exprasmlist,l3);
  357. if temptovalue then
  358. tg.ungetiftemp(exprasmlist,temp1);
  359. { this is the break label: }
  360. cg.a_label(exprasmlist,aktbreaklabel);
  361. aktcontinuelabel:=oldclabel;
  362. aktbreaklabel:=oldblabel;
  363. { a break/continue in a for block can't be seen outside }
  364. flowcontrol:=flowcontrol-[fc_break,fc_continue];
  365. end;
  366. {*****************************************************************************
  367. SecondExitN
  368. *****************************************************************************}
  369. procedure tcgexitnode.pass_2;
  370. var
  371. {op : tasmop;
  372. s : topsize;}
  373. otlabel,oflabel : tasmlabel;
  374. cgsize : tcgsize;
  375. hreg : tregister;
  376. allocated_acc,
  377. allocated_acchigh: boolean;
  378. label
  379. do_jmp;
  380. begin
  381. { load_all_regvars(exprasmlist); }
  382. include(flowcontrol,fc_exit);
  383. if assigned(left) then
  384. if left.nodetype=assignn then
  385. begin
  386. { just do a normal assignment followed by exit }
  387. secondpass(left);
  388. cg.a_jmp_always(exprasmlist,aktexitlabel);
  389. end
  390. else
  391. begin
  392. allocated_acc := false;
  393. allocated_acchigh := false;
  394. otlabel:=truelabel;
  395. oflabel:=falselabel;
  396. getlabel(truelabel);
  397. getlabel(falselabel);
  398. secondpass(left);
  399. { the result of left is not needed anymore after this
  400. node }
  401. location_freetemp(exprasmlist,left.location);
  402. location_release(exprasmlist,left.location);
  403. case left.location.loc of
  404. LOC_FPUREGISTER :
  405. goto do_jmp;
  406. LOC_FLAGS :
  407. begin
  408. cg.a_reg_alloc(exprasmlist,accumulator);
  409. allocated_acc := true;
  410. cg.g_flags2reg(exprasmlist,left.location.resflags,accumulator);
  411. goto do_jmp;
  412. end;
  413. LOC_JUMP :
  414. begin
  415. cg.a_reg_alloc(exprasmlist,accumulator);
  416. { get an 8-bit register }
  417. hreg:=rg.makeregsize(accumulator,OS_8);
  418. allocated_acc := true;
  419. cg.a_label(exprasmlist,truelabel);
  420. cg.a_load_const_reg(exprasmlist,OS_8,1,hreg);
  421. cg.a_jmp_always(exprasmlist,aktexit2label);
  422. cg.a_label(exprasmlist,falselabel);
  423. cg.a_load_const_reg(exprasmlist,OS_8,0,hreg);
  424. goto do_jmp;
  425. end;
  426. end;
  427. case aktprocdef.rettype.def.deftype of
  428. pointerdef,
  429. procvardef :
  430. begin
  431. cg.a_reg_alloc(exprasmlist,accumulator);
  432. allocated_acc := true;
  433. cg.a_load_loc_reg(exprasmlist,left.location,accumulator);
  434. end;
  435. floatdef :
  436. begin
  437. {$ifndef i386}
  438. cg.a_reg_alloc(exprasmlist,fpuresultreg);
  439. {$endif not i386}
  440. cg.a_loadfpu_loc_reg(exprasmlist,left.location,fpuresultreg);
  441. end;
  442. else
  443. begin
  444. cgsize:=def_cgsize(aktprocdef.rettype.def);
  445. cg.a_reg_alloc(exprasmlist,accumulator);
  446. allocated_acc := true;
  447. case cgsize of
  448. OS_64,OS_S64 :
  449. begin
  450. cg.a_reg_alloc(exprasmlist,accumulatorhigh);
  451. allocated_acchigh := true;
  452. cg64.a_load64_loc_reg(exprasmlist,left.location,
  453. joinreg64(accumulator,accumulatorhigh));
  454. end
  455. else
  456. begin
  457. hreg:=rg.makeregsize(accumulator,cgsize);
  458. cg.a_load_loc_reg(exprasmlist,left.location,hreg);
  459. end;
  460. end;
  461. end;
  462. end;
  463. do_jmp:
  464. truelabel:=otlabel;
  465. falselabel:=oflabel;
  466. cg.a_jmp_always(exprasmlist,aktexit2label);
  467. if allocated_acc then
  468. cg.a_reg_dealloc(exprasmlist,accumulator);
  469. if allocated_acchigh then
  470. cg.a_reg_dealloc(exprasmlist,accumulatorhigh);
  471. {$ifndef i386}
  472. if (aktprocdef.rettype.def.deftype = floatdef) then
  473. cg.a_reg_dealloc(exprasmlist,fpuresultreg);
  474. {$endif not i386}
  475. end
  476. else
  477. cg.a_jmp_always(exprasmlist,aktexitlabel);
  478. end;
  479. {*****************************************************************************
  480. SecondBreakN
  481. *****************************************************************************}
  482. procedure tcgbreaknode.pass_2;
  483. begin
  484. include(flowcontrol,fc_break);
  485. if aktbreaklabel<>nil then
  486. begin
  487. load_all_regvars(exprasmlist);
  488. cg.a_jmp_always(exprasmlist,aktbreaklabel)
  489. end
  490. else
  491. CGMessage(cg_e_break_not_allowed);
  492. end;
  493. {*****************************************************************************
  494. SecondContinueN
  495. *****************************************************************************}
  496. procedure tcgcontinuenode.pass_2;
  497. begin
  498. include(flowcontrol,fc_continue);
  499. if aktcontinuelabel<>nil then
  500. begin
  501. load_all_regvars(exprasmlist);
  502. cg.a_jmp_always(exprasmlist,aktcontinuelabel)
  503. end
  504. else
  505. CGMessage(cg_e_continue_not_allowed);
  506. end;
  507. {*****************************************************************************
  508. SecondGoto
  509. *****************************************************************************}
  510. procedure tcggotonode.pass_2;
  511. begin
  512. load_all_regvars(exprasmlist);
  513. cg.a_jmp_always(exprasmlist,labelnr)
  514. end;
  515. {*****************************************************************************
  516. SecondLabel
  517. *****************************************************************************}
  518. procedure tcglabelnode.pass_2;
  519. begin
  520. load_all_regvars(exprasmlist);
  521. cg.a_label(exprasmlist,labelnr);
  522. rg.cleartempgen;
  523. secondpass(left);
  524. end;
  525. {*****************************************************************************
  526. SecondFail
  527. *****************************************************************************}
  528. procedure tcgfailnode.pass_2;
  529. begin
  530. cg.a_jmp_always(exprasmlist,faillabel);
  531. end;
  532. begin
  533. cwhilerepeatnode:=tcgwhilerepeatnode;
  534. cifnode:=tcgifnode;
  535. cfornode:=tcgfornode;
  536. cexitnode:=tcgexitnode;
  537. cbreaknode:=tcgbreaknode;
  538. ccontinuenode:=tcgcontinuenode;
  539. cgotonode:=tcggotonode;
  540. clabelnode:=tcglabelnode;
  541. cfailnode:=tcgfailnode;
  542. end.
  543. {
  544. $Log$
  545. Revision 1.20 2002-07-01 16:23:53 peter
  546. * cg64 patch
  547. * basics for currency
  548. * asnode updates for class and interface (not finished)
  549. Revision 1.19 2002/05/20 13:30:40 carl
  550. * bugfix of hdisponen (base must be set, not index)
  551. * more portability fixes
  552. Revision 1.18 2002/05/18 13:34:09 peter
  553. * readded missing revisions
  554. Revision 1.17 2002/05/16 19:46:37 carl
  555. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  556. + try to fix temp allocation (still in ifdef)
  557. + generic constructor calls
  558. + start of tassembler / tmodulebase class cleanup
  559. Revision 1.15 2002/05/13 19:54:37 peter
  560. * removed n386ld and n386util units
  561. * maybe_save/maybe_restore added instead of the old maybe_push
  562. Revision 1.14 2002/05/12 16:53:07 peter
  563. * moved entry and exitcode to ncgutil and cgobj
  564. * foreach gets extra argument for passing local data to the
  565. iterator function
  566. * -CR checks also class typecasts at runtime by changing them
  567. into as
  568. * fixed compiler to cycle with the -CR option
  569. * fixed stabs with elf writer, finally the global variables can
  570. be watched
  571. * removed a lot of routines from cga unit and replaced them by
  572. calls to cgobj
  573. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  574. u32bit then the other is typecasted also to u32bit without giving
  575. a rangecheck warning/error.
  576. * fixed pascal calling method with reversing also the high tree in
  577. the parast, detected by tcalcst3 test
  578. Revision 1.13 2002/04/21 15:24:38 carl
  579. + a_jmp_cond -> a_jmp_always (a_jmp_cond is NOT portable)
  580. + changeregsize -> rg.makeregsize
  581. Revision 1.12 2002/04/15 19:44:19 peter
  582. * fixed stackcheck that would be called recursively when a stack
  583. error was found
  584. * generic changeregsize(reg,size) for i386 register resizing
  585. * removed some more routines from cga unit
  586. * fixed returnvalue handling
  587. * fixed default stacksize of linux and go32v2, 8kb was a bit small :-)
  588. Revision 1.11 2002/04/04 19:05:57 peter
  589. * removed unused units
  590. * use tlocation.size in cg.a_*loc*() routines
  591. Revision 1.10 2002/04/02 17:11:28 peter
  592. * tlocation,treference update
  593. * LOC_CONSTANT added for better constant handling
  594. * secondadd splitted in multiple routines
  595. * location_force_reg added for loading a location to a register
  596. of a specified size
  597. * secondassignment parses now first the right and then the left node
  598. (this is compatible with Kylix). This saves a lot of push/pop especially
  599. with string operations
  600. * adapted some routines to use the new cg methods
  601. Revision 1.9 2002/03/31 20:26:34 jonas
  602. + a_loadfpu_* and a_loadmm_* methods in tcg
  603. * register allocation is now handled by a class and is mostly processor
  604. independent (+rgobj.pas and i386/rgcpu.pas)
  605. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  606. * some small improvements and fixes to the optimizer
  607. * some register allocation fixes
  608. * some fpuvaroffset fixes in the unary minus node
  609. * push/popusedregisters is now called rg.save/restoreusedregisters and
  610. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  611. also better optimizable)
  612. * fixed and optimized register saving/restoring for new/dispose nodes
  613. * LOC_FPU locations now also require their "register" field to be set to
  614. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  615. - list field removed of the tnode class because it's not used currently
  616. and can cause hard-to-find bugs
  617. Revision 1.8 2002/03/04 19:10:11 peter
  618. * removed compiler warnings
  619. }