cgbase.pas 25 KB

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