cgbase.pas 25 KB

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