cgbase.pas 26 KB

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