cgbase.pas 25 KB

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