nset.pas 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  1. {
  2. $Id$
  3. Copyright (c) 2000-2002 by Florian Klaempfl
  4. Type checking and register allocation for set/case nodes
  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 nset;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. node,globals,
  23. aasmbase,aasmtai,
  24. symppu;
  25. type
  26. pcaserecord = ^tcaserecord;
  27. tcaserecord = record
  28. { range }
  29. _low,_high : TConstExprInt;
  30. { only used by gentreejmp }
  31. _at : tasmlabel;
  32. { label of instruction }
  33. statement : tasmlabel;
  34. { is this the first of an case entry, needed to release statement
  35. label (PFV) }
  36. firstlabel : boolean;
  37. { left and right tree node }
  38. less,greater : pcaserecord;
  39. end;
  40. tsetelementnode = class(tbinarynode)
  41. constructor create(l,r : tnode);virtual;
  42. function det_resulttype:tnode;override;
  43. function pass_1 : tnode;override;
  44. end;
  45. tsetelementnodeclass = class of tsetelementnode;
  46. tinnode = class(tbinopnode)
  47. constructor create(l,r : tnode);virtual;
  48. function det_resulttype:tnode;override;
  49. function pass_1 : tnode;override;
  50. end;
  51. tinnodeclass = class of tinnode;
  52. trangenode = class(tbinarynode)
  53. constructor create(l,r : tnode);virtual;
  54. function det_resulttype:tnode;override;
  55. function pass_1 : tnode;override;
  56. end;
  57. trangenodeclass = class of trangenode;
  58. tcasenode = class(tbinarynode)
  59. nodes : pcaserecord;
  60. elseblock : tnode;
  61. constructor create(l,r : tnode;n : pcaserecord);virtual;
  62. destructor destroy;override;
  63. constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
  64. procedure ppuwrite(ppufile:tcompilerppufile);override;
  65. procedure derefimpl;override;
  66. function getcopy : tnode;override;
  67. procedure insertintolist(l : tnodelist);override;
  68. function det_resulttype:tnode;override;
  69. function pass_1 : tnode;override;
  70. function docompare(p: tnode): boolean; override;
  71. end;
  72. tcasenodeclass = class of tcasenode;
  73. var
  74. csetelementnode : tsetelementnodeclass;
  75. cinnode : tinnodeclass;
  76. crangenode : trangenodeclass;
  77. ccasenode : tcasenodeclass;
  78. { counts the labels }
  79. function case_count_labels(root : pcaserecord) : longint;
  80. { searches the highest label }
  81. {$ifdef int64funcresok}
  82. function case_get_max(root : pcaserecord) : tconstexprint;
  83. {$else int64funcresok}
  84. function case_get_max(root : pcaserecord) : longint;
  85. {$endif int64funcresok}
  86. { searches the lowest label }
  87. {$ifdef int64funcresok}
  88. function case_get_min(root : pcaserecord) : tconstexprint;
  89. {$else int64funcresok}
  90. function case_get_min(root : pcaserecord) : longint;
  91. {$endif int64funcresok}
  92. function gencasenode(l,r : tnode;nodes : pcaserecord) : tnode;
  93. implementation
  94. uses
  95. globtype,systems,
  96. verbose,
  97. symconst,symdef,symsym,defbase,
  98. htypechk,pass_1,
  99. ncnv,ncon,cpubase,nld,rgobj,cgbase;
  100. function gencasenode(l,r : tnode;nodes : pcaserecord) : tnode;
  101. var
  102. t : tnode;
  103. begin
  104. t:=ccasenode.create(l,r,nodes);
  105. gencasenode:=t;
  106. end;
  107. {*****************************************************************************
  108. TSETELEMENTNODE
  109. *****************************************************************************}
  110. constructor tsetelementnode.create(l,r : tnode);
  111. begin
  112. inherited create(setelementn,l,r);
  113. end;
  114. function tsetelementnode.det_resulttype:tnode;
  115. begin
  116. result:=nil;
  117. resulttypepass(left);
  118. if assigned(right) then
  119. resulttypepass(right);
  120. set_varstate(left,true);
  121. if codegenerror then
  122. exit;
  123. resulttype:=left.resulttype;
  124. end;
  125. function tsetelementnode.pass_1 : tnode;
  126. begin
  127. result:=nil;
  128. firstpass(left);
  129. if assigned(right) then
  130. firstpass(right);
  131. if codegenerror then
  132. exit;
  133. location_copy(location,left.location);
  134. calcregisters(self,0,0,0);
  135. end;
  136. {*****************************************************************************
  137. TINNODE
  138. *****************************************************************************}
  139. constructor tinnode.create(l,r : tnode);
  140. begin
  141. inherited create(inn,l,r);
  142. end;
  143. function tinnode.det_resulttype:tnode;
  144. {$ifdef oldset}
  145. type
  146. byteset = set of byte;
  147. {$endif}
  148. var
  149. t : tnode;
  150. pst : pconstset;
  151. function createsetconst(psd : tsetdef) : pconstset;
  152. var
  153. pcs : pconstset;
  154. pes : tenumsym;
  155. i : longint;
  156. begin
  157. new(pcs);
  158. case psd.elementtype.def.deftype of
  159. enumdef :
  160. begin
  161. pes:=tenumsym(tenumdef(psd.elementtype.def).firstenum);
  162. while assigned(pes) do
  163. begin
  164. {$ifdef oldset}
  165. pcs^[pes.value div 8]:=pcs^[pes.value div 8] or (1 shl (pes.value mod 8));
  166. {$else}
  167. include(pcs^,pes.value);
  168. {$endif}
  169. pes:=pes.nextenum;
  170. end;
  171. end;
  172. orddef :
  173. begin
  174. for i:=torddef(psd.elementtype.def).low to torddef(psd.elementtype.def).high do
  175. {$ifdef oldset}
  176. pcs^[i div 8]:=pcs^[i div 8] or (1 shl (i mod 8));
  177. {$else}
  178. include(pcs^,i);
  179. {$endif}
  180. end;
  181. end;
  182. createsetconst:=pcs;
  183. end;
  184. begin
  185. result:=nil;
  186. resulttype:=booltype;
  187. resulttypepass(right);
  188. set_varstate(right,true);
  189. if codegenerror then
  190. exit;
  191. { Convert array constructor first to set }
  192. if is_array_constructor(right.resulttype.def) then
  193. begin
  194. arrayconstructor_to_set(right);
  195. firstpass(right);
  196. if codegenerror then
  197. exit;
  198. end;
  199. if right.resulttype.def.deftype<>setdef then
  200. CGMessage(sym_e_set_expected);
  201. if (right.nodetype=typen) then
  202. begin
  203. { we need to create a setconstn }
  204. pst:=createsetconst(tsetdef(ttypenode(right).resulttype.def));
  205. t:=csetconstnode.create(pst,ttypenode(right).resulttype);
  206. dispose(pst);
  207. right.free;
  208. right:=t;
  209. end;
  210. resulttypepass(left);
  211. set_varstate(left,true);
  212. if codegenerror then
  213. exit;
  214. { type conversion/check }
  215. if assigned(tsetdef(right.resulttype.def).elementtype.def) then
  216. inserttypeconv(left,tsetdef(right.resulttype.def).elementtype);
  217. { empty set then return false }
  218. if not assigned(tsetdef(right.resulttype.def).elementtype.def) or
  219. ((right.nodetype = setconstn) and
  220. {$ifdef oldset}
  221. (byteset(tsetconstnode(right).value_set^) = [])) then
  222. {$else oldset}
  223. (tsetconstnode(right).value_set^ = [])) then
  224. {$endif oldset}
  225. begin
  226. t:=cordconstnode.create(0,booltype);
  227. resulttypepass(t);
  228. result:=t;
  229. exit;
  230. end;
  231. { constant evaluation }
  232. if (left.nodetype=ordconstn) and (right.nodetype=setconstn) then
  233. begin
  234. {$ifdef oldset}
  235. t:=cordconstnode.create(byte(tordconstnode(left).value in byteset(tsetconstnode(right).value_set^)),booltype);
  236. {$else}
  237. t:=cordconstnode.create(byte(tordconstnode(left).value in Tsetconstnode(right).value_set^),booltype);
  238. {$endif}
  239. resulttypepass(t);
  240. result:=t;
  241. exit;
  242. end;
  243. end;
  244. { Warning : This is the first pass for the generic version }
  245. { the only difference is mainly the result location which }
  246. { is changed, compared to the i386 version. }
  247. { ALSO REGISTER ALLOC IS WRONG? }
  248. function tinnode.pass_1 : tnode;
  249. begin
  250. result:=nil;
  251. location.loc:=LOC_REGISTER;
  252. firstpass(right);
  253. firstpass(left);
  254. if codegenerror then
  255. exit;
  256. left_right_max;
  257. { this is not allways true due to optimization }
  258. { but if we don't set this we get problems with optimizing self code }
  259. if tsetdef(right.resulttype.def).settype<>smallset then
  260. procinfo.flags:=procinfo.flags or pi_do_call
  261. else
  262. begin
  263. { a smallset needs maybe an misc. register }
  264. if (left.nodetype<>ordconstn) and
  265. not(right.location.loc in [LOC_CREGISTER,LOC_REGISTER]) and
  266. (right.registers32<1) then
  267. inc(registers32);
  268. end;
  269. end;
  270. {*****************************************************************************
  271. TRANGENODE
  272. *****************************************************************************}
  273. constructor trangenode.create(l,r : tnode);
  274. begin
  275. inherited create(rangen,l,r);
  276. end;
  277. function trangenode.det_resulttype : tnode;
  278. var
  279. ct : tconverttype;
  280. begin
  281. result:=nil;
  282. resulttypepass(left);
  283. resulttypepass(right);
  284. set_varstate(left,true);
  285. set_varstate(right,true);
  286. if codegenerror then
  287. exit;
  288. { both types must be compatible }
  289. if not(is_equal(left.resulttype.def,right.resulttype.def)) and
  290. (isconvertable(left.resulttype.def,right.resulttype.def,ct,ordconstn,false)=0) then
  291. CGMessage(type_e_mismatch);
  292. { Check if only when its a constant set }
  293. if (left.nodetype=ordconstn) and (right.nodetype=ordconstn) then
  294. begin
  295. { upper limit must be greater or equal than lower limit }
  296. if (tordconstnode(left).value>tordconstnode(right).value) and
  297. ((tordconstnode(left).value<0) or (tordconstnode(right).value>=0)) then
  298. CGMessage(cg_e_upper_lower_than_lower);
  299. end;
  300. resulttype:=left.resulttype;
  301. end;
  302. function trangenode.pass_1 : tnode;
  303. begin
  304. result:=nil;
  305. firstpass(left);
  306. firstpass(right);
  307. if codegenerror then
  308. exit;
  309. left_right_max;
  310. location_copy(location,left.location);
  311. end;
  312. {*****************************************************************************
  313. Case Helpers
  314. *****************************************************************************}
  315. function case_count_labels(root : pcaserecord) : longint;
  316. var
  317. _l : longint;
  318. procedure count(p : pcaserecord);
  319. begin
  320. inc(_l);
  321. if assigned(p^.less) then
  322. count(p^.less);
  323. if assigned(p^.greater) then
  324. count(p^.greater);
  325. end;
  326. begin
  327. _l:=0;
  328. count(root);
  329. case_count_labels:=_l;
  330. end;
  331. {$ifdef int64funcresok}
  332. function case_get_max(root : pcaserecord) : tconstexprint;
  333. {$else int64funcresok}
  334. function case_get_max(root : pcaserecord) : longint;
  335. {$endif int64funcresok}
  336. var
  337. hp : pcaserecord;
  338. begin
  339. hp:=root;
  340. while assigned(hp^.greater) do
  341. hp:=hp^.greater;
  342. case_get_max:=hp^._high;
  343. end;
  344. {$ifdef int64funcresok}
  345. function case_get_min(root : pcaserecord) : tconstexprint;
  346. {$else int64funcresok}
  347. function case_get_min(root : pcaserecord) : longint;
  348. {$endif int64funcresok}
  349. var
  350. hp : pcaserecord;
  351. begin
  352. hp:=root;
  353. while assigned(hp^.less) do
  354. hp:=hp^.less;
  355. case_get_min:=hp^._low;
  356. end;
  357. procedure deletecaselabels(p : pcaserecord);
  358. begin
  359. if assigned(p^.greater) then
  360. deletecaselabels(p^.greater);
  361. if assigned(p^.less) then
  362. deletecaselabels(p^.less);
  363. dispose(p);
  364. end;
  365. function copycaserecord(p : pcaserecord) : pcaserecord;
  366. var
  367. n : pcaserecord;
  368. begin
  369. new(n);
  370. n^:=p^;
  371. if assigned(p^.greater) then
  372. n^.greater:=copycaserecord(p^.greater);
  373. if assigned(p^.less) then
  374. n^.less:=copycaserecord(p^.less);
  375. copycaserecord:=n;
  376. end;
  377. procedure ppuwritecaserecord(ppufile:tcompilerppufile;p : pcaserecord);
  378. var
  379. b : byte;
  380. begin
  381. ppufile.putexprint(p^._low);
  382. ppufile.putexprint(p^._high);
  383. ppufile.putasmsymbol(p^._at);
  384. ppufile.putasmsymbol(p^.statement);
  385. ppufile.putbyte(byte(p^.firstlabel));
  386. b:=0;
  387. if assigned(p^.greater) then
  388. b:=b or 1;
  389. if assigned(p^.less) then
  390. b:=b or 2;
  391. ppufile.putbyte(b);
  392. if assigned(p^.greater) then
  393. ppuwritecaserecord(ppufile,p^.greater);
  394. if assigned(p^.less) then
  395. ppuwritecaserecord(ppufile,p^.less);
  396. end;
  397. function ppuloadcaserecord(ppufile:tcompilerppufile):pcaserecord;
  398. var
  399. b : byte;
  400. p : pcaserecord;
  401. begin
  402. new(p);
  403. p^._low:=ppufile.getexprint;
  404. p^._high:=ppufile.getexprint;
  405. p^._at:=tasmlabel(ppufile.getasmsymbol);
  406. p^.statement:=tasmlabel(ppufile.getasmsymbol);
  407. p^.firstlabel:=boolean(ppufile.getbyte);
  408. b:=ppufile.getbyte;
  409. if (b and 1)=1 then
  410. p^.greater:=ppuloadcaserecord(ppufile)
  411. else
  412. p^.greater:=nil;
  413. if (b and 2)=2 then
  414. p^.less:=ppuloadcaserecord(ppufile)
  415. else
  416. p^.less:=nil;
  417. ppuloadcaserecord:=p;
  418. end;
  419. procedure ppuderefcaserecord(p : pcaserecord);
  420. begin
  421. objectlibrary.derefasmsymbol(p^._at);
  422. objectlibrary.derefasmsymbol(p^.statement);
  423. if assigned(p^.greater) then
  424. ppuderefcaserecord(p^.greater);
  425. if assigned(p^.less) then
  426. ppuderefcaserecord(p^.less);
  427. end;
  428. {*****************************************************************************
  429. TCASENODE
  430. *****************************************************************************}
  431. constructor tcasenode.create(l,r : tnode;n : pcaserecord);
  432. begin
  433. inherited create(casen,l,r);
  434. nodes:=n;
  435. elseblock:=nil;
  436. set_file_line(l);
  437. end;
  438. destructor tcasenode.destroy;
  439. begin
  440. elseblock.free;
  441. deletecaselabels(nodes);
  442. inherited destroy;
  443. end;
  444. constructor tcasenode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
  445. begin
  446. inherited ppuload(t,ppufile);
  447. elseblock:=ppuloadnode(ppufile);
  448. nodes:=ppuloadcaserecord(ppufile);
  449. end;
  450. procedure tcasenode.ppuwrite(ppufile:tcompilerppufile);
  451. begin
  452. inherited ppuwrite(ppufile);
  453. ppuwritenode(ppufile,elseblock);
  454. ppuwritecaserecord(ppufile,nodes);
  455. end;
  456. procedure tcasenode.derefimpl;
  457. begin
  458. inherited derefimpl;
  459. if assigned(elseblock) then
  460. elseblock.derefimpl;
  461. ppuderefcaserecord(nodes);
  462. end;
  463. function tcasenode.det_resulttype : tnode;
  464. begin
  465. result:=nil;
  466. resulttype:=voidtype;
  467. end;
  468. function tcasenode.pass_1 : tnode;
  469. var
  470. old_t_times : longint;
  471. hp : tbinarynode;
  472. begin
  473. result:=nil;
  474. { evalutes the case expression }
  475. rg.cleartempgen;
  476. firstpass(left);
  477. set_varstate(left,true);
  478. if codegenerror then
  479. exit;
  480. registers32:=left.registers32;
  481. registersfpu:=left.registersfpu;
  482. {$ifdef SUPPORT_MMX}
  483. registersmmx:=left.registersmmx;
  484. {$endif SUPPORT_MMX}
  485. { walk through all instructions }
  486. { estimates the repeat of each instruction }
  487. old_t_times:=rg.t_times;
  488. if not(cs_littlesize in aktglobalswitches) then
  489. begin
  490. rg.t_times:=rg.t_times div case_count_labels(nodes);
  491. if rg.t_times<1 then
  492. rg.t_times:=1;
  493. end;
  494. { first case }
  495. hp:=tbinarynode(right);
  496. while assigned(hp) do
  497. begin
  498. rg.cleartempgen;
  499. firstpass(hp.right);
  500. { searchs max registers }
  501. if hp.right.registers32>registers32 then
  502. registers32:=hp.right.registers32;
  503. if hp.right.registersfpu>registersfpu then
  504. registersfpu:=hp.right.registersfpu;
  505. {$ifdef SUPPORT_MMX}
  506. if hp.right.registersmmx>registersmmx then
  507. registersmmx:=hp.right.registersmmx;
  508. {$endif SUPPORT_MMX}
  509. hp:=tbinarynode(hp.left);
  510. end;
  511. { may be handle else tree }
  512. if assigned(elseblock) then
  513. begin
  514. rg.cleartempgen;
  515. firstpass(elseblock);
  516. if codegenerror then
  517. exit;
  518. if registers32<elseblock.registers32 then
  519. registers32:=elseblock.registers32;
  520. if registersfpu<elseblock.registersfpu then
  521. registersfpu:=elseblock.registersfpu;
  522. {$ifdef SUPPORT_MMX}
  523. if registersmmx<elseblock.registersmmx then
  524. registersmmx:=elseblock.registersmmx;
  525. {$endif SUPPORT_MMX}
  526. end;
  527. rg.t_times:=old_t_times;
  528. { there is one register required for the case expression }
  529. { for 64 bit ints we cheat: the high dword is stored in EDI }
  530. { so we don't need an extra register }
  531. if registers32<1 then registers32:=1;
  532. end;
  533. function tcasenode.getcopy : tnode;
  534. var
  535. p : tcasenode;
  536. begin
  537. p:=tcasenode(inherited getcopy);
  538. if assigned(elseblock) then
  539. p.elseblock:=elseblock.getcopy
  540. else
  541. p.elseblock:=nil;
  542. if assigned(nodes) then
  543. p.nodes:=copycaserecord(nodes)
  544. else
  545. p.nodes:=nil;
  546. getcopy:=p;
  547. end;
  548. procedure tcasenode.insertintolist(l : tnodelist);
  549. begin
  550. end;
  551. function casenodesequal(n1,n2: pcaserecord): boolean;
  552. begin
  553. casenodesequal :=
  554. (not assigned(n1) and not assigned(n2)) or
  555. (assigned(n1) and assigned(n2) and
  556. (n1^._low = n2^._low) and
  557. (n1^._high = n2^._high) and
  558. { the rest of the fields don't matter for equality (JM) }
  559. casenodesequal(n1^.less,n2^.less) and
  560. casenodesequal(n1^.greater,n2^.greater))
  561. end;
  562. function tcasenode.docompare(p: tnode): boolean;
  563. begin
  564. docompare :=
  565. inherited docompare(p) and
  566. casenodesequal(nodes,tcasenode(p).nodes) and
  567. elseblock.isequal(tcasenode(p).elseblock);
  568. end;
  569. begin
  570. csetelementnode:=tsetelementnode;
  571. cinnode:=tinnode;
  572. crangenode:=trangenode;
  573. ccasenode:=tcasenode;
  574. end.
  575. {
  576. $Log$
  577. Revision 1.32 2002-08-19 19:36:44 peter
  578. * More fixes for cross unit inlining, all tnodes are now implemented
  579. * Moved pocall_internconst to po_internconst because it is not a
  580. calling type at all and it conflicted when inlining of these small
  581. functions was requested
  582. Revision 1.31 2002/08/17 09:23:38 florian
  583. * first part of procinfo rewrite
  584. Revision 1.30 2002/07/23 13:19:40 jonas
  585. * fixed evaluation of expressions with empty sets that are calculated
  586. at compile time
  587. Revision 1.29 2002/07/23 12:34:30 daniel
  588. * Readded old set code. To use it define 'oldset'. Activated by default
  589. for ppc.
  590. Revision 1.28 2002/07/22 11:48:04 daniel
  591. * Sets are now internally sets.
  592. Revision 1.27 2002/07/20 11:57:55 florian
  593. * types.pas renamed to defbase.pas because D6 contains a types
  594. unit so this would conflicts if D6 programms are compiled
  595. + Willamette/SSE2 instructions to assembler added
  596. Revision 1.26 2002/07/06 20:19:25 carl
  597. + generic set handling
  598. Revision 1.25 2002/07/01 18:46:24 peter
  599. * internal linker
  600. * reorganized aasm layer
  601. Revision 1.24 2002/05/18 13:34:10 peter
  602. * readded missing revisions
  603. Revision 1.23 2002/05/16 19:46:39 carl
  604. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  605. + try to fix temp allocation (still in ifdef)
  606. + generic constructor calls
  607. + start of tassembler / tmodulebase class cleanup
  608. Revision 1.21 2002/05/12 16:53:08 peter
  609. * moved entry and exitcode to ncgutil and cgobj
  610. * foreach gets extra argument for passing local data to the
  611. iterator function
  612. * -CR checks also class typecasts at runtime by changing them
  613. into as
  614. * fixed compiler to cycle with the -CR option
  615. * fixed stabs with elf writer, finally the global variables can
  616. be watched
  617. * removed a lot of routines from cga unit and replaced them by
  618. calls to cgobj
  619. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  620. u32bit then the other is typecasted also to u32bit without giving
  621. a rangecheck warning/error.
  622. * fixed pascal calling method with reversing also the high tree in
  623. the parast, detected by tcalcst3 test
  624. Revision 1.20 2002/04/07 13:27:50 carl
  625. + change unit use
  626. Revision 1.19 2002/04/02 17:11:29 peter
  627. * tlocation,treference update
  628. * LOC_CONSTANT added for better constant handling
  629. * secondadd splitted in multiple routines
  630. * location_force_reg added for loading a location to a register
  631. of a specified size
  632. * secondassignment parses now first the right and then the left node
  633. (this is compatible with Kylix). This saves a lot of push/pop especially
  634. with string operations
  635. * adapted some routines to use the new cg methods
  636. Revision 1.18 2002/03/31 20:26:35 jonas
  637. + a_loadfpu_* and a_loadmm_* methods in tcg
  638. * register allocation is now handled by a class and is mostly processor
  639. independent (+rgobj.pas and i386/rgcpu.pas)
  640. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  641. * some small improvements and fixes to the optimizer
  642. * some register allocation fixes
  643. * some fpuvaroffset fixes in the unary minus node
  644. * push/popusedregisters is now called rg.save/restoreusedregisters and
  645. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  646. also better optimizable)
  647. * fixed and optimized register saving/restoring for new/dispose nodes
  648. * LOC_FPU locations now also require their "register" field to be set to
  649. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  650. - list field removed of the tnode class because it's not used currently
  651. and can cause hard-to-find bugs
  652. }