ncgld.pas 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Generate assembler for nodes that handle loads and assignments which
  5. are the same for all (most) processors
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. unit ncgld;
  20. {$i fpcdefs.inc}
  21. interface
  22. uses
  23. node,nld;
  24. type
  25. tcgloadnode = class(tloadnode)
  26. procedure pass_2;override;
  27. end;
  28. tcgassignmentnode = class(tassignmentnode)
  29. procedure pass_2;override;
  30. end;
  31. tcgarrayconstructornode = class(tarrayconstructornode)
  32. procedure pass_2;override;
  33. end;
  34. implementation
  35. uses
  36. systems,
  37. verbose,globtype,globals,
  38. symconst,symtype,symdef,symsym,symtable,defutil,paramgr,
  39. ncnv,ncon,nmem,nbas,
  40. aasmbase,aasmtai,aasmcpu,regvars,
  41. cginfo,cgbase,pass_2,
  42. cpubase,cpuinfo,
  43. tgobj,ncgutil,cgobj,rgobj;
  44. {*****************************************************************************
  45. SecondLoad
  46. *****************************************************************************}
  47. procedure tcgloadnode.pass_2;
  48. var
  49. r,hregister : tregister;
  50. supreg:Tsuperregister;
  51. symtabletype : tsymtabletype;
  52. i : longint;
  53. href : treference;
  54. newsize : tcgsize;
  55. {$ifndef newra}
  56. pushed : tpushedsavedint;
  57. {$endif}
  58. dorelocatelab,
  59. norelocatelab : tasmlabel;
  60. paraloc: tparalocation;
  61. begin
  62. { we don't know the size of all arrays }
  63. newsize:=def_cgsize(resulttype.def);
  64. location_reset(location,LOC_REFERENCE,newsize);
  65. case symtableentry.typ of
  66. absolutesym :
  67. begin
  68. { this is only for toasm and toaddr }
  69. if (tabsolutesym(symtableentry).abstyp=toaddr) then
  70. begin
  71. {$ifdef i386}
  72. if tabsolutesym(symtableentry).absseg then
  73. location.reference.segment.enum:=R_FS;
  74. {$endif i386}
  75. location.reference.offset:=tabsolutesym(symtableentry).address;
  76. end
  77. else
  78. location.reference.symbol:=objectlibrary.newasmsymboldata(tabsolutesym(symtableentry).mangledname);
  79. end;
  80. constsym:
  81. begin
  82. if tconstsym(symtableentry).consttyp=constresourcestring then
  83. begin
  84. location_reset(location,LOC_CREFERENCE,OS_ADDR);
  85. location.reference.symbol:=objectlibrary.newasmsymboldata(tconstsym(symtableentry).owner.name^+'_RESOURCESTRINGLIST');
  86. location.reference.offset:=tconstsym(symtableentry).resstrindex*16+8;
  87. end
  88. else
  89. internalerror(22798);
  90. end;
  91. varsym :
  92. begin
  93. if (tvarsym(symtableentry).varspez=vs_const) then
  94. location_reset(location,LOC_CREFERENCE,newsize);
  95. symtabletype:=symtable.symtabletype;
  96. hregister.enum:=R_NO;
  97. { C variable }
  98. if (vo_is_C_var in tvarsym(symtableentry).varoptions) then
  99. begin
  100. location.reference.symbol:=objectlibrary.newasmsymboldata(tvarsym(symtableentry).mangledname);
  101. end
  102. { DLL variable }
  103. else if (vo_is_dll_var in tvarsym(symtableentry).varoptions) then
  104. begin
  105. hregister:=rg.getaddressregister(exprasmlist);
  106. location.reference.symbol:=objectlibrary.newasmsymboldata(tvarsym(symtableentry).mangledname);
  107. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,location.reference,hregister);
  108. reference_reset_base(location.reference,hregister,0);
  109. end
  110. { external variable }
  111. else if (vo_is_external in tvarsym(symtableentry).varoptions) then
  112. begin
  113. location.reference.symbol:=objectlibrary.newasmsymboldata(tvarsym(symtableentry).mangledname);
  114. end
  115. { thread variable }
  116. else if (vo_is_thread_var in tvarsym(symtableentry).varoptions) then
  117. begin
  118. objectlibrary.getlabel(dorelocatelab);
  119. objectlibrary.getlabel(norelocatelab);
  120. { make sure hregister can't allocate the register necessary for the parameter }
  121. paraloc := paramanager.getintparaloc(exprasmlist,1);
  122. { we've to allocate the register before we save the used registers }
  123. hregister:=rg.getaddressregister(exprasmlist);
  124. reference_reset_symbol(href,objectlibrary.newasmsymboldata('FPC_THREADVAR_RELOCATE'),0);
  125. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,href,hregister);
  126. cg.a_cmp_const_reg_label(exprasmlist,OS_ADDR,OC_NE,0,hregister,dorelocatelab);
  127. { no relocation needed, load the address of the variable only, the
  128. layout of a threadvar is (4 bytes pointer):
  129. 0 - Threadvar index
  130. 4 - Threadvar value in single threading }
  131. reference_reset_symbol(href,objectlibrary.newasmsymboldata(tvarsym(symtableentry).mangledname),POINTER_SIZE);
  132. cg.a_loadaddr_ref_reg(exprasmlist,href,hregister);
  133. cg.a_jmp_always(exprasmlist,norelocatelab);
  134. cg.a_label(exprasmlist,dorelocatelab);
  135. { don't save the allocated register else the result will be destroyed later }
  136. {$ifndef newra}
  137. rg.saveusedintregisters(exprasmlist,pushed,[RS_FUNCTION_RESULT_REG]-[hregister.number shr 8]);
  138. {$endif}
  139. reference_reset_symbol(href,objectlibrary.newasmsymboldata(tvarsym(symtableentry).mangledname),0);
  140. cg.a_param_ref(exprasmlist,OS_ADDR,href,paraloc);
  141. { the called procedure isn't allowed to change }
  142. { any register except EAX }
  143. cg.a_call_reg(exprasmlist,hregister);
  144. paramanager.freeintparaloc(exprasmlist,1);
  145. {$ifdef newra}
  146. r:=rg.getexplicitregisterint(exprasmlist,NR_FUNCTION_RESULT_REG);
  147. rg.ungetregisterint(exprasmlist,r);
  148. {$else}
  149. r.enum:=R_INTREGISTER;
  150. r.number:=NR_FUNCTION_RESULT_REG;
  151. {$endif}
  152. cg.a_load_reg_reg(exprasmlist,OS_INT,OS_ADDR,r,hregister);
  153. {$ifndef newra}
  154. rg.restoreusedintregisters(exprasmlist,pushed);
  155. {$endif}
  156. cg.a_label(exprasmlist,norelocatelab);
  157. location.reference.base:=hregister;
  158. end
  159. { normal variable }
  160. else
  161. begin
  162. { in case it is a register variable: }
  163. if tvarsym(symtableentry).reg.enum<>R_NO then
  164. begin
  165. if tvarsym(symtableentry).reg.enum in fpuregs then
  166. begin
  167. location_reset(location,LOC_CFPUREGISTER,def_cgsize(resulttype.def));
  168. location.register:=tvarsym(symtableentry).reg;
  169. end
  170. else if Tvarsym(symtableentry).reg.enum=R_INTREGISTER then
  171. begin
  172. supreg:=Tvarsym(symtableentry).reg.number shr 8;
  173. if (supreg in general_superregisters) and
  174. not (supreg in rg.regvar_loaded_int) then
  175. load_regvar(exprasmlist,tvarsym(symtableentry));
  176. location_reset(location,LOC_CREGISTER,def_cgsize(resulttype.def));
  177. location.register:=tvarsym(symtableentry).reg;
  178. exclude(rg.unusedregsint,supreg);
  179. hregister := location.register;
  180. end
  181. else
  182. internalerror(200301172);
  183. end
  184. else
  185. begin
  186. case symtabletype of
  187. localsymtable,
  188. parasymtable,
  189. inlinelocalsymtable,
  190. inlineparasymtable :
  191. begin
  192. location.reference.base:=current_procinfo.framepointer;
  193. location.reference.offset:=tvarsym(symtableentry).adjusted_address;
  194. if (current_procinfo.procdef.parast.symtablelevel>symtable.symtablelevel) then
  195. begin
  196. hregister:=rg.getaddressregister(exprasmlist);
  197. cg.g_load_parent_framepointer(exprasmlist,symtable,hregister);
  198. location.reference.base:=hregister;
  199. end;
  200. end;
  201. globalsymtable,
  202. staticsymtable :
  203. begin
  204. location.reference.symbol:=objectlibrary.newasmsymboldata(tvarsym(symtableentry).mangledname);
  205. end;
  206. stt_exceptsymtable:
  207. begin
  208. location.reference.base:=current_procinfo.framepointer;
  209. location.reference.offset:=tvarsym(symtableentry).address;
  210. end;
  211. else
  212. internalerror(200305102);
  213. end;
  214. end;
  215. end;
  216. { handle call by reference variables, ignore the reference
  217. when we need to load the self pointer for objects }
  218. if (symtabletype in [parasymtable,inlineparasymtable]) and
  219. not(nf_load_self_pointer in flags) and
  220. (
  221. (tvarsym(symtableentry).varspez in [vs_var,vs_out]) or
  222. paramanager.push_addr_param(tvarsym(symtableentry).vartype.def,tprocdef(symtable.defowner).proccalloption)
  223. ) then
  224. begin
  225. if hregister.enum=R_NO then
  226. hregister:=rg.getaddressregister(exprasmlist);
  227. { we need to load only an address }
  228. location.size:=OS_ADDR;
  229. cg.a_load_loc_reg(exprasmlist,location.size,location,hregister);
  230. if tvarsym(symtableentry).varspez=vs_const then
  231. location_reset(location,LOC_CREFERENCE,newsize)
  232. else
  233. location_reset(location,LOC_REFERENCE,newsize);
  234. location.reference.base:=hregister;
  235. end;
  236. end;
  237. procsym:
  238. begin
  239. if assigned(left) then
  240. begin
  241. {
  242. THIS IS A TERRIBLE HACK!!!!!! WHICH WILL NOT WORK
  243. ON 64-BIT SYSTEMS: SINCE PROCSYM FOR METHODS
  244. CONSISTS OF TWO OS_ADDR, so you cannot set it
  245. to OS_64 - how to solve?? Carl
  246. }
  247. if (sizeof(aword) = 4) then
  248. location_reset(location,LOC_CREFERENCE,OS_64)
  249. else
  250. internalerror(20020520);
  251. tg.GetTemp(exprasmlist,2*POINTER_SIZE,tt_normal,location.reference);
  252. secondpass(left);
  253. { load class instance address }
  254. case left.location.loc of
  255. LOC_CREGISTER,
  256. LOC_REGISTER:
  257. begin
  258. { this is not possible for objects }
  259. if is_object(left.resulttype.def) then
  260. internalerror(200304234);
  261. hregister:=left.location.register;
  262. end;
  263. LOC_CREFERENCE,
  264. LOC_REFERENCE:
  265. begin
  266. hregister:=rg.getaddressregister(exprasmlist);
  267. if is_class_or_interface(left.resulttype.def) then
  268. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.reference,hregister)
  269. else
  270. cg.a_loadaddr_ref_reg(exprasmlist,left.location.reference,hregister);
  271. location_release(exprasmlist,left.location);
  272. location_freetemp(exprasmlist,left.location);
  273. end;
  274. else
  275. internalerror(26019);
  276. end;
  277. { store the class instance address }
  278. href:=location.reference;
  279. inc(href.offset,POINTER_SIZE);
  280. cg.a_load_reg_ref(exprasmlist,OS_ADDR,OS_ADDR,hregister,href);
  281. { virtual method ? }
  282. if (po_virtualmethod in procdef.procoptions) then
  283. begin
  284. { load vmt pointer }
  285. reference_reset_base(href,hregister,0);
  286. reference_release(exprasmlist,href);
  287. hregister:=rg.getaddressregister(exprasmlist);
  288. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,href,hregister);
  289. reference_reset_base(href,hregister,
  290. procdef._class.vmtmethodoffset(procdef.extnumber));
  291. reference_release(exprasmlist,href);
  292. { load method address }
  293. hregister:=rg.getaddressregister(exprasmlist);
  294. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,href,hregister);
  295. { ... and store it }
  296. cg.a_load_reg_ref(exprasmlist,OS_ADDR,OS_ADDR,hregister,location.reference);
  297. rg.ungetaddressregister(exprasmlist,hregister);
  298. end
  299. else
  300. begin
  301. { we don't use the hregister }
  302. rg.ungetregisterint(exprasmlist,hregister);
  303. { load address of the function }
  304. reference_reset_symbol(href,objectlibrary.newasmsymbol(procdef.mangledname),0);
  305. {$ifdef newra}
  306. hregister:=rg.getaddressregister(exprasmlist);
  307. {$else}
  308. hregister:=cg.get_scratch_reg_address(exprasmlist);
  309. {$endif}
  310. cg.a_loadaddr_ref_reg(exprasmlist,href,hregister);
  311. cg.a_load_reg_ref(exprasmlist,OS_ADDR,OS_ADDR,hregister,location.reference);
  312. {$ifdef newra}
  313. rg.ungetregisterint(exprasmlist,hregister);
  314. {$else newra}
  315. cg.free_scratch_reg(exprasmlist,hregister);
  316. {$endif}
  317. end;
  318. end
  319. else
  320. begin
  321. {!!!!! Be aware, work on virtual methods too }
  322. location.reference.symbol:=objectlibrary.newasmsymbol(procdef.mangledname);
  323. end;
  324. end;
  325. typedconstsym :
  326. begin
  327. location.reference.symbol:=objectlibrary.newasmsymboldata(ttypedconstsym(symtableentry).mangledname);
  328. end;
  329. else internalerror(4);
  330. end;
  331. end;
  332. {*****************************************************************************
  333. SecondAssignment
  334. *****************************************************************************}
  335. procedure tcgassignmentnode.pass_2;
  336. var
  337. otlabel,hlabel,oflabel : tasmlabel;
  338. fputyp : tfloattype;
  339. href : treference;
  340. old_allow_multi_pass2,
  341. releaseright : boolean;
  342. pushedregs : tmaybesave;
  343. cgsize : tcgsize;
  344. r:Tregister;
  345. begin
  346. location_reset(location,LOC_VOID,OS_NO);
  347. otlabel:=truelabel;
  348. oflabel:=falselabel;
  349. objectlibrary.getlabel(truelabel);
  350. objectlibrary.getlabel(falselabel);
  351. {
  352. in most cases we can process first the right node which contains
  353. the most complex code. But not when the result is in the flags, then
  354. loading the left node afterwards can destroy the flags.
  355. when the right node returns as LOC_JUMP then we will generate
  356. the following code:
  357. rightnode
  358. true:
  359. leftnode
  360. assign 1
  361. false:
  362. leftnode
  363. assign 0
  364. }
  365. { Try to determine which side to calculate first, }
  366. if (right.expectloc<>LOC_FLAGS) and
  367. ((right.expectloc=LOC_JUMP) or
  368. (right.nodetype=calln) or
  369. (right.registers32>=left.registers32)) then
  370. begin
  371. secondpass(right);
  372. { increment source reference counter, this is
  373. useless for string constants}
  374. if (right.resulttype.def.needs_inittable) and
  375. (right.nodetype<>stringconstn) then
  376. cg.g_incrrefcount(exprasmlist,right.resulttype.def,right.location.reference,false);
  377. if codegenerror then
  378. exit;
  379. { We skip the generation of the left node when it's a jump, see
  380. explanation above }
  381. if (right.location.loc<>LOC_JUMP) and
  382. not(nf_concat_string in flags) then
  383. begin
  384. { left can't be never a 64 bit LOC_REGISTER, so the 3. arg }
  385. { can be false }
  386. {$ifndef newra}
  387. maybe_save(exprasmlist,left.registers32,right.location,pushedregs);
  388. {$endif}
  389. secondpass(left);
  390. { decrement destination reference counter }
  391. if (left.resulttype.def.needs_inittable) then
  392. cg.g_decrrefcount(exprasmlist,left.resulttype.def,left.location.reference,false);
  393. {$ifndef newra}
  394. maybe_restore(exprasmlist,right.location,pushedregs);
  395. {$endif newra}
  396. if codegenerror then
  397. exit;
  398. end;
  399. end
  400. else
  401. begin
  402. { calculate left sides }
  403. { don't do it yet if it's a crgister (JM) }
  404. if not(nf_concat_string in flags) then
  405. begin
  406. secondpass(left);
  407. { decrement destination reference counter }
  408. if (left.resulttype.def.needs_inittable) then
  409. cg.g_decrrefcount(exprasmlist,left.resulttype.def,left.location.reference,false);
  410. if codegenerror then
  411. exit;
  412. end;
  413. { left can't be never a 64 bit LOC_REGISTER, so the 3. arg }
  414. { can be false }
  415. {$ifndef newra}
  416. maybe_save(exprasmlist,right.registers32,left.location,pushedregs);
  417. {$endif newra}
  418. secondpass(right);
  419. { increment source reference counter, this is
  420. useless for string constants}
  421. if (right.resulttype.def.needs_inittable) and
  422. (right.nodetype<>stringconstn) then
  423. cg.g_incrrefcount(exprasmlist,right.resulttype.def,right.location.reference,false);
  424. {$ifndef newra}
  425. maybe_restore(exprasmlist,left.location,pushedregs);
  426. {$endif}
  427. if codegenerror then
  428. exit;
  429. end;
  430. releaseright:=true;
  431. { optimize temp to temp copies }
  432. if (left.nodetype = temprefn) and
  433. {$ifdef newra}
  434. { we may store certain temps in registers in the future, then this }
  435. { optimization will have to be adapted }
  436. (left.location.loc = LOC_REFERENCE) and
  437. {$endif newra}
  438. (right.location.loc = LOC_REFERENCE) and
  439. tg.istemp(right.location.reference) and
  440. (tg.sizeoftemp(exprasmlist,right.location.reference) = tg.sizeoftemp(exprasmlist,left.location.reference)) then
  441. begin
  442. { in theory, we should also make sure the left temp type is }
  443. { already more or less of the same kind (ie. we must not }
  444. { assign an ansistring to a normaltemp). In practice, the }
  445. { assignment node will have already taken care of this for us }
  446. ttemprefnode(left).changelocation(right.location.reference);
  447. end
  448. { shortstring assignments are handled separately }
  449. else if is_shortstring(left.resulttype.def) then
  450. begin
  451. {
  452. we can get here only in the following situations
  453. for the right node:
  454. - empty constant string
  455. - char
  456. }
  457. { empty constant string }
  458. if (right.nodetype=stringconstn) and
  459. (tstringconstnode(right).len=0) then
  460. begin
  461. cg.a_load_const_ref(exprasmlist,OS_8,0,left.location.reference);
  462. end
  463. { char loading }
  464. else if is_char(right.resulttype.def) then
  465. begin
  466. if right.nodetype=ordconstn then
  467. begin
  468. if (target_info.endian = endian_little) then
  469. cg.a_load_const_ref(exprasmlist,OS_16,(tordconstnode(right).value shl 8) or 1,
  470. left.location.reference)
  471. else
  472. cg.a_load_const_ref(exprasmlist,OS_16,tordconstnode(right).value or (1 shl 8),
  473. left.location.reference);
  474. end
  475. else
  476. begin
  477. href:=left.location.reference;
  478. cg.a_load_const_ref(exprasmlist,OS_8,1,href);
  479. inc(href.offset,1);
  480. case right.location.loc of
  481. LOC_REGISTER,
  482. LOC_CREGISTER :
  483. begin
  484. r:=rg.makeregsize(right.location.register,OS_8);
  485. cg.a_load_reg_ref(exprasmlist,OS_8,OS_8,r,href);
  486. end;
  487. LOC_REFERENCE,
  488. LOC_CREFERENCE :
  489. cg.a_load_ref_ref(exprasmlist,OS_8,OS_8,right.location.reference,href);
  490. else
  491. internalerror(200205111);
  492. end;
  493. end;
  494. end
  495. else
  496. internalerror(200204249);
  497. end
  498. else
  499. begin
  500. case right.location.loc of
  501. LOC_CONSTANT :
  502. begin
  503. if right.location.size in [OS_64,OS_S64] then
  504. cg64.a_load64_const_loc(exprasmlist,
  505. right.location.valueqword,left.location)
  506. else
  507. cg.a_load_const_loc(exprasmlist,right.location.value,left.location);
  508. end;
  509. LOC_REFERENCE,
  510. LOC_CREFERENCE :
  511. begin
  512. case left.location.loc of
  513. LOC_CREGISTER :
  514. begin
  515. cgsize:=def_cgsize(left.resulttype.def);
  516. if cgsize in [OS_64,OS_S64] then
  517. cg64.a_load64_ref_reg(exprasmlist,
  518. right.location.reference,left.location.register64{$ifdef newra},false{$endif})
  519. else
  520. cg.a_load_ref_reg(exprasmlist,cgsize,cgsize,
  521. right.location.reference,left.location.register);
  522. location_release(exprasmlist,right.location);
  523. end;
  524. LOC_CFPUREGISTER :
  525. begin
  526. cg.a_loadfpu_ref_reg(exprasmlist,
  527. def_cgsize(right.resulttype.def),
  528. right.location.reference,
  529. left.location.register);
  530. end;
  531. LOC_REFERENCE,
  532. LOC_CREFERENCE :
  533. begin
  534. cg.g_concatcopy(exprasmlist,right.location.reference,
  535. left.location.reference,left.resulttype.def.size,true,false);
  536. { right.location is already released by concatcopy }
  537. releaseright:=false;
  538. end;
  539. else
  540. internalerror(200203284);
  541. end;
  542. end;
  543. {$ifdef SUPPORT_MMX}
  544. LOC_CMMXREGISTER,
  545. LOC_MMXREGISTER:
  546. begin
  547. if left.location.loc=LOC_CMMXREGISTER then
  548. cg.a_loadmm_reg_reg(exprasmlist,right.location.register,left.location.register)
  549. else
  550. cg.a_loadmm_reg_ref(exprasmlist,right.location.register,left.location.reference);
  551. end;
  552. {$endif SUPPORT_MMX}
  553. LOC_REGISTER,
  554. LOC_CREGISTER :
  555. begin
  556. cgsize:=def_cgsize(left.resulttype.def);
  557. if cgsize in [OS_64,OS_S64] then
  558. cg64.a_load64_reg_loc(exprasmlist,
  559. right.location.register64,left.location)
  560. else
  561. cg.a_load_reg_loc(exprasmlist,right.location.size,right.location.register,left.location);
  562. end;
  563. LOC_FPUREGISTER,LOC_CFPUREGISTER :
  564. begin
  565. if (left.resulttype.def.deftype=floatdef) then
  566. fputyp:=tfloatdef(left.resulttype.def).typ
  567. else
  568. if (right.resulttype.def.deftype=floatdef) then
  569. fputyp:=tfloatdef(right.resulttype.def).typ
  570. else
  571. if (right.nodetype=typeconvn) and
  572. (ttypeconvnode(right).left.resulttype.def.deftype=floatdef) then
  573. fputyp:=tfloatdef(ttypeconvnode(right).left.resulttype.def).typ
  574. else
  575. fputyp:=s32real;
  576. cg.a_loadfpu_reg_loc(exprasmlist,
  577. tfloat2tcgsize[fputyp],
  578. right.location.register,left.location);
  579. end;
  580. LOC_JUMP :
  581. begin
  582. cgsize:=def_cgsize(left.resulttype.def);
  583. objectlibrary.getlabel(hlabel);
  584. { generate the leftnode for the true case, and
  585. release the location }
  586. cg.a_label(exprasmlist,truelabel);
  587. {$ifndef newra}
  588. maybe_save(exprasmlist,left.registers32,right.location,pushedregs);
  589. {$endif newra}
  590. secondpass(left);
  591. {$ifndef newra}
  592. maybe_restore(exprasmlist,right.location,pushedregs);
  593. {$endif newra}
  594. if codegenerror then
  595. exit;
  596. cg.a_load_const_loc(exprasmlist,1,left.location);
  597. location_release(exprasmlist,left.location);
  598. cg.a_jmp_always(exprasmlist,hlabel);
  599. { generate the leftnode for the false case }
  600. cg.a_label(exprasmlist,falselabel);
  601. {$ifndef newra}
  602. maybe_save(exprasmlist,left.registers32,right.location,pushedregs);
  603. {$endif}
  604. old_allow_multi_pass2:=allow_multi_pass2;
  605. allow_multi_pass2:=true;
  606. secondpass(left);
  607. allow_multi_pass2:=old_allow_multi_pass2;
  608. {$ifndef newra}
  609. maybe_restore(exprasmlist,right.location,pushedregs);
  610. {$endif newra}
  611. if codegenerror then
  612. exit;
  613. cg.a_load_const_loc(exprasmlist,0,left.location);
  614. cg.a_label(exprasmlist,hlabel);
  615. end;
  616. {$ifdef cpuflags}
  617. LOC_FLAGS :
  618. begin
  619. {This can be a wordbool or longbool too, no?}
  620. if left.location.loc=LOC_CREGISTER then
  621. cg.g_flags2reg(exprasmlist,def_cgsize(left.resulttype.def),right.location.resflags,left.location.register)
  622. else
  623. begin
  624. if not(left.location.loc = LOC_REFERENCE) then
  625. internalerror(200203273);
  626. cg.g_flags2ref(exprasmlist,def_cgsize(left.resulttype.def),right.location.resflags,left.location.reference);
  627. end;
  628. end;
  629. {$endif cpuflags}
  630. end;
  631. end;
  632. if releaseright then
  633. location_release(exprasmlist,right.location);
  634. location_release(exprasmlist,left.location);
  635. truelabel:=otlabel;
  636. falselabel:=oflabel;
  637. end;
  638. {*****************************************************************************
  639. SecondArrayConstruct
  640. *****************************************************************************}
  641. const
  642. vtInteger = 0;
  643. vtBoolean = 1;
  644. vtChar = 2;
  645. vtExtended = 3;
  646. vtString = 4;
  647. vtPointer = 5;
  648. vtPChar = 6;
  649. vtObject = 7;
  650. vtClass = 8;
  651. vtWideChar = 9;
  652. vtPWideChar = 10;
  653. vtAnsiString = 11;
  654. vtCurrency = 12;
  655. vtVariant = 13;
  656. vtInterface = 14;
  657. vtWideString = 15;
  658. vtInt64 = 16;
  659. vtQWord = 17;
  660. procedure tcgarrayconstructornode.pass_2;
  661. var
  662. hp : tarrayconstructornode;
  663. href : treference;
  664. lt : tdef;
  665. vaddr : boolean;
  666. vtype : longint;
  667. freetemp,
  668. dovariant : boolean;
  669. elesize : longint;
  670. tmpreg : tregister;
  671. begin
  672. dovariant:=(nf_forcevaria in flags) or tarraydef(resulttype.def).isvariant;
  673. if dovariant then
  674. elesize:=8
  675. else
  676. elesize:=tarraydef(resulttype.def).elesize;
  677. if nf_cargs in flags then
  678. location_reset(location,LOC_VOID,OS_NO)
  679. else
  680. location_reset(location,LOC_CREFERENCE,OS_NO);
  681. if not(nf_cargs in flags) then
  682. begin
  683. { Allocate always a temp, also if no elements are required, to
  684. be sure that location is valid (PFV) }
  685. if tarraydef(resulttype.def).highrange=-1 then
  686. tg.GetTemp(exprasmlist,elesize,tt_normal,location.reference)
  687. else
  688. tg.GetTemp(exprasmlist,(tarraydef(resulttype.def).highrange+1)*elesize,tt_normal,location.reference);
  689. href:=location.reference;
  690. end;
  691. hp:=self;
  692. while assigned(hp) do
  693. begin
  694. if assigned(hp.left) then
  695. begin
  696. freetemp:=true;
  697. secondpass(hp.left);
  698. if codegenerror then
  699. exit;
  700. { Move flags and jump in register }
  701. if hp.left.location.loc in [LOC_FLAGS,LOC_JUMP] then
  702. location_force_reg(exprasmlist,hp.left.location,def_cgsize(hp.left.resulttype.def),false);
  703. if dovariant then
  704. begin
  705. { find the correct vtype value }
  706. vtype:=$ff;
  707. vaddr:=false;
  708. lt:=hp.left.resulttype.def;
  709. case lt.deftype of
  710. enumdef,
  711. orddef :
  712. begin
  713. if is_64bit(lt) then
  714. begin
  715. case torddef(lt).typ of
  716. s64bit:
  717. vtype:=vtInt64;
  718. u64bit:
  719. vtype:=vtQWord;
  720. end;
  721. if not(nf_cargs in flags) then
  722. begin
  723. freetemp:=false;
  724. vaddr:=true;
  725. end;
  726. end
  727. else if (lt.deftype=enumdef) or
  728. is_integer(lt) then
  729. vtype:=vtInteger
  730. else
  731. if is_boolean(lt) then
  732. vtype:=vtBoolean
  733. else
  734. if (lt.deftype=orddef) then
  735. begin
  736. case torddef(lt).typ of
  737. uchar:
  738. vtype:=vtChar;
  739. uwidechar:
  740. vtype:=vtWideChar;
  741. end;
  742. end;
  743. end;
  744. floatdef :
  745. begin
  746. vtype:=vtExtended;
  747. if not(nf_cargs in flags) then
  748. begin
  749. freetemp:=false;
  750. vaddr:=true;
  751. end;
  752. end;
  753. procvardef,
  754. pointerdef :
  755. begin
  756. if is_pchar(lt) then
  757. vtype:=vtPChar
  758. else
  759. vtype:=vtPointer;
  760. end;
  761. variantdef :
  762. begin
  763. vtype:=vtVariant;
  764. vaddr:=true;
  765. freetemp:=false;
  766. end;
  767. classrefdef :
  768. vtype:=vtClass;
  769. objectdef :
  770. vtype:=vtObject;
  771. stringdef :
  772. begin
  773. if is_shortstring(lt) then
  774. begin
  775. vtype:=vtString;
  776. vaddr:=true;
  777. freetemp:=false;
  778. end
  779. else
  780. if is_ansistring(lt) then
  781. begin
  782. vtype:=vtAnsiString;
  783. freetemp:=false;
  784. end
  785. else
  786. if is_widestring(lt) then
  787. begin
  788. vtype:=vtWideString;
  789. freetemp:=false;
  790. end;
  791. end;
  792. end;
  793. if vtype=$ff then
  794. internalerror(14357);
  795. { write C style pushes or an pascal array }
  796. if nf_cargs in flags then
  797. begin
  798. if vaddr then
  799. begin
  800. location_force_mem(exprasmlist,hp.left.location);
  801. cg.a_paramaddr_ref(exprasmlist,hp.left.location.reference,paralocdummy);
  802. location_release(exprasmlist,hp.left.location);
  803. if freetemp then
  804. location_freetemp(exprasmlist,hp.left.location);
  805. inc(pushedparasize,pointer_size);
  806. end
  807. else
  808. if vtype in [vtInt64,vtQword,vtExtended] then
  809. push_value_para(exprasmlist,hp.left,pocall_cdecl,0,4,paralocdummy)
  810. else
  811. begin
  812. cg.a_param_loc(exprasmlist,hp.left.location,paralocdummy);
  813. inc(pushedparasize,pointer_size);
  814. end;
  815. end
  816. else
  817. begin
  818. { write changing field update href to the next element }
  819. inc(href.offset,4);
  820. if vaddr then
  821. begin
  822. location_force_mem(exprasmlist,hp.left.location);
  823. {$ifdef newra}
  824. tmpreg:=rg.getaddressregister(exprasmlist);
  825. {$else}
  826. tmpreg:=cg.get_scratch_reg_address(exprasmlist);
  827. {$endif}
  828. cg.a_loadaddr_ref_reg(exprasmlist,hp.left.location.reference,tmpreg);
  829. cg.a_load_reg_ref(exprasmlist,OS_ADDR,OS_ADDR,tmpreg,href);
  830. {$ifdef newra}
  831. rg.ungetregisterint(exprasmlist,tmpreg);
  832. {$else}
  833. cg.free_scratch_reg(exprasmlist,tmpreg);
  834. {$endif}
  835. location_release(exprasmlist,hp.left.location);
  836. if freetemp then
  837. location_freetemp(exprasmlist,hp.left.location);
  838. end
  839. else
  840. begin
  841. location_release(exprasmlist,hp.left.location);
  842. cg.a_load_loc_ref(exprasmlist,OS_ADDR,hp.left.location,href);
  843. end;
  844. { update href to the vtype field and write it }
  845. dec(href.offset,4);
  846. cg.a_load_const_ref(exprasmlist, OS_INT,vtype,href);
  847. { goto next array element }
  848. inc(href.offset,8);
  849. end;
  850. end
  851. else
  852. { normal array constructor of the same type }
  853. begin
  854. if is_ansistring(left.resulttype.def) or
  855. is_widestring(left.resulttype.def) or
  856. (left.resulttype.def.deftype=variantdef) then
  857. freetemp:=false;
  858. location_release(exprasmlist,hp.left.location);
  859. case hp.left.location.loc of
  860. LOC_FPUREGISTER,
  861. LOC_CFPUREGISTER :
  862. begin
  863. location_release(exprasmlist,hp.left.location);
  864. cg.a_loadfpu_reg_ref(exprasmlist,hp.left.location.size,hp.left.location.register,href);
  865. end;
  866. LOC_REFERENCE,
  867. LOC_CREFERENCE :
  868. begin
  869. cg.g_concatcopy(exprasmlist,hp.left.location.reference,href,elesize,freetemp,false);
  870. end;
  871. else
  872. begin
  873. if hp.left.location.size in [OS_64,OS_S64] then
  874. cg64.a_load64_loc_ref(exprasmlist,hp.left.location,href)
  875. else
  876. cg.a_load_loc_ref(exprasmlist,hp.left.location.size,hp.left.location,href);
  877. end;
  878. end;
  879. inc(href.offset,elesize);
  880. end;
  881. end;
  882. { load next entry }
  883. hp:=tarrayconstructornode(hp.right);
  884. end;
  885. end;
  886. begin
  887. cloadnode:=tcgloadnode;
  888. cassignmentnode:=tcgassignmentnode;
  889. carrayconstructornode:=tcgarrayconstructornode;
  890. end.
  891. {
  892. $Log$
  893. Revision 1.75 2003-07-20 16:26:43 jonas
  894. * fix for threadvars with -dnewra
  895. Revision 1.74 2003/07/06 17:58:22 peter
  896. * framepointer fixes for sparc
  897. * parent framepointer code more generic
  898. Revision 1.73 2003/07/06 15:25:54 jonas
  899. * newra fix for threadvars
  900. Revision 1.72 2003/06/15 15:13:12 jonas
  901. * fixed register allocation for threadvar loads with newra
  902. Revision 1.71 2003/06/13 21:19:30 peter
  903. * current_procdef removed, use current_procinfo.procdef instead
  904. Revision 1.70 2003/06/12 16:43:07 peter
  905. * newra compiles for sparc
  906. Revision 1.69 2003/06/09 16:41:52 jonas
  907. * fixed regvar optimization for call_by_reference parameters (no need
  908. to load address in another register)
  909. Revision 1.68 2003/06/08 18:27:15 jonas
  910. + ability to change the location of a ttempref node with changelocation()
  911. method. Useful to use instead of copying the contents from one temp to
  912. another
  913. + some shortstring optimizations in tassignmentnode that avoid some
  914. copying (required some shortstring optimizations to be moved from
  915. resulttype to firstpass, because they work on callnodes and string
  916. addnodes are only changed to callnodes in the firstpass)
  917. * allow setting/changing the funcretnode of callnodes after the
  918. resulttypepass has been done, funcretnode is now a property
  919. (all of the above should have a quite big effect on callparatemp)
  920. Revision 1.67 2003/06/07 18:57:04 jonas
  921. + added freeintparaloc
  922. * ppc get/freeintparaloc now check whether the parameter regs are
  923. properly allocated/deallocated (and get an extra list para)
  924. * ppc a_call_* now internalerrors if pi_do_call is not yet set
  925. * fixed lot of missing pi_do_call's
  926. Revision 1.66 2003/06/03 21:11:09 peter
  927. * cg.a_load_* get a from and to size specifier
  928. * makeregsize only accepts newregister
  929. * i386 uses generic tcgnotnode,tcgunaryminus
  930. Revision 1.65 2003/06/03 13:01:59 daniel
  931. * Register allocator finished
  932. Revision 1.64 2003/05/30 23:57:08 peter
  933. * more sparc cleanup
  934. * accumulator removed, splitted in function_return_reg (called) and
  935. function_result_reg (caller)
  936. Revision 1.63 2003/05/30 23:54:08 jonas
  937. * forgot to commit, a_load_loc_reg change
  938. Revision 1.62 2003/05/26 19:38:28 peter
  939. * generic fpc_shorstr_concat
  940. + fpc_shortstr_append_shortstr optimization
  941. Revision 1.61 2003/05/24 11:47:27 jonas
  942. * fixed framepointer storage: it's now always stored at r1+12, which is
  943. a place in the link area reserved for compiler use.
  944. Revision 1.60 2003/05/23 14:27:35 peter
  945. * remove some unit dependencies
  946. * current_procinfo changes to store more info
  947. Revision 1.59 2003/05/15 18:58:53 peter
  948. * removed selfpointer_offset, vmtpointer_offset
  949. * tvarsym.adjusted_address
  950. * address in localsymtable is now in the real direction
  951. * removed some obsolete globals
  952. Revision 1.58 2003/05/12 17:22:00 jonas
  953. * fixed (last?) remaining -tvarsym(X).address to
  954. tg.direction*tvarsym(X).address...
  955. Revision 1.57 2003/05/11 21:37:03 peter
  956. * moved implicit exception frame from ncgutil to psub
  957. * constructor/destructor helpers moved from cobj/ncgutil to psub
  958. Revision 1.56 2003/05/11 14:45:12 peter
  959. * tloadnode does not support objectsymtable,withsymtable anymore
  960. * withnode cleanup
  961. * direct with rewritten to use temprefnode
  962. Revision 1.55 2003/04/29 07:29:14 michael
  963. + Patch from peter to fix wrong pushing of ansistring function results in open array
  964. Revision 1.54 2003/04/27 11:21:33 peter
  965. * aktprocdef renamed to current_procinfo.procdef
  966. * procinfo renamed to current_procinfo
  967. * procinfo will now be stored in current_module so it can be
  968. cleaned up properly
  969. * gen_main_procsym changed to create_main_proc and release_main_proc
  970. to also generate a tprocinfo structure
  971. * fixed unit implicit initfinal
  972. Revision 1.53 2003/04/27 07:29:50 peter
  973. * current_procinfo.procdef cleanup, current_procdef is now always nil when parsing
  974. a new procdef declaration
  975. * aktprocsym removed
  976. * lexlevel removed, use symtable.symtablelevel instead
  977. * implicit init/final code uses the normal genentry/genexit
  978. * funcret state checking updated for new funcret handling
  979. Revision 1.52 2003/04/25 20:59:33 peter
  980. * removed funcretn,funcretsym, function result is now in varsym
  981. and aliases for result and function name are added using absolutesym
  982. * vs_hidden parameter for funcret passed in parameter
  983. * vs_hidden fixes
  984. * writenode changed to printnode and released from extdebug
  985. * -vp option added to generate a tree.log with the nodetree
  986. * nicer printnode for statements, callnode
  987. Revision 1.51 2003/04/23 20:16:04 peter
  988. + added currency support based on int64
  989. + is_64bit for use in cg units instead of is_64bitint
  990. * removed cgmessage from n386add, replace with internalerrors
  991. Revision 1.50 2003/04/23 10:12:14 peter
  992. * allow multi pass2 changed to global boolean instead of node flag
  993. Revision 1.49 2003/04/22 23:50:22 peter
  994. * firstpass uses expectloc
  995. * checks if there are differences between the expectloc and
  996. location.loc from secondpass in EXTDEBUG
  997. Revision 1.48 2003/04/22 10:09:35 daniel
  998. + Implemented the actual register allocator
  999. + Scratch registers unavailable when new register allocator used
  1000. + maybe_save/maybe_restore unavailable when new register allocator used
  1001. Revision 1.47 2003/04/06 21:11:23 olle
  1002. * changed newasmsymbol to newasmsymboldata for data symbols
  1003. Revision 1.46 2003/03/28 19:16:56 peter
  1004. * generic constructor working for i386
  1005. * remove fixed self register
  1006. * esi added as address register for i386
  1007. Revision 1.45 2003/02/19 22:00:14 daniel
  1008. * Code generator converted to new register notation
  1009. - Horribily outdated todo.txt removed
  1010. Revision 1.44 2003/01/08 18:43:56 daniel
  1011. * Tregister changed into a record
  1012. Revision 1.43 2003/01/05 22:44:14 peter
  1013. * remove a lot of code to support typen in loadn-procsym
  1014. Revision 1.42 2002/12/20 18:13:46 peter
  1015. * fixes for fpu values in arrayconstructor
  1016. Revision 1.41 2002/11/27 20:04:39 peter
  1017. * cdecl array of const fixes
  1018. Revision 1.40 2002/11/25 17:43:18 peter
  1019. * splitted defbase in defutil,symutil,defcmp
  1020. * merged isconvertable and is_equal into compare_defs(_ext)
  1021. * made operator search faster by walking the list only once
  1022. Revision 1.39 2002/11/22 16:22:45 jonas
  1023. * fixed error in my previous commit (the size of the location of the
  1024. funcretnode must be based on the current resulttype of the node and not
  1025. the resulttype defined by the function; these can be different in case
  1026. of "absolute" declarations)
  1027. Revision 1.38 2002/11/18 17:31:54 peter
  1028. * pass proccalloption to ret_in_xxx and push_xxx functions
  1029. Revision 1.37 2002/11/15 21:16:39 jonas
  1030. * proper fix for tw2110, also fixes tb0416 (funcretnode of parent
  1031. function was handled wrong inside nested functions/procedures)
  1032. Revision 1.36 2002/11/15 01:58:51 peter
  1033. * merged changes from 1.0.7 up to 04-11
  1034. - -V option for generating bug report tracing
  1035. - more tracing for option parsing
  1036. - errors for cdecl and high()
  1037. - win32 import stabs
  1038. - win32 records<=8 are returned in eax:edx (turned off by default)
  1039. - heaptrc update
  1040. - more info for temp management in .s file with EXTDEBUG
  1041. Revision 1.35 2002/10/14 19:44:13 peter
  1042. * (hacked) new threadvar relocate code
  1043. Revision 1.34 2002/10/13 11:22:06 florian
  1044. * fixed threadvars
  1045. Revision 1.33 2002/10/03 21:32:02 carl
  1046. * bugfix for 2110 (without -Or), wrong checking was done in returntype
  1047. Revision 1.32 2002/09/30 07:00:46 florian
  1048. * fixes to common code to get the alpha compiler compiled applied
  1049. Revision 1.31 2002/09/26 15:02:05 florian
  1050. + support of passing variants to "array of const"
  1051. Revision 1.30 2002/09/17 18:54:02 jonas
  1052. * a_load_reg_reg() now has two size parameters: source and dest. This
  1053. allows some optimizations on architectures that don't encode the
  1054. register size in the register name.
  1055. Revision 1.29 2002/09/07 15:25:03 peter
  1056. * old logs removed and tabs fixed
  1057. Revision 1.28 2002/09/01 19:26:32 peter
  1058. * fixed register variable loading from parasymtable, the call by
  1059. reference code was moved wrong
  1060. Revision 1.27 2002/09/01 12:15:40 peter
  1061. * fixed loading of procvar of object when the object is initialized
  1062. with 0
  1063. Revision 1.26 2002/08/25 19:25:18 peter
  1064. * sym.insert_in_data removed
  1065. * symtable.insertvardata/insertconstdata added
  1066. * removed insert_in_data call from symtable.insert, it needs to be
  1067. called separatly. This allows to deref the address calculation
  1068. * procedures now calculate the parast addresses after the procedure
  1069. directives are parsed. This fixes the cdecl parast problem
  1070. * push_addr_param has an extra argument that specifies if cdecl is used
  1071. or not
  1072. Revision 1.25 2002/08/23 16:14:48 peter
  1073. * tempgen cleanup
  1074. * tt_noreuse temp type added that will be used in genentrycode
  1075. Revision 1.24 2002/08/17 09:23:35 florian
  1076. * first part of procinfo rewrite
  1077. Revision 1.23 2002/08/14 18:13:28 jonas
  1078. * adapted previous fix to Peter's asmsymbol patch
  1079. Revision 1.22 2002/08/14 18:00:42 jonas
  1080. * fixed tb0403
  1081. Revision 1.21 2002/08/13 21:40:56 florian
  1082. * more fixes for ppc calling conventions
  1083. Revision 1.20 2002/08/11 14:32:26 peter
  1084. * renamed current_library to objectlibrary
  1085. Revision 1.19 2002/08/11 13:24:12 peter
  1086. * saving of asmsymbols in ppu supported
  1087. * asmsymbollist global is removed and moved into a new class
  1088. tasmlibrarydata that will hold the info of a .a file which
  1089. corresponds with a single module. Added librarydata to tmodule
  1090. to keep the library info stored for the module. In the future the
  1091. objectfiles will also be stored to the tasmlibrarydata class
  1092. * all getlabel/newasmsymbol and friends are moved to the new class
  1093. Revision 1.18 2002/08/06 20:55:21 florian
  1094. * first part of ppc calling conventions fix
  1095. Revision 1.17 2002/07/28 09:25:37 carl
  1096. + correct size of parameter (64-bit portability)
  1097. Revision 1.16 2002/07/27 19:53:51 jonas
  1098. + generic implementation of tcg.g_flags2ref()
  1099. * tcg.flags2xxx() now also needs a size parameter
  1100. Revision 1.15 2002/07/20 11:57:54 florian
  1101. * types.pas renamed to defbase.pas because D6 contains a types
  1102. unit so this would conflicts if D6 programms are compiled
  1103. + Willamette/SSE2 instructions to assembler added
  1104. Revision 1.14 2002/07/16 09:17:44 florian
  1105. * threadvar relocation result wasn't handled properly, it could cause
  1106. a crash
  1107. Revision 1.13 2002/07/11 14:41:28 florian
  1108. * start of the new generic parameter handling
  1109. Revision 1.12 2002/07/07 09:52:32 florian
  1110. * powerpc target fixed, very simple units can be compiled
  1111. * some basic stuff for better callparanode handling, far from being finished
  1112. Revision 1.11 2002/07/01 18:46:23 peter
  1113. * internal linker
  1114. * reorganized aasm layer
  1115. Revision 1.10 2002/07/01 16:23:53 peter
  1116. * cg64 patch
  1117. * basics for currency
  1118. * asnode updates for class and interface (not finished)
  1119. Revision 1.9 2002/05/20 13:30:40 carl
  1120. * bugfix of hdisponen (base must be set, not index)
  1121. * more portability fixes
  1122. }