cgbase.pas 25 KB

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