cgbase.pas 27 KB

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