cgbase.pas 26 KB

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