ncgbas.pas 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  1. {
  2. $Id$
  3. Copyright (c) 2000-2002 by Florian Klaempfl
  4. This unit implements some basic 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 ncgbas;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. cpubase,
  23. node,nbas;
  24. type
  25. tcgnothingnode = class(tnothingnode)
  26. procedure pass_2;override;
  27. end;
  28. tcgasmnode = class(tasmnode)
  29. procedure pass_2;override;
  30. end;
  31. tcgstatementnode = class(tstatementnode)
  32. procedure pass_2;override;
  33. end;
  34. tcgblocknode = class(tblocknode)
  35. procedure pass_2;override;
  36. end;
  37. tcgtempcreatenode = class(ttempcreatenode)
  38. procedure pass_2;override;
  39. end;
  40. tcgtemprefnode = class(ttemprefnode)
  41. procedure pass_2;override;
  42. { Changes the location of this temp to ref. Useful when assigning }
  43. { another temp to this one. The current location will be freed. }
  44. { Can only be called in pass 2 (since earlier, the temp location }
  45. { isn't known yet) }
  46. procedure changelocation(const ref: treference);
  47. end;
  48. tcgtempdeletenode = class(ttempdeletenode)
  49. procedure pass_2;override;
  50. end;
  51. implementation
  52. uses
  53. globtype,systems,
  54. cutils,verbose,cpuinfo,
  55. aasmbase,aasmtai,aasmcpu,symsym,
  56. defutil,
  57. nflw,pass_2,
  58. cgbase,
  59. cgutils,cgobj,
  60. procinfo,
  61. tgobj
  62. ;
  63. {*****************************************************************************
  64. TNOTHING
  65. *****************************************************************************}
  66. procedure tcgnothingnode.pass_2;
  67. begin
  68. location_reset(location,LOC_VOID,OS_NO);
  69. { avoid an abstract rte }
  70. end;
  71. {*****************************************************************************
  72. TSTATEMENTNODE
  73. *****************************************************************************}
  74. procedure tcgstatementnode.pass_2;
  75. var
  76. hp : tstatementnode;
  77. begin
  78. location_reset(location,LOC_VOID,OS_NO);
  79. hp:=self;
  80. while assigned(hp) do
  81. begin
  82. if assigned(hp.left) then
  83. begin
  84. secondpass(hp.left);
  85. { Compiler inserted blocks can return values }
  86. location_copy(hp.location,hp.left.location);
  87. end;
  88. hp:=tstatementnode(hp.right);
  89. end;
  90. end;
  91. {*****************************************************************************
  92. TASMNODE
  93. *****************************************************************************}
  94. procedure tcgasmnode.pass_2;
  95. procedure ReLabel(var p:tasmsymbol);
  96. begin
  97. { Only relabel local tasmlabels }
  98. if (p.defbind = AB_LOCAL) and
  99. (p is tasmlabel) then
  100. begin
  101. if not assigned(p.altsymbol) then
  102. objectlibrary.GenerateAltSymbol(p);
  103. p:=p.altsymbol;
  104. p.increfs;
  105. end;
  106. end;
  107. procedure ResolveRef(var op:toper);
  108. var
  109. sym : tvarsym;
  110. {$ifdef x86}
  111. scale : byte;
  112. {$endif x86}
  113. getoffset : boolean;
  114. indexreg : tregister;
  115. sofs : longint;
  116. begin
  117. if (op.typ=top_local) then
  118. begin
  119. sofs:=op.localoper^.localsymofs;
  120. indexreg:=op.localoper^.localindexreg;
  121. {$ifdef x86}
  122. scale:=op.localoper^.localscale;
  123. {$endif x86}
  124. getoffset:=op.localoper^.localgetoffset;
  125. sym:=tvarsym(pointer(op.localoper^.localsym));
  126. dispose(op.localoper);
  127. case sym.localloc.loc of
  128. LOC_REFERENCE :
  129. begin
  130. if getoffset then
  131. begin
  132. if indexreg=NR_NO then
  133. begin
  134. op.typ:=top_const;
  135. op.val:=aword(sym.localloc.reference.offset+sofs);
  136. end
  137. else
  138. begin
  139. op.typ:=top_ref;
  140. new(op.ref);
  141. reference_reset_base(op.ref^,indexreg,
  142. sym.localloc.reference.offset+sofs);
  143. end;
  144. end
  145. else
  146. begin
  147. op.typ:=top_ref;
  148. new(op.ref);
  149. reference_reset_base(op.ref^,sym.localloc.reference.index,
  150. sym.localloc.reference.offset+sofs);
  151. op.ref^.index:=indexreg;
  152. {$ifdef x86}
  153. op.ref^.scalefactor:=scale;
  154. {$endif x86}
  155. end;
  156. end;
  157. LOC_REGISTER :
  158. begin
  159. if getoffset then
  160. Message(asmr_e_invalid_reference_syntax);
  161. { Subscribed access }
  162. if sofs<>0 then
  163. begin
  164. op.typ:=top_ref;
  165. new(op.ref);
  166. reference_reset_base(op.ref^,sym.localloc.register,sofs);
  167. end
  168. else
  169. begin
  170. op.typ:=top_reg;
  171. op.reg:=sym.localloc.register;
  172. end;
  173. end;
  174. end;
  175. end;
  176. end;
  177. var
  178. hp,hp2 : tai;
  179. i : longint;
  180. skipnode : boolean;
  181. begin
  182. location_reset(location,LOC_VOID,OS_NO);
  183. if (nf_get_asm_position in flags) then
  184. begin
  185. { Add a marker, to be sure the list is not empty }
  186. exprasmlist.concat(tai_marker.create(marker_position));
  187. currenttai:=tai(exprasmlist.last);
  188. exit;
  189. end;
  190. { Allocate registers used in the assembler block }
  191. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,used_regs_int);
  192. if (current_procinfo.procdef.proccalloption=pocall_inline) then
  193. begin
  194. objectlibrary.CreateUsedAsmSymbolList;
  195. hp:=tai(p_asm.first);
  196. while assigned(hp) do
  197. begin
  198. hp2:=tai(hp.getcopy);
  199. skipnode:=false;
  200. case hp2.typ of
  201. ait_label :
  202. ReLabel(tasmsymbol(tai_label(hp2).l));
  203. ait_indirect_symbol,
  204. ait_const_rva,
  205. ait_const_symbol :
  206. ReLabel(tai_const_symbol(hp2).sym);
  207. ait_instruction :
  208. begin
  209. { remove cached insentry, because the new code can
  210. require an other less optimized instruction }
  211. {$ifdef i386}
  212. {$ifndef NOAG386BIN}
  213. taicpu(hp2).ResetPass1;
  214. {$endif}
  215. {$endif}
  216. { fixup the references }
  217. for i:=1 to taicpu(hp2).ops do
  218. begin
  219. ResolveRef(taicpu(hp2).oper[i-1]^);
  220. with taicpu(hp2).oper[i-1]^ do
  221. begin
  222. case typ of
  223. top_ref :
  224. begin
  225. if assigned(ref^.symbol) then
  226. ReLabel(ref^.symbol);
  227. if assigned(ref^.relsymbol) then
  228. ReLabel(ref^.relsymbol);
  229. end;
  230. end;
  231. end;
  232. end;
  233. end;
  234. ait_marker :
  235. begin
  236. { it's not an assembler block anymore }
  237. if (tai_marker(hp2).kind in [AsmBlockStart, AsmBlockEnd]) then
  238. skipnode:=true;
  239. end;
  240. end;
  241. if not skipnode then
  242. exprasmList.concat(hp2)
  243. else
  244. hp2.free;
  245. hp:=tai(hp.next);
  246. end;
  247. { restore used symbols }
  248. objectlibrary.UsedAsmSymbolListResetAltSym;
  249. objectlibrary.DestroyUsedAsmSymbolList;
  250. end
  251. else
  252. begin
  253. hp:=tai(p_asm.first);
  254. while assigned(hp) do
  255. begin
  256. case hp.typ of
  257. ait_instruction :
  258. begin
  259. { remove cached insentry, because the new code can
  260. require an other less optimized instruction }
  261. {$ifdef i386}
  262. {$ifndef NOAG386BIN}
  263. taicpu(hp).ResetPass1;
  264. {$endif}
  265. {$endif}
  266. { fixup the references }
  267. for i:=1 to taicpu(hp).ops do
  268. ResolveRef(taicpu(hp).oper[i-1]^);
  269. end;
  270. end;
  271. hp:=tai(hp.next);
  272. end;
  273. { insert the list }
  274. exprasmList.concatlist(p_asm);
  275. end;
  276. { Release register used in the assembler block }
  277. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,used_regs_int);
  278. end;
  279. {*****************************************************************************
  280. TBLOCKNODE
  281. *****************************************************************************}
  282. procedure tcgblocknode.pass_2;
  283. var
  284. hp : tstatementnode;
  285. begin
  286. location_reset(location,LOC_VOID,OS_NO);
  287. { do second pass on left node }
  288. if assigned(left) then
  289. begin
  290. hp:=tstatementnode(left);
  291. while assigned(hp) do
  292. begin
  293. if assigned(hp.left) then
  294. begin
  295. secondpass(hp.left);
  296. location_copy(hp.location,hp.left.location);
  297. end;
  298. location_copy(location,hp.location);
  299. hp:=tstatementnode(hp.right);
  300. end;
  301. end;
  302. end;
  303. {*****************************************************************************
  304. TTEMPCREATENODE
  305. *****************************************************************************}
  306. procedure tcgtempcreatenode.pass_2;
  307. var
  308. cgsize: tcgsize;
  309. begin
  310. location_reset(location,LOC_VOID,OS_NO);
  311. { if we're secondpassing the same tcgtempcreatenode twice, we have a bug }
  312. if tempinfo^.valid then
  313. internalerror(200108222);
  314. { get a (persistent) temp }
  315. if tempinfo^.restype.def.needs_inittable then
  316. begin
  317. tg.GetTempTyped(exprasmlist,tempinfo^.restype.def,tempinfo^.temptype,tempinfo^.loc.ref);
  318. tempinfo^.loc.loc := LOC_REFERENCE;
  319. end
  320. else if tempinfo^.may_be_in_reg then
  321. begin
  322. cgsize := def_cgsize(tempinfo^.restype.def);
  323. if (TCGSize2Size[cgsize]>TCGSize2Size[OS_INT]) then
  324. internalerror(2004020202);
  325. tempinfo^.loc.reg := cg.getintregister(exprasmlist,cgsize);
  326. if (tempinfo^.temptype = tt_persistent) then
  327. begin
  328. { !!tell rgobj this register is now a regvar, so it can't be freed!! }
  329. tempinfo^.loc.loc := LOC_CREGISTER
  330. end
  331. else
  332. tempinfo^.loc.loc := LOC_REGISTER;
  333. end
  334. else
  335. begin
  336. tg.GetTemp(exprasmlist,size,tempinfo^.temptype,tempinfo^.loc.ref);
  337. tempinfo^.loc.loc := LOC_REFERENCE;
  338. end;
  339. tempinfo^.valid := true;
  340. end;
  341. {*****************************************************************************
  342. TTEMPREFNODE
  343. *****************************************************************************}
  344. procedure tcgtemprefnode.pass_2;
  345. begin
  346. { check if the temp is valid }
  347. if not tempinfo^.valid then
  348. internalerror(200108231);
  349. case tempinfo^.loc.loc of
  350. LOC_REFERENCE:
  351. begin
  352. { set the temp's location }
  353. location_reset(location,LOC_REFERENCE,def_cgsize(tempinfo^.restype.def));
  354. location.reference := tempinfo^.loc.ref;
  355. inc(location.reference.offset,offset);
  356. end;
  357. LOC_REGISTER,
  358. LOC_CREGISTER:
  359. begin
  360. if offset <> 0 then
  361. internalerror(2004020205);
  362. { LOC_CREGISTER, not LOC_REGISTER, otherwise we can't assign anything to it }
  363. location_reset(location,tempinfo^.loc.loc,def_cgsize(tempinfo^.restype.def));
  364. location.register := tempinfo^.loc.reg;
  365. end;
  366. else
  367. internalerror(2004020204);
  368. end;
  369. end;
  370. procedure tcgtemprefnode.changelocation(const ref: treference);
  371. begin
  372. { check if the temp is valid }
  373. if not tempinfo^.valid then
  374. internalerror(200306081);
  375. if (tempinfo^.loc.loc = LOC_REGISTER) then
  376. internalerror(2004020203);
  377. if (tempinfo^.temptype = tt_persistent) then
  378. tg.ChangeTempType(exprasmlist,tempinfo^.loc.ref,tt_normal);
  379. tg.ungettemp(exprasmlist,tempinfo^.loc.ref);
  380. tempinfo^.loc.ref := ref;
  381. tg.ChangeTempType(exprasmlist,tempinfo^.loc.ref,tempinfo^.temptype);
  382. { adapt location }
  383. location.reference := ref;
  384. inc(location.reference.offset,offset);
  385. end;
  386. {*****************************************************************************
  387. TTEMPDELETENODE
  388. *****************************************************************************}
  389. procedure tcgtempdeletenode.pass_2;
  390. begin
  391. location_reset(location,LOC_VOID,OS_NO);
  392. case tempinfo^.loc.loc of
  393. LOC_REFERENCE:
  394. begin
  395. if release_to_normal then
  396. tg.ChangeTempType(exprasmlist,tempinfo^.loc.ref,tt_normal)
  397. else
  398. tg.UnGetTemp(exprasmlist,tempinfo^.loc.ref);
  399. end;
  400. LOC_CREGISTER,
  401. LOC_REGISTER:
  402. begin
  403. { make sure the register allocator doesn't reuse the }
  404. { register e.g. in the middle of a loop }
  405. cg.a_load_reg_reg(exprasmlist,OS_INT,OS_INT,tempinfo^.loc.reg,
  406. tempinfo^.loc.reg);
  407. if release_to_normal then
  408. tempinfo^.loc.loc := LOC_REGISTER
  409. else
  410. { !!tell rgobj this register is no longer a regvar!! }
  411. cg.ungetregister(exprasmlist,tempinfo^.loc.reg);
  412. end;
  413. end;
  414. end;
  415. begin
  416. cnothingnode:=tcgnothingnode;
  417. casmnode:=tcgasmnode;
  418. cstatementnode:=tcgstatementnode;
  419. cblocknode:=tcgblocknode;
  420. ctempcreatenode:=tcgtempcreatenode;
  421. ctemprefnode:=tcgtemprefnode;
  422. ctempdeletenode:=tcgtempdeletenode;
  423. end.
  424. {
  425. $Log$
  426. Revision 1.61 2004-05-23 15:06:20 peter
  427. * implicit_finally flag must be set in pass1
  428. * add check whether the implicit frame is generated when expected
  429. Revision 1.60 2004/03/15 08:44:51 michael
  430. + Fix from peter: fixes crash when inlining assembler code referencing local vars
  431. Revision 1.59 2004/03/10 20:41:17 peter
  432. * maybe_in_reg moved to tempinfo
  433. * fixed expectloc for maybe_in_reg
  434. Revision 1.58 2004/03/02 17:32:12 florian
  435. * make cycle fixed
  436. + pic support for darwin
  437. + support of importing vars from shared libs on darwin implemented
  438. Revision 1.57 2004/02/27 19:30:23 jonas
  439. * fixed relsymbol copy/paste bug
  440. Revision 1.56 2004/02/27 10:21:05 florian
  441. * top_symbol killed
  442. + refaddr to treference added
  443. + refsymbol to treference added
  444. * top_local stuff moved to an extra record to save memory
  445. + aint introduced
  446. * tppufile.get/putint64/aint implemented
  447. Revision 1.55 2004/02/04 18:45:29 jonas
  448. + some more usage of register temps
  449. Revision 1.54 2004/02/03 19:48:06 jonas
  450. * fixed and re-enabled temps in registers
  451. Revision 1.53 2004/02/03 17:55:50 jonas
  452. * cleanup
  453. Revision 1.52 2004/02/03 16:46:51 jonas
  454. + support to store ttempcreate/ref/deletenodes in registers
  455. * put temps for withnodes and some newnodes in registers
  456. Note: this currently only works because calling ungetregister()
  457. multiple times for the same register doesn't matter. We need again
  458. a way to specify that a register is currently a regvar and as such
  459. should not be freed when you call ungetregister() on it.
  460. Revision 1.51 2003/11/07 15:58:32 florian
  461. * Florian's culmutative nr. 1; contains:
  462. - invalid calling conventions for a certain cpu are rejected
  463. - arm softfloat calling conventions
  464. - -Sp for cpu dependend code generation
  465. - several arm fixes
  466. - remaining code for value open array paras on heap
  467. Revision 1.50 2003/11/04 15:35:13 peter
  468. * fix for referencecounted temps
  469. Revision 1.49 2003/11/02 13:30:05 jonas
  470. * fixed ppc compilation
  471. Revision 1.48 2003/10/30 19:59:00 peter
  472. * support scalefactor for opr_local
  473. * support reference with opr_local set, fixes tw2631
  474. Revision 1.47 2003/10/29 15:40:20 peter
  475. * support indexing and offset retrieval for locals
  476. Revision 1.46 2003/10/24 17:39:41 peter
  477. * asmnode.get_position now inserts a marker
  478. Revision 1.45 2003/10/21 15:15:36 peter
  479. * taicpu_abstract.oper[] changed to pointers
  480. Revision 1.44 2003/10/10 17:48:13 peter
  481. * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
  482. * tregisteralloctor renamed to trgobj
  483. * removed rgobj from a lot of units
  484. * moved location_* and reference_* to cgobj
  485. * first things for mmx register allocation
  486. Revision 1.43 2003/10/09 21:31:37 daniel
  487. * Register allocator splitted, ans abstract now
  488. Revision 1.42 2003/10/07 18:18:16 peter
  489. * fix register calling for assembler procedures
  490. * fix result loading for assembler procedures
  491. Revision 1.41 2003/10/01 20:34:48 peter
  492. * procinfo unit contains tprocinfo
  493. * cginfo renamed to cgbase
  494. * moved cgmessage to verbose
  495. * fixed ppc and sparc compiles
  496. Revision 1.40 2003/09/23 17:56:05 peter
  497. * locals and paras are allocated in the code generation
  498. * tvarsym.localloc contains the location of para/local when
  499. generating code for the current procedure
  500. Revision 1.39 2003/09/07 22:09:35 peter
  501. * preparations for different default calling conventions
  502. * various RA fixes
  503. Revision 1.38 2003/09/03 15:55:00 peter
  504. * NEWRA branch merged
  505. Revision 1.37.2.1 2003/08/27 20:23:55 peter
  506. * remove old ra code
  507. Revision 1.37 2003/06/13 21:19:30 peter
  508. * current_procdef removed, use current_procinfo.procdef instead
  509. Revision 1.36 2003/06/09 18:26:46 peter
  510. * remove temptype, use tempinfo.temptype instead
  511. Revision 1.35 2003/06/09 12:20:47 peter
  512. * getposition added to retrieve the the current tai item
  513. Revision 1.34 2003/05/17 13:30:08 jonas
  514. * changed tt_persistant to tt_persistent :)
  515. * tempcreatenode now doesn't accept a boolean anymore for persistent
  516. temps, but a ttemptype, so you can also create ansistring temps etc
  517. Revision 1.33 2003/04/27 11:21:33 peter
  518. * aktprocdef renamed to current_procinfo.procdef
  519. * procinfo renamed to current_procinfo
  520. * procinfo will now be stored in current_module so it can be
  521. cleaned up properly
  522. * gen_main_procsym changed to create_main_proc and release_main_proc
  523. to also generate a tprocinfo structure
  524. * fixed unit implicit initfinal
  525. Revision 1.32 2002/04/25 20:15:39 florian
  526. * block nodes within expressions shouldn't release the used registers,
  527. fixed using a flag till the new rg is ready
  528. Revision 1.31 2003/04/22 23:50:22 peter
  529. * firstpass uses expectloc
  530. * checks if there are differences between the expectloc and
  531. location.loc from secondpass in EXTDEBUG
  532. Revision 1.30 2003/04/17 07:50:24 daniel
  533. * Some work on interference graph construction
  534. Revision 1.29 2003/03/28 19:16:56 peter
  535. * generic constructor working for i386
  536. * remove fixed self register
  537. * esi added as address register for i386
  538. Revision 1.28 2002/11/27 15:33:19 peter
  539. * fixed relabeling to relabel only tasmlabel (formerly proclocal)
  540. Revision 1.27 2002/11/27 02:37:13 peter
  541. * case statement inlining added
  542. * fixed inlining of write()
  543. * switched statementnode left and right parts so the statements are
  544. processed in the correct order when getcopy is used. This is
  545. required for tempnodes
  546. Revision 1.26 2002/11/17 16:31:56 carl
  547. * memory optimization (3-4%) : cleanup of tai fields,
  548. cleanup of tdef and tsym fields.
  549. * make it work for m68k
  550. Revision 1.25 2002/11/15 16:29:30 peter
  551. * made tasmsymbol.refs private (merged)
  552. Revision 1.24 2002/11/15 01:58:51 peter
  553. * merged changes from 1.0.7 up to 04-11
  554. - -V option for generating bug report tracing
  555. - more tracing for option parsing
  556. - errors for cdecl and high()
  557. - win32 import stabs
  558. - win32 records<=8 are returned in eax:edx (turned off by default)
  559. - heaptrc update
  560. - more info for temp management in .s file with EXTDEBUG
  561. Revision 1.23 2002/08/23 16:14:48 peter
  562. * tempgen cleanup
  563. * tt_noreuse temp type added that will be used in genentrycode
  564. Revision 1.22 2002/08/11 14:32:26 peter
  565. * renamed current_library to objectlibrary
  566. Revision 1.21 2002/08/11 13:24:11 peter
  567. * saving of asmsymbols in ppu supported
  568. * asmsymbollist global is removed and moved into a new class
  569. tasmlibrarydata that will hold the info of a .a file which
  570. corresponds with a single module. Added librarydata to tmodule
  571. to keep the library info stored for the module. In the future the
  572. objectfiles will also be stored to the tasmlibrarydata class
  573. * all getlabel/newasmsymbol and friends are moved to the new class
  574. Revision 1.20 2002/07/01 18:46:22 peter
  575. * internal linker
  576. * reorganized aasm layer
  577. Revision 1.19 2002/05/18 13:34:09 peter
  578. * readded missing revisions
  579. Revision 1.18 2002/05/16 19:46:37 carl
  580. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  581. + try to fix temp allocation (still in ifdef)
  582. + generic constructor calls
  583. + start of tassembler / tmodulebase class cleanup
  584. Revision 1.16 2002/05/13 19:54:37 peter
  585. * removed n386ld and n386util units
  586. * maybe_save/maybe_restore added instead of the old maybe_push
  587. Revision 1.15 2002/05/12 16:53:07 peter
  588. * moved entry and exitcode to ncgutil and cgobj
  589. * foreach gets extra argument for passing local data to the
  590. iterator function
  591. * -CR checks also class typecasts at runtime by changing them
  592. into as
  593. * fixed compiler to cycle with the -CR option
  594. * fixed stabs with elf writer, finally the global variables can
  595. be watched
  596. * removed a lot of routines from cga unit and replaced them by
  597. calls to cgobj
  598. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  599. u32bit then the other is typecasted also to u32bit without giving
  600. a rangecheck warning/error.
  601. * fixed pascal calling method with reversing also the high tree in
  602. the parast, detected by tcalcst3 test
  603. Revision 1.14 2002/04/23 19:16:34 peter
  604. * add pinline unit that inserts compiler supported functions using
  605. one or more statements
  606. * moved finalize and setlength from ninl to pinline
  607. Revision 1.13 2002/04/21 19:02:03 peter
  608. * removed newn and disposen nodes, the code is now directly
  609. inlined from pexpr
  610. * -an option that will write the secondpass nodes to the .s file, this
  611. requires EXTDEBUG define to actually write the info
  612. * fixed various internal errors and crashes due recent code changes
  613. Revision 1.12 2002/04/04 19:05:57 peter
  614. * removed unused units
  615. * use tlocation.size in cg.a_*loc*() routines
  616. Revision 1.11 2002/03/31 20:26:34 jonas
  617. + a_loadfpu_* and a_loadmm_* methods in tcg
  618. * register allocation is now handled by a class and is mostly processor
  619. independent (+rgobj.pas and i386/rgcpu.pas)
  620. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  621. * some small improvements and fixes to the optimizer
  622. * some register allocation fixes
  623. * some fpuvaroffset fixes in the unary minus node
  624. * push/popusedregisters is now called rg.save/restoreusedregisters and
  625. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  626. also better optimizable)
  627. * fixed and optimized register saving/restoring for new/dispose nodes
  628. * LOC_FPU locations now also require their "register" field to be set to
  629. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  630. - list field removed of the tnode class because it's not used currently
  631. and can cause hard-to-find bugs
  632. }