cgbase.pas 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. This unit exports some help routines for the code generation
  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. {# Some helpers for the code generator.
  19. }
  20. unit cgbase;
  21. {$i fpcdefs.inc}
  22. interface
  23. uses
  24. { common }
  25. cclasses,
  26. { global }
  27. globtype,globals,verbose,
  28. { symtable }
  29. symconst,symtype,symdef,symsym,
  30. { aasm }
  31. cpubase,cpuinfo,cginfo,aasmbase,aasmtai
  32. ;
  33. type
  34. tprocinfoflag=(
  35. {# procedure uses asm }
  36. pi_uses_asm,
  37. {# procedure does a call }
  38. pi_do_call,
  39. {# procedure has a try statement = no register optimization }
  40. pi_uses_exceptions,
  41. {# procedure is declared as @var(assembler), don't optimize}
  42. pi_is_assembler,
  43. {# procedure contains data which needs to be finalized }
  44. pi_needs_implicit_finally
  45. );
  46. tprocinfoflags=set of tprocinfoflag;
  47. type
  48. {# This object gives information on the current routine being
  49. compiled.
  50. }
  51. tprocinfo = class(tlinkedlistitem)
  52. { pointer to parent in nested procedures }
  53. parent : tprocinfo;
  54. {# the definition of the routine itself }
  55. procdef : tprocdef;
  56. { file location of begin of procedure }
  57. entrypos : tfileposinfo;
  58. { file location of end of procedure }
  59. exitpos : tfileposinfo;
  60. { local switches at begin of procedure }
  61. entryswitches : tlocalswitches;
  62. { local switches at end of procedure }
  63. exitswitches : tlocalswitches;
  64. {# offset from frame pointer to get parent frame pointer reference
  65. (used in nested routines only)
  66. On the PowerPC, this is used to store the offset where the
  67. frame pointer from the outer procedure is stored.
  68. }
  69. framepointer_offset : longint;
  70. {# firsttemp position }
  71. firsttemp_offset : longint;
  72. {# some collected informations about the procedure
  73. see pi_xxxx constants above
  74. }
  75. flags : tprocinfoflags;
  76. {# register used as frame pointer }
  77. framepointer : tregister;
  78. {# Holds the reference used to store the original stackpointer
  79. after all registers are saved
  80. }
  81. save_stackptr_ref :treference;
  82. {# Holds the reference used to store alll saved registers.
  83. This is used on systems which do not have direct stack
  84. operations (such as the PowerPC), it is unused on other
  85. systems
  86. }
  87. save_regs_ref : treference;
  88. { label to leave the sub routine }
  89. aktexitlabel : tasmlabel;
  90. {# The code for the routine itself, excluding entry and
  91. exit code. This is a linked list of tai classes.
  92. }
  93. aktproccode : taasmoutput;
  94. { Data (like jump tables) that belongs to this routine }
  95. aktlocaldata : taasmoutput;
  96. constructor create(aparent:tprocinfo);virtual;
  97. destructor destroy;override;
  98. procedure allocate_interrupt_parameter;virtual;
  99. procedure allocate_implicit_parameter;virtual;
  100. { Allocate framepointer so it can not be used by the
  101. register allocator }
  102. procedure allocate_framepointer;virtual;
  103. { Does the necessary stuff before a procedure body is compiled }
  104. procedure handle_body_start;virtual;
  105. { This is called by parser, after the header of a subroutine is parsed.
  106. If the local symtable offset depends on the para symtable size, the
  107. necessary stuff must be done here.
  108. }
  109. procedure after_header;virtual;
  110. { This procedure is called after the pass 1 of the subroutine body is done.
  111. Here the address fix ups to generate code for the body must be done.
  112. }
  113. procedure after_pass1;virtual;
  114. end;
  115. pregvarinfo = ^tregvarinfo;
  116. tregvarinfo = record
  117. regvars : array[1..maxvarregs] of tvarsym;
  118. regvars_para : array[1..maxvarregs] of boolean;
  119. regvars_refs : array[1..maxvarregs] of longint;
  120. fpuregvars : array[1..maxfpuvarregs] of tvarsym;
  121. fpuregvars_para : array[1..maxfpuvarregs] of boolean;
  122. fpuregvars_refs : array[1..maxfpuvarregs] of longint;
  123. end;
  124. tcprocinfo = class of tprocinfo;
  125. var
  126. cprocinfo : tcprocinfo;
  127. {# information about the current sub routine being parsed (@var(pprocinfo))}
  128. current_procinfo : tprocinfo;
  129. { labels for BREAK and CONTINUE }
  130. aktbreaklabel,aktcontinuelabel : tasmlabel;
  131. { label when the result is true or false }
  132. truelabel,falselabel : tasmlabel;
  133. {# true, if there was an error while code generation occurs }
  134. codegenerror : boolean;
  135. { save the size of pushed parameter, needed for aligning }
  136. pushedparasize : longint;
  137. { message calls with codegenerror support }
  138. procedure cgmessage(t : longint);
  139. procedure cgmessage1(t : longint;const s : string);
  140. procedure cgmessage2(t : longint;const s1,s2 : string);
  141. procedure cgmessage3(t : longint;const s1,s2,s3 : string);
  142. procedure CGMessagePos(const pos:tfileposinfo;t:longint);
  143. procedure CGMessagePos1(const pos:tfileposinfo;t:longint;const s1:string);
  144. procedure CGMessagePos2(const pos:tfileposinfo;t:longint;const s1,s2:string);
  145. procedure CGMessagePos3(const pos:tfileposinfo;t:longint;const s1,s2,s3:string);
  146. { initialize respectively terminates the code generator }
  147. { for a new module or procedure }
  148. procedure codegen_newmodule;
  149. procedure codegen_donemodule;
  150. {# From a definition return the abstract code generator size enum. It is
  151. to note that the value returned can be @var(OS_NO) }
  152. function def_cgsize(def: tdef): tcgsize;
  153. {# From a constant numeric value, return the abstract code generator
  154. size.
  155. }
  156. function int_cgsize(const a: aword): tcgsize;
  157. {# return the inverse condition of opcmp }
  158. function inverse_opcmp(opcmp: topcmp): topcmp;
  159. {# return whether op is commutative }
  160. function commutativeop(op: topcg): boolean;
  161. implementation
  162. uses
  163. systems,
  164. cresstr,
  165. tgobj,rgobj,
  166. defutil,
  167. fmodule
  168. ,symbase,paramgr
  169. ;
  170. {*****************************************************************************
  171. override the message calls to set codegenerror
  172. *****************************************************************************}
  173. procedure cgmessage(t : longint);
  174. var
  175. olderrorcount : longint;
  176. begin
  177. if not(codegenerror) then
  178. begin
  179. olderrorcount:=Errorcount;
  180. verbose.Message(t);
  181. codegenerror:=olderrorcount<>Errorcount;
  182. end;
  183. end;
  184. procedure cgmessage1(t : longint;const s : string);
  185. var
  186. olderrorcount : longint;
  187. begin
  188. if not(codegenerror) then
  189. begin
  190. olderrorcount:=Errorcount;
  191. verbose.Message1(t,s);
  192. codegenerror:=olderrorcount<>Errorcount;
  193. end;
  194. end;
  195. procedure cgmessage2(t : longint;const s1,s2 : string);
  196. var
  197. olderrorcount : longint;
  198. begin
  199. if not(codegenerror) then
  200. begin
  201. olderrorcount:=Errorcount;
  202. verbose.Message2(t,s1,s2);
  203. codegenerror:=olderrorcount<>Errorcount;
  204. end;
  205. end;
  206. procedure cgmessage3(t : longint;const s1,s2,s3 : string);
  207. var
  208. olderrorcount : longint;
  209. begin
  210. if not(codegenerror) then
  211. begin
  212. olderrorcount:=Errorcount;
  213. verbose.Message3(t,s1,s2,s3);
  214. codegenerror:=olderrorcount<>Errorcount;
  215. end;
  216. end;
  217. procedure cgmessagepos(const pos:tfileposinfo;t : longint);
  218. var
  219. olderrorcount : longint;
  220. begin
  221. if not(codegenerror) then
  222. begin
  223. olderrorcount:=Errorcount;
  224. verbose.MessagePos(pos,t);
  225. codegenerror:=olderrorcount<>Errorcount;
  226. end;
  227. end;
  228. procedure cgmessagepos1(const pos:tfileposinfo;t : longint;const s1 : string);
  229. var
  230. olderrorcount : longint;
  231. begin
  232. if not(codegenerror) then
  233. begin
  234. olderrorcount:=Errorcount;
  235. verbose.MessagePos1(pos,t,s1);
  236. codegenerror:=olderrorcount<>Errorcount;
  237. end;
  238. end;
  239. procedure cgmessagepos2(const pos:tfileposinfo;t : longint;const s1,s2 : string);
  240. var
  241. olderrorcount : longint;
  242. begin
  243. if not(codegenerror) then
  244. begin
  245. olderrorcount:=Errorcount;
  246. verbose.MessagePos2(pos,t,s1,s2);
  247. codegenerror:=olderrorcount<>Errorcount;
  248. end;
  249. end;
  250. procedure cgmessagepos3(const pos:tfileposinfo;t : longint;const s1,s2,s3 : string);
  251. var
  252. olderrorcount : longint;
  253. begin
  254. if not(codegenerror) then
  255. begin
  256. olderrorcount:=Errorcount;
  257. verbose.MessagePos3(pos,t,s1,s2,s3);
  258. codegenerror:=olderrorcount<>Errorcount;
  259. end;
  260. end;
  261. {****************************************************************************
  262. TProcInfo
  263. ****************************************************************************}
  264. constructor tprocinfo.create(aparent:tprocinfo);
  265. begin
  266. parent:=aparent;
  267. procdef:=nil;
  268. framepointer_offset:=0;
  269. firsttemp_offset:=0;
  270. flags:=[];
  271. framepointer.enum:=R_INTREGISTER;
  272. framepointer.number:=NR_FRAME_POINTER_REG;
  273. { asmlists }
  274. aktproccode:=Taasmoutput.Create;
  275. aktlocaldata:=Taasmoutput.Create;
  276. reference_reset(save_stackptr_ref);
  277. { labels }
  278. objectlibrary.getlabel(aktexitlabel);
  279. end;
  280. destructor tprocinfo.destroy;
  281. begin
  282. aktproccode.free;
  283. aktlocaldata.free;
  284. end;
  285. procedure tprocinfo.allocate_interrupt_parameter;
  286. begin
  287. end;
  288. procedure tprocinfo.allocate_framepointer;
  289. begin
  290. end;
  291. procedure tprocinfo.handle_body_start;
  292. var
  293. paramloc : tparalocation;
  294. begin
  295. { temporary space is set, while the BEGIN of the procedure }
  296. if (symtablestack.symtabletype=localsymtable) then
  297. current_procinfo.firsttemp_offset := tg.direction*symtablestack.datasize
  298. else
  299. current_procinfo.firsttemp_offset := 0;
  300. { space for the return value }
  301. { !!!!! this means that we can not set the return value
  302. in a subfunction !!!!! }
  303. { because we don't know yet where the address is }
  304. if not is_void(procdef.rettype.def) then
  305. begin
  306. if not paramanager.ret_in_param(procdef.rettype.def,procdef.proccalloption) then
  307. begin
  308. paramloc:=paramanager.getfuncresultloc(procdef,procdef.proccalloption);
  309. case paramloc.loc of
  310. LOC_FPUREGISTER,
  311. LOC_CFPUREGISTER,
  312. LOC_MMREGISTER,
  313. LOC_CMMREGISTER :
  314. begin
  315. include(rg.used_in_proc_other,paramloc.register.enum);
  316. end;
  317. LOC_REGISTER,LOC_CREGISTER :
  318. begin
  319. if ((paramloc.size in [OS_S64,OS_64]) and
  320. (sizeof(aword) < 8)) then
  321. begin
  322. include(rg.used_in_proc_int,paramloc.registerhigh.number shr 8);
  323. include(rg.used_in_proc_int,paramloc.registerlow.number shr 8);
  324. end
  325. else
  326. include(rg.used_in_proc_int,paramloc.register.number shr 8);
  327. end;
  328. else
  329. internalerror(20020816);
  330. end;
  331. end;
  332. end;
  333. end;
  334. procedure tprocinfo.allocate_implicit_parameter;
  335. begin
  336. { Insert implicit parameters, will be removed in the future }
  337. if (procdef.parast.symtablelevel>normal_function_level) then
  338. begin
  339. framepointer_offset:=procdef.parast.address_fixup;
  340. inc(procdef.parast.address_fixup,POINTER_SIZE);
  341. end;
  342. end;
  343. procedure tprocinfo.after_header;
  344. begin
  345. end;
  346. procedure tprocinfo.after_pass1;
  347. begin
  348. end;
  349. {*****************************************************************************
  350. initialize/terminate the codegen for procedure and modules
  351. *****************************************************************************}
  352. procedure codegen_newmodule;
  353. begin
  354. exprasmlist:=taasmoutput.create;
  355. datasegment:=taasmoutput.create;
  356. codesegment:=taasmoutput.create;
  357. bsssegment:=taasmoutput.create;
  358. debuglist:=taasmoutput.create;
  359. withdebuglist:=taasmoutput.create;
  360. consts:=taasmoutput.create;
  361. rttilist:=taasmoutput.create;
  362. ResourceStringList:=Nil;
  363. importssection:=nil;
  364. exportssection:=nil;
  365. resourcesection:=nil;
  366. { resourcestrings }
  367. ResourceStrings:=TResourceStrings.Create;
  368. { use the librarydata from current_module }
  369. objectlibrary:=current_module.librarydata;
  370. end;
  371. procedure codegen_donemodule;
  372. {$ifdef MEMDEBUG}
  373. var
  374. d : tmemdebug;
  375. {$endif}
  376. begin
  377. {$ifdef MEMDEBUG}
  378. d:=tmemdebug.create(current_module.modulename^+' - asmlists');
  379. {$endif}
  380. exprasmlist.free;
  381. codesegment.free;
  382. bsssegment.free;
  383. datasegment.free;
  384. debuglist.free;
  385. withdebuglist.free;
  386. consts.free;
  387. rttilist.free;
  388. if assigned(ResourceStringList) then
  389. ResourceStringList.free;
  390. if assigned(importssection) then
  391. importssection.free;
  392. if assigned(exportssection) then
  393. exportssection.free;
  394. if assigned(resourcesection) then
  395. resourcesection.free;
  396. {$ifdef MEMDEBUG}
  397. d.free;
  398. {$endif}
  399. { resource strings }
  400. ResourceStrings.free;
  401. objectlibrary:=nil;
  402. end;
  403. function def_cgsize(def: tdef): tcgsize;
  404. begin
  405. case def.deftype of
  406. orddef,
  407. enumdef,
  408. setdef:
  409. begin
  410. result := int_cgsize(def.size);
  411. if is_signed(def) then
  412. result := tcgsize(ord(result)+(ord(OS_S8)-ord(OS_8)));
  413. end;
  414. classrefdef,
  415. pointerdef,
  416. procvardef:
  417. result := OS_ADDR;
  418. stringdef :
  419. begin
  420. if is_ansistring(def) or is_widestring(def) then
  421. result := OS_ADDR
  422. else
  423. result := OS_NO;
  424. end;
  425. objectdef :
  426. begin
  427. if is_class_or_interface(def) then
  428. result := OS_ADDR
  429. else
  430. result := OS_NO;
  431. end;
  432. floatdef:
  433. result := tfloat2tcgsize[tfloatdef(def).typ];
  434. recorddef :
  435. result:=int_cgsize(def.size);
  436. arraydef :
  437. begin
  438. if not is_special_array(def) then
  439. result := int_cgsize(def.size)
  440. else
  441. begin
  442. if is_dynamic_array(def) then
  443. result := OS_ADDR
  444. else
  445. result := OS_NO;
  446. end;
  447. end;
  448. else
  449. begin
  450. { undefined size }
  451. result:=OS_NO;
  452. end;
  453. end;
  454. end;
  455. function int_cgsize(const a: aword): tcgsize;
  456. begin
  457. if a > 8 then
  458. begin
  459. int_cgsize := OS_NO;
  460. exit;
  461. end;
  462. case byte(a) of
  463. 1 :
  464. result := OS_8;
  465. 2 :
  466. result := OS_16;
  467. 3,4 :
  468. result := OS_32;
  469. 5..8 :
  470. result := OS_64;
  471. end;
  472. end;
  473. function inverse_opcmp(opcmp: topcmp): topcmp;
  474. const
  475. list: array[TOpCmp] of TOpCmp =
  476. (OC_NONE,OC_NE,OC_LTE,OC_GTE,OC_LT,OC_GT,OC_EQ,OC_A,OC_AE,
  477. OC_B,OC_BE);
  478. begin
  479. inverse_opcmp := list[opcmp];
  480. end;
  481. function commutativeop(op: topcg): boolean;
  482. const
  483. list: array[topcg] of boolean =
  484. (true,true,true,false,false,true,true,false,false,
  485. true,false,false,false,false,true);
  486. begin
  487. commutativeop := list[op];
  488. end;
  489. end.
  490. {
  491. $Log$
  492. Revision 1.56 2003-06-13 21:19:30 peter
  493. * current_procdef removed, use current_procinfo.procdef instead
  494. Revision 1.55 2003/06/12 16:43:07 peter
  495. * newra compiles for sparc
  496. Revision 1.54 2003/06/09 12:23:29 peter
  497. * init/final of procedure data splitted from genentrycode
  498. * use asmnode getposition to insert final at the correct position
  499. als for the implicit try...finally
  500. Revision 1.53 2003/06/02 21:42:05 jonas
  501. * function results can now also be regvars
  502. - removed tprocinfo.return_offset, never use it again since it's invalid
  503. if the result is a regvar
  504. Revision 1.52 2003/05/26 21:17:17 peter
  505. * procinlinenode removed
  506. * aktexit2label removed, fast exit removed
  507. + tcallnode.inlined_pass_2 added
  508. Revision 1.51 2003/05/23 14:27:35 peter
  509. * remove some unit dependencies
  510. * current_procinfo changes to store more info
  511. Revision 1.50 2003/05/16 20:54:12 jonas
  512. - undid previous commit, it wasn't necessary
  513. Revision 1.49 2003/05/16 20:00:39 jonas
  514. * powerpc nested procedure fixes, should work completely now if all
  515. local variables of the parent procedure are declared before the
  516. nested procedures are declared
  517. Revision 1.48 2003/05/15 18:58:53 peter
  518. * removed selfpointer_offset, vmtpointer_offset
  519. * tvarsym.adjusted_address
  520. * address in localsymtable is now in the real direction
  521. * removed some obsolete globals
  522. Revision 1.47 2003/05/13 19:14:41 peter
  523. * failn removed
  524. * inherited result code check moven to pexpr
  525. Revision 1.46 2003/05/09 17:47:02 peter
  526. * self moved to hidden parameter
  527. * removed hdisposen,hnewn,selfn
  528. Revision 1.45 2003/04/27 11:21:32 peter
  529. * aktprocdef renamed to current_procinfo.procdef
  530. * procinfo renamed to current_procinfo
  531. * procinfo will now be stored in current_module so it can be
  532. cleaned up properly
  533. * gen_main_procsym changed to create_main_proc and release_main_proc
  534. to also generate a tprocinfo structure
  535. * fixed unit implicit initfinal
  536. Revision 1.44 2003/04/27 07:29:50 peter
  537. * current_procinfo.procdef cleanup, current_procdef is now always nil when parsing
  538. a new procdef declaration
  539. * aktprocsym removed
  540. * lexlevel removed, use symtable.symtablelevel instead
  541. * implicit init/final code uses the normal genentry/genexit
  542. * funcret state checking updated for new funcret handling
  543. Revision 1.43 2003/04/26 00:31:42 peter
  544. * set return_offset moved to after_header
  545. Revision 1.42 2003/04/25 20:59:33 peter
  546. * removed funcretn,funcretsym, function result is now in varsym
  547. and aliases for result and function name are added using absolutesym
  548. * vs_hidden parameter for funcret passed in parameter
  549. * vs_hidden fixes
  550. * writenode changed to printnode and released from extdebug
  551. * -vp option added to generate a tree.log with the nodetree
  552. * nicer printnode for statements, callnode
  553. Revision 1.41 2003/04/23 12:35:34 florian
  554. * fixed several issues with powerpc
  555. + applied a patch from Jonas for nested function calls (PowerPC only)
  556. * ...
  557. Revision 1.40 2003/04/22 13:47:08 peter
  558. * fixed C style array of const
  559. * fixed C array passing
  560. * fixed left to right with high parameters
  561. Revision 1.39 2003/04/05 21:09:31 jonas
  562. * several ppc/generic result offset related fixes. The "normal" result
  563. offset seems now to be calculated correctly and a lot of duplicate
  564. calculations have been removed. Nested functions accessing the parent's
  565. function result don't work at all though :(
  566. Revision 1.38 2003/03/28 19:16:56 peter
  567. * generic constructor working for i386
  568. * remove fixed self register
  569. * esi added as address register for i386
  570. Revision 1.37 2003/03/20 17:51:45 peter
  571. * dynamic arrays have size OS_ADDR
  572. Revision 1.36 2003/01/08 18:43:56 daniel
  573. * Tregister changed into a record
  574. Revision 1.35 2003/01/01 21:04:48 peter
  575. * removed unused method
  576. Revision 1.34 2002/11/25 17:43:16 peter
  577. * splitted defbase in defutil,symutil,defcmp
  578. * merged isconvertable and is_equal into compare_defs(_ext)
  579. * made operator search faster by walking the list only once
  580. Revision 1.33 2002/11/18 17:31:54 peter
  581. * pass proccalloption to ret_in_xxx and push_xxx functions
  582. Revision 1.32 2002/10/05 12:43:23 carl
  583. * fixes for Delphi 6 compilation
  584. (warning : Some features do not work under Delphi)
  585. Revision 1.31 2002/10/03 21:20:19 carl
  586. * range check error fix
  587. Revision 1.30 2002/09/30 07:00:44 florian
  588. * fixes to common code to get the alpha compiler compiled applied
  589. Revision 1.29 2002/09/07 19:35:45 florian
  590. + tcg.direction is used now
  591. Revision 1.28 2002/09/07 15:25:01 peter
  592. * old logs removed and tabs fixed
  593. Revision 1.27 2002/09/05 19:29:42 peter
  594. * memdebug enhancements
  595. Revision 1.26 2002/08/18 20:06:23 peter
  596. * inlining is now also allowed in interface
  597. * renamed write/load to ppuwrite/ppuload
  598. * tnode storing in ppu
  599. * nld,ncon,nbas are already updated for storing in ppu
  600. Revision 1.25 2002/08/17 09:23:33 florian
  601. * first part of procinfo rewrite
  602. Revision 1.24 2002/08/11 14:32:26 peter
  603. * renamed current_library to objectlibrary
  604. Revision 1.23 2002/08/11 13:24:11 peter
  605. * saving of asmsymbols in ppu supported
  606. * asmsymbollist global is removed and moved into a new class
  607. tasmlibrarydata that will hold the info of a .a file which
  608. corresponds with a single module. Added librarydata to tmodule
  609. to keep the library info stored for the module. In the future the
  610. objectfiles will also be stored to the tasmlibrarydata class
  611. * all getlabel/newasmsymbol and friends are moved to the new class
  612. Revision 1.22 2002/08/06 20:55:20 florian
  613. * first part of ppc calling conventions fix
  614. Revision 1.21 2002/08/05 18:27:48 carl
  615. + more more more documentation
  616. + first version include/exclude (can't test though, not enough scratch for i386 :()...
  617. Revision 1.20 2002/08/04 19:06:41 carl
  618. + added generic exception support (still does not work!)
  619. + more documentation
  620. Revision 1.19 2002/07/20 11:57:53 florian
  621. * types.pas renamed to defbase.pas because D6 contains a types
  622. unit so this would conflicts if D6 programms are compiled
  623. + Willamette/SSE2 instructions to assembler added
  624. Revision 1.18 2002/07/01 18:46:22 peter
  625. * internal linker
  626. * reorganized aasm layer
  627. Revision 1.17 2002/05/20 13:30:40 carl
  628. * bugfix of hdisponen (base must be set, not index)
  629. * more portability fixes
  630. Revision 1.16 2002/05/18 13:34:05 peter
  631. * readded missing revisions
  632. Revision 1.15 2002/05/16 19:46:35 carl
  633. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  634. + try to fix temp allocation (still in ifdef)
  635. + generic constructor calls
  636. + start of tassembler / tmodulebase class cleanup
  637. Revision 1.13 2002/04/25 20:16:38 peter
  638. * moved more routines from cga/n386util
  639. Revision 1.12 2002/04/21 15:28:06 carl
  640. - remove duplicate constants
  641. - move some constants to cginfo
  642. Revision 1.11 2002/04/20 21:32:23 carl
  643. + generic FPC_CHECKPOINTER
  644. + first parameter offset in stack now portable
  645. * rename some constants
  646. + move some cpu stuff to other units
  647. - remove unused constents
  648. * fix stacksize for some targets
  649. * fix generic size problems which depend now on EXTEND_SIZE constant
  650. Revision 1.10 2002/04/07 09:13:39 carl
  651. + documentation
  652. - remove unused variables
  653. Revision 1.9 2002/04/04 19:05:54 peter
  654. * removed unused units
  655. * use tlocation.size in cg.a_*loc*() routines
  656. Revision 1.8 2002/04/02 17:11:27 peter
  657. * tlocation,treference update
  658. * LOC_CONSTANT added for better constant handling
  659. * secondadd splitted in multiple routines
  660. * location_force_reg added for loading a location to a register
  661. of a specified size
  662. * secondassignment parses now first the right and then the left node
  663. (this is compatible with Kylix). This saves a lot of push/pop especially
  664. with string operations
  665. * adapted some routines to use the new cg methods
  666. Revision 1.7 2002/03/31 20:26:33 jonas
  667. + a_loadfpu_* and a_loadmm_* methods in tcg
  668. * register allocation is now handled by a class and is mostly processor
  669. independent (+rgobj.pas and i386/rgcpu.pas)
  670. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  671. * some small improvements and fixes to the optimizer
  672. * some register allocation fixes
  673. * some fpuvaroffset fixes in the unary minus node
  674. * push/popusedregisters is now called rg.save/restoreusedregisters and
  675. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  676. also better optimizable)
  677. * fixed and optimized register saving/restoring for new/dispose nodes
  678. * LOC_FPU locations now also require their "register" field to be set to
  679. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  680. - list field removed of the tnode class because it's not used currently
  681. and can cause hard-to-find bugs
  682. }