ncgcal.pas 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Generate assembler for call nodes
  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. unit ncgcal;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. cpubase,
  23. globtype,
  24. symdef,node,ncal;
  25. type
  26. tcgcallparanode = class(tcallparanode)
  27. private
  28. tempparaloc : tparalocation;
  29. procedure allocate_tempparaloc;
  30. procedure push_addr_para;
  31. procedure push_value_para;
  32. public
  33. procedure secondcallparan;override;
  34. end;
  35. tcgcallnode = class(tcallnode)
  36. private
  37. procedure release_para_temps;
  38. procedure normal_pass_2;
  39. procedure inlined_pass_2;
  40. protected
  41. { save the size of pushed parameter, needed po_clearstack
  42. and alignment }
  43. pushedparasize : longint;
  44. framepointer_paraloc : tparalocation;
  45. refcountedtemp : treference;
  46. procedure handle_return_value;
  47. {# This routine is used to push the current frame pointer
  48. on the stack. This is used in nested routines where the
  49. value of the frame pointer is always pushed as an extra
  50. parameter.
  51. The default handling is the standard handling used on
  52. most stack based machines, where the frame pointer is
  53. the first invisible parameter.
  54. }
  55. function align_parasize:longint;virtual;
  56. procedure pop_parasize(pop_size:longint);virtual;
  57. procedure extra_interrupt_code;virtual;
  58. public
  59. procedure pass_2;override;
  60. end;
  61. implementation
  62. uses
  63. systems,
  64. cutils,verbose,globals,
  65. symconst,symsym,symtable,defutil,paramgr,
  66. {$ifdef GDB}
  67. {$ifdef delphi}
  68. sysutils,
  69. {$else}
  70. strings,
  71. {$endif}
  72. gdb,
  73. {$endif GDB}
  74. cgbase,pass_2,
  75. cpuinfo,aasmbase,aasmtai,
  76. nbas,nmem,nld,ncnv,
  77. {$ifdef x86}
  78. cga,cgx86,
  79. {$endif x86}
  80. ncgutil,cgobj,tgobj,
  81. procinfo;
  82. {*****************************************************************************
  83. TCGCALLPARANODE
  84. *****************************************************************************}
  85. procedure tcgcallparanode.allocate_tempparaloc;
  86. begin
  87. { Allocate (temporary) paralocation }
  88. tempparaloc:=paraitem.paraloc[callerside];
  89. if (tempparaloc.loc in [LOC_REGISTER,LOC_FPUREGISTER,LOC_MMREGISTER]) then
  90. paramanager.alloctempregs(exprasmlist,tempparaloc)
  91. end;
  92. procedure tcgcallparanode.push_addr_para;
  93. begin
  94. if not(left.location.loc in [LOC_CREFERENCE,LOC_REFERENCE]) then
  95. internalerror(200304235);
  96. location_release(exprasmlist,left.location);
  97. allocate_tempparaloc;
  98. cg.a_paramaddr_ref(exprasmlist,left.location.reference,tempparaloc);
  99. inc(tcgcallnode(aktcallnode).pushedparasize,POINTER_SIZE);
  100. end;
  101. procedure tcgcallparanode.push_value_para;
  102. var
  103. href : treference;
  104. size : longint;
  105. cgsize : tcgsize;
  106. begin
  107. { we've nothing to push when the size of the parameter is 0 }
  108. if left.resulttype.def.size=0 then
  109. exit;
  110. { Move flags and jump in register to make it less complex }
  111. if left.location.loc in [LOC_FLAGS,LOC_JUMP] then
  112. location_force_reg(exprasmlist,left.location,def_cgsize(left.resulttype.def),false);
  113. { Handle Floating point types differently }
  114. if left.resulttype.def.deftype=floatdef then
  115. begin
  116. location_release(exprasmlist,left.location);
  117. allocate_tempparaloc;
  118. {$ifdef i386}
  119. if tempparaloc.loc<>LOC_REFERENCE then
  120. internalerror(200309291);
  121. case left.location.loc of
  122. LOC_FPUREGISTER,
  123. LOC_CFPUREGISTER:
  124. begin
  125. size:=align(tfloatdef(left.resulttype.def).size,tempparaloc.alignment);
  126. inc(tcgcallnode(aktcallnode).pushedparasize,size);
  127. if tempparaloc.reference.index=NR_STACK_POINTER_REG then
  128. begin
  129. cg.g_stackpointer_alloc(exprasmlist,size);
  130. reference_reset_base(href,NR_STACK_POINTER_REG,0);
  131. end
  132. else
  133. reference_reset_base(href,tempparaloc.reference.index,tempparaloc.reference.offset);
  134. cg.a_loadfpu_reg_ref(exprasmlist,def_cgsize(left.resulttype.def),left.location.register,href);
  135. end;
  136. LOC_REFERENCE,
  137. LOC_CREFERENCE :
  138. begin
  139. size:=align(left.resulttype.def.size,tempparaloc.alignment);
  140. if tempparaloc.reference.index=NR_STACK_POINTER_REG then
  141. begin
  142. href:=left.location.reference;
  143. inc(href.offset,size);
  144. while (size>0) do
  145. begin
  146. if (size>=4) or (tempparaloc.alignment>=4) then
  147. begin
  148. cgsize:=OS_32;
  149. inc(tcgcallnode(aktcallnode).pushedparasize,4);
  150. dec(href.offset,4);
  151. dec(size,4);
  152. end
  153. else
  154. begin
  155. cgsize:=OS_16;
  156. inc(tcgcallnode(aktcallnode).pushedparasize,2);
  157. dec(href.offset,2);
  158. dec(size,2);
  159. end;
  160. cg.a_param_ref(exprasmlist,cgsize,href,tempparaloc);
  161. end;
  162. end
  163. else
  164. begin
  165. reference_reset_base(href,tempparaloc.reference.index,tempparaloc.reference.offset);
  166. cg.g_concatcopy(exprasmlist,left.location.reference,href,size,false,false);
  167. inc(tcgcallnode(aktcallnode).pushedparasize,size);
  168. end;
  169. end;
  170. else
  171. internalerror(200204243);
  172. end;
  173. {$else i386}
  174. case left.location.loc of
  175. LOC_FPUREGISTER,
  176. LOC_CFPUREGISTER:
  177. cg.a_paramfpu_reg(exprasmlist,def_cgsize(left.resulttype.def),left.location.register,tempparaloc);
  178. LOC_REFERENCE,
  179. LOC_CREFERENCE :
  180. cg.a_paramfpu_ref(exprasmlist,def_cgsize(left.resulttype.def),left.location.reference,tempparaloc);
  181. else
  182. internalerror(200204243);
  183. end;
  184. {$endif i386}
  185. end
  186. else
  187. begin
  188. { copy the value on the stack or use normal parameter push?
  189. Check for varargs first because that has no paraitem }
  190. if not(nf_varargs_para in flags) and
  191. paramanager.copy_value_on_stack(paraitem.paratyp,left.resulttype.def,
  192. aktcallnode.procdefinition.proccalloption) then
  193. begin
  194. location_release(exprasmlist,left.location);
  195. allocate_tempparaloc;
  196. {$ifdef i386}
  197. if tempparaloc.loc<>LOC_REFERENCE then
  198. internalerror(200309292);
  199. if not (left.location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
  200. internalerror(200204241);
  201. { push on stack }
  202. size:=align(left.resulttype.def.size,tempparaloc.alignment);
  203. inc(tcgcallnode(aktcallnode).pushedparasize,size);
  204. if tempparaloc.reference.index=NR_STACK_POINTER_REG then
  205. begin
  206. cg.g_stackpointer_alloc(exprasmlist,size);
  207. reference_reset_base(href,NR_STACK_POINTER_REG,0);
  208. end
  209. else
  210. reference_reset_base(href,tempparaloc.reference.index,tempparaloc.reference.offset);
  211. cg.g_concatcopy(exprasmlist,left.location.reference,href,size,false,false);
  212. {$else i386}
  213. cg.a_param_copy_ref(exprasmlist,left.resulttype.def.size,left.location.reference,tempparaloc);
  214. {$endif i386}
  215. end
  216. else
  217. begin
  218. case left.location.loc of
  219. LOC_CONSTANT,
  220. LOC_REGISTER,
  221. LOC_CREGISTER,
  222. LOC_REFERENCE,
  223. LOC_CREFERENCE :
  224. begin
  225. cgsize:=def_cgsize(left.resulttype.def);
  226. if cgsize in [OS_64,OS_S64] then
  227. begin
  228. inc(tcgcallnode(aktcallnode).pushedparasize,8);
  229. allocate_tempparaloc;
  230. cg64.a_param64_loc(exprasmlist,left.location,tempparaloc);
  231. location_release(exprasmlist,left.location);
  232. end
  233. else
  234. begin
  235. location_release(exprasmlist,left.location);
  236. allocate_tempparaloc;
  237. inc(tcgcallnode(aktcallnode).pushedparasize,align(tcgsize2size[tempparaloc.size],tempparaloc.alignment));
  238. cg.a_param_loc(exprasmlist,left.location,tempparaloc);
  239. end;
  240. end;
  241. {$ifdef SUPPORT_MMX}
  242. LOC_MMXREGISTER,
  243. LOC_CMMXREGISTER:
  244. begin
  245. location_release(exprasmlist,left.location);
  246. allocate_tempparaloc;
  247. inc(tcgcallnode(aktcallnode).pushedparasize,8);
  248. cg.a_parammm_reg(exprasmlist,left.location.register);
  249. end;
  250. {$endif SUPPORT_MMX}
  251. else
  252. internalerror(200204241);
  253. end;
  254. end;
  255. end;
  256. end;
  257. procedure tcgcallparanode.secondcallparan;
  258. var
  259. otlabel,
  260. oflabel : tasmlabel;
  261. begin
  262. if not(assigned(paraitem)) or
  263. not(assigned(paraitem.paratype.def)) or
  264. not(assigned(paraitem.parasym) or
  265. (nf_varargs_para in flags)) then
  266. internalerror(200304242);
  267. { Skip nothingn nodes which are used after disabling
  268. a parameter }
  269. if (left.nodetype<>nothingn) then
  270. begin
  271. otlabel:=truelabel;
  272. oflabel:=falselabel;
  273. objectlibrary.getlabel(truelabel);
  274. objectlibrary.getlabel(falselabel);
  275. secondpass(left);
  276. { handle varargs first, because paraitem.parasym is not valid }
  277. if (nf_varargs_para in flags) then
  278. begin
  279. if paramanager.push_addr_param(vs_value,left.resulttype.def,
  280. aktcallnode.procdefinition.proccalloption) then
  281. push_addr_para
  282. else
  283. push_value_para;
  284. end
  285. { hidden parameters }
  286. else if paraitem.is_hidden then
  287. begin
  288. { don't push a node that already generated a pointer type
  289. by address for implicit hidden parameters }
  290. if (vo_is_funcret in tvarsym(paraitem.parasym).varoptions) or
  291. (not(left.resulttype.def.deftype in [pointerdef,classrefdef]) and
  292. paramanager.push_addr_param(paraitem.paratyp,paraitem.paratype.def,
  293. aktcallnode.procdefinition.proccalloption)) then
  294. push_addr_para
  295. else
  296. push_value_para;
  297. end
  298. { formal def }
  299. else if (paraitem.paratype.def.deftype=formaldef) then
  300. begin
  301. { allow passing of a constant to a const formaldef }
  302. if (tvarsym(paraitem.parasym).varspez=vs_const) and
  303. (left.location.loc=LOC_CONSTANT) then
  304. location_force_mem(exprasmlist,left.location);
  305. { allow @var }
  306. if (left.nodetype=addrn) and
  307. (not(nf_procvarload in left.flags)) then
  308. begin
  309. inc(tcgcallnode(aktcallnode).pushedparasize,POINTER_SIZE);
  310. location_release(exprasmlist,left.location);
  311. allocate_tempparaloc;
  312. cg.a_param_loc(exprasmlist,left.location,tempparaloc);
  313. end
  314. else
  315. push_addr_para;
  316. end
  317. { Normal parameter }
  318. else
  319. begin
  320. { don't push a node that already generated a pointer type
  321. by address for implicit hidden parameters }
  322. if (not(
  323. paraitem.is_hidden and
  324. (left.resulttype.def.deftype in [pointerdef,classrefdef])
  325. ) and
  326. paramanager.push_addr_param(paraitem.paratyp,paraitem.paratype.def,
  327. aktcallnode.procdefinition.proccalloption)) then
  328. begin
  329. { Check for passing a constant to var,out parameter }
  330. if (paraitem.paratyp in [vs_var,vs_out]) and
  331. (left.location.loc<>LOC_REFERENCE) then
  332. begin
  333. { passing self to a var parameter is allowed in
  334. TP and delphi }
  335. if not((left.location.loc=LOC_CREFERENCE) and
  336. is_self_node(left)) then
  337. internalerror(200106041);
  338. end;
  339. { Force to be in memory }
  340. if not(left.location.loc in [LOC_CREFERENCE,LOC_REFERENCE]) then
  341. location_force_mem(exprasmlist,left.location);
  342. push_addr_para;
  343. end
  344. else
  345. push_value_para;
  346. end;
  347. truelabel:=otlabel;
  348. falselabel:=oflabel;
  349. { update return location in callnode when this is the function
  350. result }
  351. if assigned(paraitem.parasym) and
  352. (vo_is_funcret in tvarsym(paraitem.parasym).varoptions) then
  353. location_copy(aktcallnode.location,left.location);
  354. end;
  355. { next parameter }
  356. if assigned(right) then
  357. tcallparanode(right).secondcallparan;
  358. end;
  359. {*****************************************************************************
  360. TCGCALLNODE
  361. *****************************************************************************}
  362. procedure tcgcallnode.extra_interrupt_code;
  363. begin
  364. end;
  365. function tcgcallnode.align_parasize:longint;
  366. begin
  367. result:=0;
  368. end;
  369. procedure tcgcallnode.pop_parasize(pop_size:longint);
  370. begin
  371. end;
  372. procedure tcgcallnode.handle_return_value;
  373. var
  374. cgsize : tcgsize;
  375. hregister : tregister;
  376. tempnode: tnode;
  377. begin
  378. { structured results are easy to handle.... }
  379. { needed also when result_no_used !! }
  380. if paramanager.ret_in_param(resulttype.def,procdefinition.proccalloption) then
  381. begin
  382. { Location should be setup by the funcret para }
  383. if location.loc<>LOC_REFERENCE then
  384. internalerror(200304241);
  385. end
  386. else
  387. { ansi/widestrings must be registered, so we can dispose them }
  388. if resulttype.def.needs_inittable then
  389. begin
  390. { the FUNCTION_RESULT_REG is already allocated }
  391. cg.ungetregister(exprasmlist,NR_FUNCTION_RESULT_REG);
  392. if not assigned(funcretnode) then
  393. begin
  394. location_reset(location,LOC_CREFERENCE,OS_ADDR);
  395. location.reference:=refcountedtemp;
  396. cg.a_load_reg_ref(exprasmlist,OS_ADDR,OS_ADDR,NR_FUNCTION_RESULT_REG,location.reference);
  397. end
  398. else
  399. begin
  400. hregister := cg.getaddressregister(exprasmlist);
  401. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,NR_FUNCTION_RESULT_REG,hregister);
  402. { in case of a regular funcretnode with ret_in_param, the }
  403. { original funcretnode isn't touched -> make sure it's }
  404. { the same here (not sure if it's necessary) }
  405. tempnode := funcretnode.getcopy;
  406. tempnode.pass_2;
  407. location := tempnode.location;
  408. tempnode.free;
  409. cg.g_decrrefcount(exprasmlist,resulttype.def,location.reference, false);
  410. cg.a_load_reg_ref(exprasmlist,OS_ADDR,OS_ADDR,hregister,location.reference);
  411. cg.ungetregister(exprasmlist,hregister);
  412. end;
  413. end
  414. else
  415. { we have only to handle the result if it is used }
  416. if (nf_return_value_used in flags) then
  417. begin
  418. if (resulttype.def.deftype=floatdef) then
  419. begin
  420. location_reset(location,LOC_FPUREGISTER,def_cgsize(resulttype.def));
  421. {$ifdef cpufpemu}
  422. if cs_fp_emulation in aktmoduleswitches then
  423. location.register:=NR_FUNCTION_RESULT_REG
  424. else
  425. {$endif cpufpemu}
  426. location.register:=NR_FPU_RESULT_REG;
  427. {$ifdef x86}
  428. tcgx86(cg).inc_fpu_stack;
  429. {$else x86}
  430. cg.ungetregister(exprasmlist,location.register);
  431. hregister := cg.getfpuregister(exprasmlist,location.size);
  432. cg.a_loadfpu_reg_reg(exprasmlist,location.size,location.register,hregister);
  433. location.register := hregister;
  434. {$endif x86}
  435. end
  436. else
  437. begin
  438. cgsize:=def_cgsize(resulttype.def);
  439. if cgsize<>OS_NO then
  440. begin
  441. location_reset(location,LOC_REGISTER,cgsize);
  442. {$ifndef cpu64bit}
  443. if cgsize in [OS_64,OS_S64] then
  444. begin
  445. { Move the function result to free registers, preferably the
  446. FUNCTION_RESULT_REG/FUNCTION_RESULTHIGH_REG, so no move is necessary.}
  447. { the FUNCTION_RESULT_LOW_REG/FUNCTION_RESULT_HIGH_REG
  448. are already allocated }
  449. cg.ungetregister(exprasmlist,NR_FUNCTION_RESULT64_LOW_REG);
  450. location.registerlow:=cg.getintregister(exprasmlist,OS_INT);
  451. cg.a_load_reg_reg(exprasmlist,OS_32,OS_32,NR_FUNCTION_RESULT64_LOW_REG,location.registerlow);
  452. cg.ungetregister(exprasmlist,NR_FUNCTION_RESULT64_HIGH_REG);
  453. location.registerhigh:=cg.getintregister(exprasmlist,OS_INT);
  454. cg.a_load_reg_reg(exprasmlist,OS_32,OS_32,NR_FUNCTION_RESULT64_HIGH_REG,location.registerhigh);
  455. end
  456. else
  457. {$endif cpu64bit}
  458. begin
  459. {Move the function result to a free register, preferably the
  460. FUNCTION_RESULT_REG, so no move is necessary.}
  461. { the FUNCTION_RESULT_REG is already allocated }
  462. cg.ungetregister(exprasmlist,NR_FUNCTION_RESULT_REG);
  463. { change register size after the unget because the
  464. getregister was done for the full register }
  465. location.register:=cg.getintregister(exprasmlist,cgsize);
  466. cg.a_load_reg_reg(exprasmlist,cgsize,cgsize,cg.makeregsize(NR_FUNCTION_RESULT_REG,cgsize),location.register);
  467. end;
  468. end
  469. else
  470. begin
  471. if resulttype.def.size>0 then
  472. internalerror(200305131);
  473. end;
  474. end;
  475. end
  476. else
  477. begin
  478. cgsize:=def_cgsize(resulttype.def);
  479. { an object constructor is a function with pointer result }
  480. if (procdefinition.proctypeoption=potype_constructor) then
  481. cgsize:=OS_ADDR;
  482. if cgsize<>OS_NO then
  483. {$ifndef cpu64bit}
  484. if cgsize in [OS_64,OS_S64] then
  485. begin
  486. cg.ungetregister(exprasmlist,NR_FUNCTION_RESULT64_LOW_REG);
  487. cg.ungetregister(exprasmlist,NR_FUNCTION_RESULT64_HIGH_REG);
  488. end
  489. else
  490. {$endif cpu64bit}
  491. cg.ungetregister(exprasmlist,NR_FUNCTION_RESULT_REG);
  492. location_reset(location,LOC_VOID,OS_NO);
  493. end;
  494. end;
  495. procedure tcgcallnode.release_para_temps;
  496. var
  497. hp : tnode;
  498. ppn : tcallparanode;
  499. begin
  500. { Release temps from parameters }
  501. ppn:=tcallparanode(left);
  502. while assigned(ppn) do
  503. begin
  504. if assigned(ppn.left) then
  505. begin
  506. { don't release the funcret temp }
  507. if not(assigned(ppn.paraitem.parasym)) or
  508. not(vo_is_funcret in tvarsym(ppn.paraitem.parasym).varoptions) then
  509. location_freetemp(exprasmlist,ppn.left.location);
  510. { process also all nodes of an array of const }
  511. if ppn.left.nodetype=arrayconstructorn then
  512. begin
  513. if assigned(tarrayconstructornode(ppn.left).left) then
  514. begin
  515. hp:=ppn.left;
  516. while assigned(hp) do
  517. begin
  518. location_freetemp(exprasmlist,tarrayconstructornode(hp).left.location);
  519. hp:=tarrayconstructornode(hp).right;
  520. end;
  521. end;
  522. end;
  523. end;
  524. ppn:=tcallparanode(ppn.right);
  525. end;
  526. end;
  527. procedure tcgcallnode.normal_pass_2;
  528. var
  529. regs_to_push_fpu,
  530. regs_to_alloc,
  531. regs_to_free : Tcpuregisterset;
  532. oldpushedparasize : longint;
  533. { adress returned from an I/O-error }
  534. { help reference pointer }
  535. href : treference;
  536. pop_size : longint;
  537. pvreg,
  538. vmtreg : tregister;
  539. oldaktcallnode : tcallnode;
  540. procedure pushparas;
  541. var
  542. ppn : tcgcallparanode;
  543. begin
  544. { copy all resources to the allocated registers }
  545. ppn:=tcgcallparanode(left);
  546. while assigned(ppn) do
  547. begin
  548. case ppn.tempparaloc.loc of
  549. LOC_REGISTER:
  550. begin
  551. paramanager.freeparaloc(exprasmlist,ppn.tempparaloc);
  552. paramanager.allocparaloc(exprasmlist,ppn.paraitem.paraloc[callerside]);
  553. {$ifdef sparc}
  554. case ppn.tempparaloc.size of
  555. OS_F32 :
  556. ppn.tempparaloc.size:=OS_32;
  557. OS_F64 :
  558. ppn.tempparaloc.size:=OS_64;
  559. end;
  560. {$endif sparc}
  561. {$ifndef cpu64bit}
  562. if ppn.tempparaloc.size in [OS_64,OS_S64] then
  563. begin
  564. cg.a_load_reg_reg(exprasmlist,OS_32,OS_32,ppn.tempparaloc.registerlow,
  565. ppn.paraitem.paraloc[callerside].registerlow);
  566. cg.a_load_reg_reg(exprasmlist,OS_32,OS_32,ppn.tempparaloc.registerhigh,
  567. ppn.paraitem.paraloc[callerside].registerhigh);
  568. end
  569. else
  570. {$endif cpu64bit}
  571. cg.a_load_reg_reg(exprasmlist,ppn.tempparaloc.size,ppn.tempparaloc.size,
  572. ppn.tempparaloc.register,ppn.paraitem.paraloc[callerside].register);
  573. end;
  574. LOC_FPUREGISTER:
  575. begin
  576. paramanager.freeparaloc(exprasmlist,ppn.tempparaloc);
  577. paramanager.allocparaloc(exprasmlist,ppn.paraitem.paraloc[callerside]);
  578. cg.a_loadfpu_reg_reg(exprasmlist,ppn.tempparaloc.size,
  579. ppn.tempparaloc.register,ppn.paraitem.paraloc[callerside].register);
  580. end;
  581. LOC_MMREGISTER:
  582. begin
  583. {
  584. paramanager.freeparaloc(exprasmlist,ppn.tempparaloc);
  585. paramanager.allocparaloc(exprasmlist,ppn.paraitem.paraloc[callerside]);
  586. paramanager.freeparaloc(exprasmlist,ppn.tempparaloc);
  587. paramanager.allocparaloc(exprasmlist,ppn.paraitem.paraloc[callerside]);
  588. cg.a_loadmm_reg_reg(exprasmlist,ppn.tempparaloc.size,
  589. ppn.tempparaloc.size,ppn.tempparaloc.register,ppn.paraitem.paraloc[callerside].register, shuffle???);
  590. }
  591. internalerror(2003102910);
  592. end;
  593. end;
  594. ppn:=tcgcallparanode(ppn.right);
  595. end;
  596. end;
  597. procedure freeparas;
  598. var
  599. ppn : tcgcallparanode;
  600. begin
  601. { free the resources allocated for the parameters }
  602. ppn:=tcgcallparanode(left);
  603. while assigned(ppn) do
  604. begin
  605. paramanager.freeparaloc(exprasmlist,ppn.paraitem.paraloc[callerside]);
  606. ppn:=tcgcallparanode(ppn.right);
  607. end;
  608. end;
  609. begin
  610. if not assigned(procdefinition) or
  611. not procdefinition.has_paraloc_info then
  612. internalerror(200305264);
  613. if resulttype.def.needs_inittable and
  614. not paramanager.ret_in_param(resulttype.def,procdefinition.proccalloption) and
  615. not assigned(funcretnode) then
  616. begin
  617. tg.gettemptyped(exprasmlist,resulttype.def,tt_normal,refcountedtemp);
  618. cg.g_decrrefcount(exprasmlist,resulttype.def,refcountedtemp,false);
  619. end;
  620. regs_to_alloc:=paramanager.get_volatile_registers_int(procdefinition.proccalloption);
  621. regs_to_push_fpu:=paramanager.get_volatile_registers_fpu(procdefinition.proccalloption);
  622. { Include Function result registers }
  623. if (not is_void(resulttype.def)) then
  624. begin
  625. case procdefinition.funcret_paraloc[callerside].loc of
  626. LOC_REGISTER,LOC_CREGISTER:
  627. begin
  628. {$ifndef cpu64bit}
  629. if procdefinition.funcret_paraloc[callerside].size in [OS_S64,OS_64] then
  630. begin
  631. include(regs_to_alloc,getsupreg(procdefinition.funcret_paraloc[callerside].registerlow));
  632. include(regs_to_alloc,getsupreg(procdefinition.funcret_paraloc[callerside].registerhigh));
  633. end
  634. else
  635. {$endif cpu64bit}
  636. include(regs_to_alloc,getsupreg(procdefinition.funcret_paraloc[callerside].register));
  637. end;
  638. LOC_FPUREGISTER,LOC_CFPUREGISTER:
  639. begin
  640. include(regs_to_push_fpu,getsupreg(procdefinition.funcret_paraloc[callerside].register));
  641. end;
  642. LOC_MMREGISTER,LOC_CMMREGISTER:
  643. begin
  644. internalerror(2003102911);
  645. end;
  646. end;
  647. end;
  648. { Initialize for pushing the parameters }
  649. oldpushedparasize:=pushedparasize;
  650. pushedparasize:=0;
  651. { Process parameters, register parameters will be loaded
  652. in imaginary registers. The actual load to the correct
  653. register is done just before the call }
  654. oldaktcallnode:=aktcallnode;
  655. aktcallnode:=self;
  656. if assigned(left) then
  657. tcallparanode(left).secondcallparan;
  658. aktcallnode:=oldaktcallnode;
  659. { Align stack if required }
  660. pop_size:=align_parasize;
  661. { procedure variable or normal function call ? }
  662. if (right=nil) then
  663. begin
  664. if (po_virtualmethod in procdefinition.procoptions) and
  665. assigned(methodpointer) then
  666. begin
  667. secondpass(methodpointer);
  668. location_force_reg(exprasmlist,methodpointer.location,OS_ADDR,false);
  669. { virtual methods require an index }
  670. if tprocdef(procdefinition).extnumber=-1 then
  671. internalerror(200304021);
  672. { VMT should already be loaded in a register }
  673. if methodpointer.location.register=NR_NO then
  674. internalerror(200304022);
  675. { test validity of VMT }
  676. if not(is_interface(tprocdef(procdefinition)._class)) and
  677. not(is_cppclass(tprocdef(procdefinition)._class)) then
  678. cg.g_maybe_testvmt(exprasmlist,methodpointer.location.register,tprocdef(procdefinition)._class);
  679. end;
  680. {$warning fixme regvars}
  681. { rg.saveotherregvars(exprasmlist,regs_to_push_other);}
  682. if (po_virtualmethod in procdefinition.procoptions) and
  683. assigned(methodpointer) then
  684. begin
  685. vmtreg:=methodpointer.location.register;
  686. { release self }
  687. cg.ungetregister(exprasmlist,vmtreg);
  688. pvreg:=cg.getintregister(exprasmlist,OS_ADDR);
  689. reference_reset_base(href,vmtreg,
  690. tprocdef(procdefinition)._class.vmtmethodoffset(tprocdef(procdefinition).extnumber));
  691. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,href,pvreg);
  692. { Load parameters that are in temporary registers in the
  693. correct parameter register }
  694. if assigned(left) then
  695. pushparas;
  696. { free the resources allocated for the parameters }
  697. freeparas;
  698. { Release register containing procvar }
  699. cg.ungetregister(exprasmlist,pvreg);
  700. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,regs_to_alloc);
  701. cg.allocexplicitregisters(exprasmlist,R_FPUREGISTER,regs_to_push_fpu);
  702. cg.allocexplicitregisters(exprasmlist,R_SSEREGISTER,paramanager.get_volatile_registers_mm(procdefinition.proccalloption));
  703. { call method }
  704. cg.a_call_reg(exprasmlist,pvreg);
  705. end
  706. else
  707. begin
  708. { Load parameters that are in temporary registers in the
  709. correct parameter register }
  710. if assigned(left) then
  711. pushparas;
  712. { free the resources allocated for the parameters }
  713. freeparas;
  714. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,regs_to_alloc);
  715. cg.allocexplicitregisters(exprasmlist,R_FPUREGISTER,regs_to_push_fpu);
  716. cg.allocexplicitregisters(exprasmlist,R_SSEREGISTER,paramanager.get_volatile_registers_mm(procdefinition.proccalloption));
  717. { Calling interrupt from the same code requires some
  718. extra code }
  719. if (po_interrupt in procdefinition.procoptions) then
  720. extra_interrupt_code;
  721. cg.a_call_name(exprasmlist,tprocdef(procdefinition).mangledname);
  722. end;
  723. end
  724. else
  725. { now procedure variable case }
  726. begin
  727. secondpass(right);
  728. location_release(exprasmlist,right.location);
  729. pvreg:=cg.getintregister(exprasmlist,OS_ADDR);
  730. { Only load OS_ADDR from the reference }
  731. if right.location.loc in [LOC_REFERENCE,LOC_CREFERENCE] then
  732. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,right.location.reference,pvreg)
  733. else
  734. cg.a_load_loc_reg(exprasmlist,OS_ADDR,right.location,pvreg);
  735. location_freetemp(exprasmlist,right.location);
  736. { Load parameters that are in temporary registers in the
  737. correct parameter register }
  738. if assigned(left) then
  739. pushparas;
  740. { free the resources allocated for the parameters }
  741. freeparas;
  742. { Release register containing procvar }
  743. cg.ungetregister(exprasmlist,pvreg);
  744. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,regs_to_alloc);
  745. cg.allocexplicitregisters(exprasmlist,R_FPUREGISTER,regs_to_push_fpu);
  746. cg.allocexplicitregisters(exprasmlist,R_MMREGISTER,paramanager.get_volatile_registers_mm(procdefinition.proccalloption));
  747. { Calling interrupt from the same code requires some
  748. extra code }
  749. if (po_interrupt in procdefinition.procoptions) then
  750. extra_interrupt_code;
  751. {$warning fixme regvars.}
  752. { rg.saveotherregvars(exprasmlist,ALL_OTHERREGISTERS);}
  753. cg.a_call_reg(exprasmlist,pvreg);
  754. end;
  755. { Need to remove the parameters from the stack? }
  756. if (procdefinition.proccalloption in clearstack_pocalls) then
  757. begin
  758. { the old pop_size was already included in pushedparasize }
  759. pop_size:=pushedparasize;
  760. { for Cdecl functions we don't need to pop the funcret when it
  761. was pushed by para }
  762. if paramanager.ret_in_param(procdefinition.rettype.def,procdefinition.proccalloption) then
  763. dec(pop_size,POINTER_SIZE);
  764. end;
  765. { Remove parameters/alignment from the stack }
  766. if pop_size>0 then
  767. pop_parasize(pop_size);
  768. { Reserve space for storing parameters that will be pushed }
  769. current_procinfo.allocate_push_parasize(pushedparasize);
  770. { Restore }
  771. pushedparasize:=oldpushedparasize;
  772. { Release registers, but not the registers that contain the
  773. function result }
  774. regs_to_free:=regs_to_alloc;
  775. if (not is_void(resulttype.def)) then
  776. begin
  777. case procdefinition.funcret_paraloc[callerside].loc of
  778. LOC_REGISTER,LOC_CREGISTER:
  779. begin
  780. {$ifndef cpu64bit}
  781. if procdefinition.funcret_paraloc[callerside].size in [OS_S64,OS_64] then
  782. begin
  783. exclude(regs_to_free,getsupreg(procdefinition.funcret_paraloc[callerside].registerlow));
  784. exclude(regs_to_free,getsupreg(procdefinition.funcret_paraloc[callerside].registerhigh));
  785. end
  786. else
  787. {$endif cpu64bit}
  788. exclude(regs_to_free,getsupreg(procdefinition.funcret_paraloc[callerside].register));
  789. end;
  790. LOC_FPUREGISTER,LOC_CFPUREGISTER:
  791. begin
  792. exclude(regs_to_push_fpu,getsupreg(procdefinition.funcret_paraloc[callerside].register));
  793. end;
  794. end;
  795. end;
  796. cg.deallocexplicitregisters(exprasmlist,R_MMREGISTER,paramanager.get_volatile_registers_mm(procdefinition.proccalloption));
  797. cg.deallocexplicitregisters(exprasmlist,R_FPUREGISTER,regs_to_push_fpu);
  798. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,regs_to_free);
  799. { handle function results }
  800. if (not is_void(resulttype.def)) then
  801. handle_return_value
  802. else
  803. location_reset(location,LOC_VOID,OS_NO);
  804. { perhaps i/o check ? }
  805. if (cs_check_io in aktlocalswitches) and
  806. (po_iocheck in procdefinition.procoptions) and
  807. not(po_iocheck in current_procinfo.procdef.procoptions) and
  808. { no IO check for methods and procedure variables }
  809. (right=nil) and
  810. not(po_virtualmethod in procdefinition.procoptions) then
  811. begin
  812. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  813. cg.a_call_name(exprasmlist,'FPC_IOCHECK');
  814. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  815. end;
  816. { release temps of paras }
  817. release_para_temps;
  818. { if return value is not used }
  819. if (not(nf_return_value_used in flags)) and (not is_void(resulttype.def)) then
  820. begin
  821. if location.loc in [LOC_CREFERENCE,LOC_REFERENCE] then
  822. begin
  823. { data which must be finalized ? }
  824. if (resulttype.def.needs_inittable) then
  825. cg.g_finalize(exprasmlist,resulttype.def,location.reference,false);
  826. { release unused temp }
  827. tg.ungetiftemp(exprasmlist,location.reference)
  828. end
  829. else if location.loc=LOC_FPUREGISTER then
  830. begin
  831. {$ifdef x86}
  832. { release FPU stack }
  833. emit_reg(A_FSTP,S_NO,NR_FPU_RESULT_REG);
  834. {$endif x86}
  835. end;
  836. end;
  837. end;
  838. procedure tcgcallnode.inlined_pass_2;
  839. var
  840. oldaktcallnode : tcallnode;
  841. oldprocinfo : tprocinfo;
  842. oldinlining_procedure : boolean;
  843. inlineentrycode,inlineexitcode : TAAsmoutput;
  844. usesacc,usesacchi,usesfpu : boolean;
  845. {$ifdef GDB}
  846. startlabel,endlabel : tasmlabel;
  847. pp : pchar;
  848. mangled_length : longint;
  849. {$endif GDB}
  850. begin
  851. if not(assigned(procdefinition) and (procdefinition.deftype=procdef)) then
  852. internalerror(200305262);
  853. oldinlining_procedure:=inlining_procedure;
  854. oldprocinfo:=current_procinfo;
  855. { we're inlining a procedure }
  856. inlining_procedure:=true;
  857. { Add inling start }
  858. exprasmList.concat(Tai_Marker.Create(InlineStart));
  859. {$ifdef extdebug}
  860. exprasmList.concat(tai_comment.Create(strpnew('Start of inlined proc')));
  861. {$endif extdebug}
  862. { calculate registers to pass the parameters }
  863. paramanager.create_inline_paraloc_info(procdefinition);
  864. { Allocate parameters and locals }
  865. gen_alloc_inline_parast(exprasmlist,tparasymtable(procdefinition.parast));
  866. if tprocdef(procdefinition).localst.symtabletype=localsymtable then
  867. gen_alloc_localst(exprasmlist,tlocalsymtable(tprocdef(procdefinition).localst));
  868. { if we allocate the temp. location for ansi- or widestrings }
  869. { already here, we avoid later a push/pop }
  870. if resulttype.def.needs_inittable and
  871. not paramanager.ret_in_param(resulttype.def,procdefinition.proccalloption) then
  872. begin
  873. tg.gettemptyped(exprasmlist,resulttype.def,tt_normal,refcountedtemp);
  874. cg.g_decrrefcount(exprasmlist,resulttype.def,refcountedtemp,false);
  875. end;
  876. { Push parameters, still use the old current_procinfo. This
  877. is required that have the correct information available like
  878. _class and nested procedure }
  879. oldaktcallnode:=aktcallnode;
  880. aktcallnode:=self;
  881. if assigned(left) then
  882. tcallparanode(left).secondcallparan;
  883. aktcallnode:=oldaktcallnode;
  884. { create temp procinfo that will be used for the inlinecode tree }
  885. current_procinfo:=cprocinfo.create(nil);
  886. current_procinfo.procdef:=tprocdef(procdefinition);
  887. { when the oldprocinfo is also being inlined reuse the
  888. inlining_procinfo }
  889. if assigned(oldprocinfo.inlining_procinfo) then
  890. current_procinfo.inlining_procinfo:=oldprocinfo.inlining_procinfo
  891. else
  892. current_procinfo.inlining_procinfo:=oldprocinfo;
  893. { takes care of local data initialization }
  894. inlineentrycode:=TAAsmoutput.Create;
  895. inlineexitcode:=TAAsmoutput.Create;
  896. {$ifdef GDB}
  897. if (cs_debuginfo in aktmoduleswitches) then
  898. begin
  899. objectlibrary.getaddrlabel(startlabel);
  900. objectlibrary.getaddrlabel(endlabel);
  901. cg.a_label(exprasmlist,startlabel);
  902. { Here we must include the para and local symtable info }
  903. procdefinition.concatstabto(withdebuglist);
  904. mangled_length:=length(current_procinfo.inlining_procinfo.procdef.mangledname);
  905. getmem(pp,mangled_length+50);
  906. strpcopy(pp,'192,0,0,'+startlabel.name);
  907. if (target_info.use_function_relative_addresses) then
  908. begin
  909. strpcopy(strend(pp),'-');
  910. strpcopy(strend(pp),current_procinfo.inlining_procinfo.procdef.mangledname);
  911. end;
  912. withdebugList.concat(Tai_stabn.Create(strnew(pp)));
  913. end;
  914. {$endif GDB}
  915. gen_load_para_value(inlineentrycode);
  916. gen_initialize_code(inlineentrycode,true);
  917. if po_assembler in current_procinfo.procdef.procoptions then
  918. inlineentrycode.insert(Tai_marker.Create(asmblockstart));
  919. exprasmList.concatlist(inlineentrycode);
  920. { process the inline code }
  921. secondpass(inlinecode);
  922. gen_finalize_code(inlineexitcode,true);
  923. gen_load_return_value(inlineexitcode,usesacc,usesacchi,usesfpu);
  924. if po_assembler in current_procinfo.procdef.procoptions then
  925. inlineexitcode.concat(Tai_marker.Create(asmblockend));
  926. exprasmlist.concatlist(inlineexitcode);
  927. inlineentrycode.free;
  928. inlineexitcode.free;
  929. {$ifdef extdebug}
  930. exprasmList.concat(tai_comment.Create(strpnew('End of inlined proc')));
  931. {$endif extdebug}
  932. exprasmList.concat(Tai_Marker.Create(InlineEnd));
  933. { handle function results }
  934. if (not is_void(resulttype.def)) then
  935. handle_return_value
  936. else
  937. location_reset(location,LOC_VOID,OS_NO);
  938. { perhaps i/o check ? }
  939. if (cs_check_io in aktlocalswitches) and
  940. (po_iocheck in procdefinition.procoptions) and
  941. not(po_iocheck in current_procinfo.procdef.procoptions) and
  942. { no IO check for methods and procedure variables }
  943. (right=nil) and
  944. not(po_virtualmethod in procdefinition.procoptions) then
  945. begin
  946. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  947. cg.a_call_name(exprasmlist,'FPC_IOCHECK');
  948. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  949. end;
  950. { release temps of paras }
  951. release_para_temps;
  952. { if return value is not used }
  953. if (not is_void(resulttype.def)) and
  954. (not(nf_return_value_used in flags)) then
  955. begin
  956. if location.loc in [LOC_CREFERENCE,LOC_REFERENCE] then
  957. begin
  958. { data which must be finalized ? }
  959. if (resulttype.def.needs_inittable) then
  960. cg.g_finalize(exprasmlist,resulttype.def,location.reference,false);
  961. { release unused temp }
  962. tg.ungetiftemp(exprasmlist,location.reference)
  963. end
  964. else if location.loc=LOC_FPUREGISTER then
  965. begin
  966. {$ifdef x86}
  967. { release FPU stack }
  968. emit_reg(A_FSTP,S_NO,NR_FPU_RESULT_REG);
  969. {$endif x86}
  970. end;
  971. end;
  972. { Release parameters and locals }
  973. gen_free_parast(exprasmlist,tparasymtable(current_procinfo.procdef.parast));
  974. if current_procinfo.procdef.localst.symtabletype=localsymtable then
  975. gen_free_localst(exprasmlist,tlocalsymtable(current_procinfo.procdef.localst));
  976. {$ifdef GDB}
  977. if (cs_debuginfo in aktmoduleswitches) then
  978. begin
  979. cg.a_label(exprasmlist,endlabel);
  980. strpcopy(pp,'224,0,0,'+endlabel.name);
  981. if (target_info.use_function_relative_addresses) then
  982. begin
  983. strpcopy(strend(pp),'-');
  984. strpcopy(strend(pp),current_procinfo.inlining_procinfo.procdef.mangledname);
  985. end;
  986. withdebugList.concat(Tai_stabn.Create(strnew(pp)));
  987. freemem(pp,mangled_length+50);
  988. end;
  989. {$endif GDB}
  990. { restore }
  991. current_procinfo.free;
  992. current_procinfo:=oldprocinfo;
  993. inlining_procedure:=oldinlining_procedure;
  994. end;
  995. procedure tcgcallnode.pass_2;
  996. begin
  997. if assigned(inlinecode) then
  998. inlined_pass_2
  999. else
  1000. normal_pass_2;
  1001. end;
  1002. begin
  1003. ccallparanode:=tcgcallparanode;
  1004. ccallnode:=tcgcallnode;
  1005. end.
  1006. {
  1007. $Log$
  1008. Revision 1.141 2003-11-23 17:39:33 peter
  1009. * removed obsolete nf_cargs flag
  1010. Revision 1.140 2003/11/23 17:05:15 peter
  1011. * register calling is left-right
  1012. * parameter ordering
  1013. * left-right calling inserts result parameter last
  1014. Revision 1.139 2003/11/10 22:02:52 peter
  1015. * cross unit inlining fixed
  1016. Revision 1.138 2003/11/07 15:58:32 florian
  1017. * Florian's culmutative nr. 1; contains:
  1018. - invalid calling conventions for a certain cpu are rejected
  1019. - arm softfloat calling conventions
  1020. - -Sp for cpu dependend code generation
  1021. - several arm fixes
  1022. - remaining code for value open array paras on heap
  1023. Revision 1.137 2003/11/04 19:03:54 peter
  1024. * fixes for temp type patch
  1025. Revision 1.136 2003/11/04 15:35:13 peter
  1026. * fix for referencecounted temps
  1027. Revision 1.135 2003/10/30 17:12:49 peter
  1028. * fixed rangecheck error
  1029. Revision 1.134 2003/10/29 21:24:14 jonas
  1030. + support for fpu temp parameters
  1031. + saving/restoring of fpu register before/after a procedure call
  1032. Revision 1.133 2003/10/20 19:28:17 peter
  1033. * fixed inlining float parameters for i386
  1034. Revision 1.132 2003/10/17 14:38:32 peter
  1035. * 64k registers supported
  1036. * fixed some memory leaks
  1037. Revision 1.131 2003/10/17 01:22:08 florian
  1038. * compilation of the powerpc compiler fixed
  1039. Revision 1.130 2003/10/11 16:06:42 florian
  1040. * fixed some MMX<->SSE
  1041. * started to fix ppc, needs an overhaul
  1042. + stabs info improve for spilling, not sure if it works correctly/completly
  1043. - MMX_SUPPORT removed from Makefile.fpc
  1044. Revision 1.129 2003/10/10 17:48:13 peter
  1045. * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
  1046. * tregisteralloctor renamed to trgobj
  1047. * removed rgobj from a lot of units
  1048. * moved location_* and reference_* to cgobj
  1049. * first things for mmx register allocation
  1050. Revision 1.128 2003/10/10 09:21:53 marco
  1051. * typo fix from Wiktor
  1052. Revision 1.127 2003/10/09 21:31:37 daniel
  1053. * Register allocator splitted, ans abstract now
  1054. Revision 1.126 2003/10/07 15:17:07 peter
  1055. * inline supported again, LOC_REFERENCEs are used to pass the
  1056. parameters
  1057. * inlineparasymtable,inlinelocalsymtable removed
  1058. * exitlabel inserting fixed
  1059. Revision 1.125 2003/10/05 21:21:52 peter
  1060. * c style array of const generates callparanodes
  1061. * varargs paraloc fixes
  1062. Revision 1.124 2003/10/03 22:00:33 peter
  1063. * parameter alignment fixes
  1064. Revision 1.123 2003/10/01 20:34:48 peter
  1065. * procinfo unit contains tprocinfo
  1066. * cginfo renamed to cgbase
  1067. * moved cgmessage to verbose
  1068. * fixed ppc and sparc compiles
  1069. Revision 1.122 2003/09/30 21:02:37 peter
  1070. * updates for inlining
  1071. Revision 1.121 2003/09/30 19:55:19 peter
  1072. * remove abt reg for vmtreg
  1073. Revision 1.120 2003/09/29 20:58:55 peter
  1074. * optimized releasing of registers
  1075. Revision 1.119 2003/09/28 17:55:03 peter
  1076. * parent framepointer changed to hidden parameter
  1077. * tloadparentfpnode added
  1078. Revision 1.118 2003/09/28 13:54:43 peter
  1079. * removed a_call_ref
  1080. Revision 1.117 2003/09/25 21:28:00 peter
  1081. * parameter fixes
  1082. Revision 1.116 2003/09/23 17:56:05 peter
  1083. * locals and paras are allocated in the code generation
  1084. * tvarsym.localloc contains the location of para/local when
  1085. generating code for the current procedure
  1086. Revision 1.115 2003/09/16 16:17:01 peter
  1087. * varspez in calls to push_addr_param
  1088. Revision 1.114 2003/09/14 19:17:39 peter
  1089. * don't use a_call_ref because it can use a parameter register
  1090. as temp
  1091. Revision 1.113 2003/09/11 11:54:59 florian
  1092. * improved arm code generation
  1093. * move some protected and private field around
  1094. * the temp. register for register parameters/arguments are now released
  1095. before the move to the parameter register is done. This improves
  1096. the code in a lot of cases.
  1097. Revision 1.112 2003/09/10 08:31:47 marco
  1098. * Patch from Peter for paraloc
  1099. Revision 1.111 2003/09/07 22:09:35 peter
  1100. * preparations for different default calling conventions
  1101. * various RA fixes
  1102. Revision 1.110 2003/09/04 15:39:58 peter
  1103. * released useparatemp
  1104. Revision 1.109 2003/09/03 15:55:00 peter
  1105. * NEWRA branch merged
  1106. Revision 1.108.2.4 2003/09/01 21:02:55 peter
  1107. * sparc updates for new tregister
  1108. Revision 1.108.2.3 2003/08/31 21:07:44 daniel
  1109. * callparatemp ripped
  1110. Revision 1.108.2.2 2003/08/29 17:28:59 peter
  1111. * next batch of updates
  1112. Revision 1.108.2.1 2003/08/27 20:23:55 peter
  1113. * remove old ra code
  1114. Revision 1.108 2003/08/21 22:14:16 olle
  1115. - removed parameter from fpc_iocheck
  1116. Revision 1.107 2003/08/17 16:59:20 jonas
  1117. * fixed regvars so they work with newra (at least for ppc)
  1118. * fixed some volatile register bugs
  1119. + -dnotranslation option for -dnewra, which causes the registers not to
  1120. be translated from virtual to normal registers. Requires support in
  1121. the assembler writer as well, which is only implemented in aggas/
  1122. agppcgas currently
  1123. Revision 1.106 2003/08/16 18:56:40 marco
  1124. * fix from Jonas.
  1125. Revision 1.105 2003/08/11 21:18:20 peter
  1126. * start of sparc support for newra
  1127. Revision 1.104 2003/08/11 14:22:06 mazen
  1128. - dupplicated code removed
  1129. Revision 1.103 2003/07/23 11:01:14 jonas
  1130. * several rg.allocexplicitregistersint/rg.deallocexplicitregistersint
  1131. pairs round calls to helpers
  1132. Revision 1.102 2003/07/21 13:51:50 jonas
  1133. * fixed 64bit int results with -dnewra (you can't free both registers and
  1134. then allocate two new ones, because then the registers could be reversed
  1135. afterwards -> you get something like "movl %eax, %edx; movl %edx,%eax")
  1136. Revision 1.101 2003/07/08 21:24:59 peter
  1137. * sparc fixes
  1138. Revision 1.100 2003/07/06 21:50:33 jonas
  1139. * fixed ppc compilation problems and changed VOLATILE_REGISTERS for x86
  1140. so that it doesn't include ebp and esp anymore
  1141. Revision 1.99 2003/07/06 17:58:22 peter
  1142. * framepointer fixes for sparc
  1143. * parent framepointer code more generic
  1144. Revision 1.98 2003/07/06 15:31:20 daniel
  1145. * Fixed register allocator. *Lots* of fixes.
  1146. Revision 1.97 2003/07/05 20:21:26 jonas
  1147. * create_paraloc_info() is now called separately for the caller and
  1148. callee info
  1149. * fixed ppc cycle
  1150. Revision 1.96 2003/07/02 22:18:04 peter
  1151. * paraloc splitted in paraloc[callerside],calleeparaloc
  1152. * sparc calling convention updates
  1153. Revision 1.95 2003/06/17 16:34:44 jonas
  1154. * lots of newra fixes (need getfuncretparaloc implementation for i386)!
  1155. * renamed all_intregisters to paramanager.get_volatile_registers_int(pocall_default) and made it
  1156. processor dependent
  1157. Revision 1.94 2003/06/15 16:52:02 jonas
  1158. * release function result registers if the functino result isn't used
  1159. * don't allocate function result register with -dnewra if there is none
  1160. * some optimizations for non-x86 processor (don't save any registers
  1161. before a call)
  1162. Revision 1.93 2003/06/13 21:19:30 peter
  1163. * current_procdef removed, use current_procinfo.procdef instead
  1164. Revision 1.92 2003/06/12 21:10:50 peter
  1165. * newra fixes
  1166. Revision 1.91 2003/06/12 18:38:45 jonas
  1167. * deallocate parameter registers in time for newra
  1168. * for non-i386, procvars and methodpointers always have to be processed
  1169. in advance, whether or not newra is defined
  1170. Revision 1.90 2003/06/09 14:54:26 jonas
  1171. * (de)allocation of registers for parameters is now performed properly
  1172. (and checked on the ppc)
  1173. - removed obsolete allocation of all parameter registers at the start
  1174. of a procedure (and deallocation at the end)
  1175. Revision 1.89 2003/06/09 12:23:29 peter
  1176. * init/final of procedure data splitted from genentrycode
  1177. * use asmnode getposition to insert final at the correct position
  1178. als for the implicit try...finally
  1179. Revision 1.88 2003/06/08 20:01:53 jonas
  1180. * optimized assignments with on the right side a function that returns
  1181. an ansi- or widestring
  1182. Revision 1.87 2003/06/08 18:21:47 jonas
  1183. * fixed weird error in the copyleft statement :)
  1184. Revision 1.86 2003/06/07 18:57:04 jonas
  1185. + added freeintparaloc
  1186. * ppc get/freeintparaloc now check whether the parameter regs are
  1187. properly allocated/deallocated (and get an extra list para)
  1188. * ppc a_call_* now internalerrors if pi_do_call is not yet set
  1189. * fixed lot of missing pi_do_call's
  1190. Revision 1.85 2003/06/04 06:43:36 jonas
  1191. * fixed double secondpassing of procvar loads
  1192. Revision 1.84 2003/06/03 21:11:09 peter
  1193. * cg.a_load_* get a from and to size specifier
  1194. * makeregsize only accepts newregister
  1195. * i386 uses generic tcgnotnode,tcgunaryminus
  1196. Revision 1.83 2003/06/03 20:27:02 daniel
  1197. * Restored original methodpointer code for non newra case
  1198. Revision 1.82 2003/06/03 13:01:59 daniel
  1199. * Register allocator finished
  1200. Revision 1.81 2003/06/01 21:38:06 peter
  1201. * getregisterfpu size parameter added
  1202. * op_const_reg size parameter added
  1203. * sparc updates
  1204. Revision 1.80 2003/05/31 15:05:28 peter
  1205. * FUNCTION_RESULT64_LOW/HIGH_REG added for int64 results
  1206. Revision 1.79 2003/05/31 00:59:44 peter
  1207. * typo in FUNCTION_RESULT_REG
  1208. Revision 1.78 2003/05/30 23:57:08 peter
  1209. * more sparc cleanup
  1210. * accumulator removed, splitted in function_return_reg (called) and
  1211. function_result_reg (caller)
  1212. Revision 1.77 2003/05/29 10:05:40 jonas
  1213. * free callparatemps created for call-by-reference parameters
  1214. Revision 1.76 2003/05/28 23:58:18 jonas
  1215. * added missing initialization of rg.usedintin,byproc
  1216. * ppc now also saves/restores used fpu registers
  1217. * ncgcal doesn't add used registers to usedby/inproc anymore, except for
  1218. i386
  1219. Revision 1.75 2003/05/26 21:17:17 peter
  1220. * procinlinenode removed
  1221. * aktexit2label removed, fast exit removed
  1222. + tcallnode.inlined_pass_2 added
  1223. Revision 1.74 2003/05/25 11:34:17 peter
  1224. * methodpointer self pushing fixed
  1225. Revision 1.73 2003/05/25 08:59:16 peter
  1226. * inline fixes
  1227. Revision 1.72 2003/05/24 13:36:54 jonas
  1228. * save fpu results in a normal fpu register on non-x86 processors
  1229. Revision 1.71 2003/05/23 19:35:50 jonas
  1230. - undid previous commit, it was wrong
  1231. Revision 1.70 2003/05/23 19:11:58 jonas
  1232. * fixed tests for whether a certain int register is unused
  1233. Revision 1.69 2003/05/23 18:01:56 jonas
  1234. * fixed ppc compiler
  1235. Revision 1.68 2003/05/23 14:27:35 peter
  1236. * remove some unit dependencies
  1237. * current_procinfo changes to store more info
  1238. Revision 1.67 2003/05/17 13:30:08 jonas
  1239. * changed tt_persistant to tt_persistent :)
  1240. * tempcreatenode now doesn't accept a boolean anymore for persistent
  1241. temps, but a ttemptype, so you can also create ansistring temps etc
  1242. Revision 1.66 2003/05/16 14:33:31 peter
  1243. * regvar fixes
  1244. Revision 1.65 2003/05/15 18:58:53 peter
  1245. * removed selfpointer_offset, vmtpointer_offset
  1246. * tvarsym.adjusted_address
  1247. * address in localsymtable is now in the real direction
  1248. * removed some obsolete globals
  1249. Revision 1.64 2003/05/14 19:36:54 jonas
  1250. * patch from Peter for int64 function results
  1251. Revision 1.63 2003/05/13 19:14:41 peter
  1252. * failn removed
  1253. * inherited result code check moven to pexpr
  1254. Revision 1.62 2003/05/13 15:18:18 peter
  1255. * generate code for procvar first before pushing parameters. Made
  1256. the already existing code for powerpc available for all platforms
  1257. Revision 1.61 2003/05/12 18:17:55 jonas
  1258. * moved fpc_check_object call earlier for the ppc, so it can't destroy
  1259. already-loaded parameter registers
  1260. Revision 1.60 2003/05/11 21:48:38 jonas
  1261. * fixed procvar bug on the ppc (load procvar before loading para's,
  1262. because the procvar may otherwise destroy the already loaded paras)
  1263. Revision 1.59 2003/05/09 17:47:02 peter
  1264. * self moved to hidden parameter
  1265. * removed hdisposen,hnewn,selfn
  1266. Revision 1.58 2003/05/05 14:53:16 peter
  1267. * vs_hidden replaced by is_hidden boolean
  1268. Revision 1.57 2003/04/30 20:53:32 florian
  1269. * error when address of an abstract method is taken
  1270. * fixed some x86-64 problems
  1271. * merged some more x86-64 and i386 code
  1272. Revision 1.56 2003/04/29 07:28:52 michael
  1273. + Patch from peter to fix wrong pushing of ansistring function results in open array
  1274. Revision 1.55 2003/04/27 11:21:33 peter
  1275. * aktprocdef renamed to current_procinfo.procdef
  1276. * procinfo renamed to current_procinfo
  1277. * procinfo will now be stored in current_module so it can be
  1278. cleaned up properly
  1279. * gen_main_procsym changed to create_main_proc and release_main_proc
  1280. to also generate a tprocinfo structure
  1281. * fixed unit implicit initfinal
  1282. Revision 1.54 2003/04/27 07:29:50 peter
  1283. * current_procinfo.procdef cleanup, current_procinfo.procdef is now always nil when parsing
  1284. a new procdef declaration
  1285. * aktprocsym removed
  1286. * lexlevel removed, use symtable.symtablelevel instead
  1287. * implicit init/final code uses the normal genentry/genexit
  1288. * funcret state checking updated for new funcret handling
  1289. Revision 1.53 2003/04/25 20:59:33 peter
  1290. * removed funcretn,funcretsym, function result is now in varsym
  1291. and aliases for result and function name are added using absolutesym
  1292. * vs_hidden parameter for funcret passed in parameter
  1293. * vs_hidden fixes
  1294. * writenode changed to printnode and released from extdebug
  1295. * -vp option added to generate a tree.log with the nodetree
  1296. * nicer printnode for statements, callnode
  1297. Revision 1.52 2003/04/25 08:25:26 daniel
  1298. * Ifdefs around a lot of calls to cleartempgen
  1299. * Fixed registers that are allocated but not freed in several nodes
  1300. * Tweak to register allocator to cause less spills
  1301. * 8-bit registers now interfere with esi,edi and ebp
  1302. Compiler can now compile rtl successfully when using new register
  1303. allocator
  1304. Revision 1.51 2003/04/22 23:50:22 peter
  1305. * firstpass uses expectloc
  1306. * checks if there are differences between the expectloc and
  1307. location.loc from secondpass in EXTDEBUG
  1308. Revision 1.50 2003/04/22 14:33:38 peter
  1309. * removed some notes/hints
  1310. Revision 1.49 2003/04/22 13:47:08 peter
  1311. * fixed C style array of const
  1312. * fixed C array passing
  1313. * fixed left to right with high parameters
  1314. Revision 1.48 2003/04/22 10:09:34 daniel
  1315. + Implemented the actual register allocator
  1316. + Scratch registers unavailable when new register allocator used
  1317. + maybe_save/maybe_restore unavailable when new register allocator used
  1318. Revision 1.47 2003/04/22 09:49:44 peter
  1319. * do not load self when calling a non-inherited class constructor
  1320. Revision 1.46 2003/04/21 20:03:32 peter
  1321. * forgot to copy vmtrefaddr to selfrefaddr when self=vmt
  1322. Revision 1.45 2003/04/21 13:53:16 jonas
  1323. - removed copying of all paras when secondpassing a callnode (this used
  1324. to be necessary for inlinign support, but currently the whole inlined
  1325. procedure is already copied in advance). Note that the compiler crashes
  1326. when compiling ucomplex with -dTEST_INLINE (also after fixing the
  1327. syntax errors), but that was also the case before this change.
  1328. Revision 1.44 2003/04/10 17:57:52 peter
  1329. * vs_hidden released
  1330. Revision 1.43 2003/04/06 21:11:23 olle
  1331. * changed newasmsymbol to newasmsymboldata for data symbols
  1332. Revision 1.42 2003/04/04 15:38:56 peter
  1333. * moved generic code from n386cal to ncgcal, i386 now also
  1334. uses the generic ncgcal
  1335. Revision 1.41 2003/03/28 19:16:56 peter
  1336. * generic constructor working for i386
  1337. * remove fixed self register
  1338. * esi added as address register for i386
  1339. Revision 1.40 2003/03/06 11:35:50 daniel
  1340. * Fixed internalerror 7843 issue
  1341. Revision 1.39 2003/02/19 22:00:14 daniel
  1342. * Code generator converted to new register notation
  1343. - Horribily outdated todo.txt removed
  1344. Revision 1.38 2003/02/15 22:17:38 carl
  1345. * bugfix of FPU emulation code
  1346. Revision 1.37 2003/02/12 22:10:07 carl
  1347. * load_frame_pointer is now generic
  1348. * change fpu emulation routine names
  1349. Revision 1.36 2003/01/30 21:46:57 peter
  1350. * self fixes for static methods (merged)
  1351. Revision 1.35 2003/01/22 20:45:15 mazen
  1352. * making math code in RTL compiling.
  1353. *NB : This does NOT mean necessary that it will generate correct code!
  1354. Revision 1.34 2003/01/17 12:03:45 daniel
  1355. * Optalign conditional code adapted to record Tregister
  1356. Revision 1.33 2003/01/08 18:43:56 daniel
  1357. * Tregister changed into a record
  1358. Revision 1.32 2002/12/15 22:50:00 florian
  1359. + some stuff for the new hidden parameter handling added
  1360. Revision 1.31 2002/12/15 21:30:12 florian
  1361. * tcallnode.paraitem introduced, all references to defcoll removed
  1362. Revision 1.30 2002/11/27 20:04:39 peter
  1363. * cdecl array of const fixes
  1364. Revision 1.29 2002/11/25 17:43:17 peter
  1365. * splitted defbase in defutil,symutil,defcmp
  1366. * merged isconvertable and is_equal into compare_defs(_ext)
  1367. * made operator search faster by walking the list only once
  1368. Revision 1.28 2002/11/18 17:31:54 peter
  1369. * pass proccalloption to ret_in_xxx and push_xxx functions
  1370. Revision 1.27 2002/11/16 15:34:30 florian
  1371. * generic location for float results
  1372. Revision 1.26 2002/11/15 01:58:51 peter
  1373. * merged changes from 1.0.7 up to 04-11
  1374. - -V option for generating bug report tracing
  1375. - more tracing for option parsing
  1376. - errors for cdecl and high()
  1377. - win32 import stabs
  1378. - win32 records<=8 are returned in eax:edx (turned off by default)
  1379. - heaptrc update
  1380. - more info for temp management in .s file with EXTDEBUG
  1381. Revision 1.25 2002/10/05 12:43:25 carl
  1382. * fixes for Delphi 6 compilation
  1383. (warning : Some features do not work under Delphi)
  1384. Revision 1.24 2002/09/30 07:00:45 florian
  1385. * fixes to common code to get the alpha compiler compiled applied
  1386. Revision 1.23 2002/09/17 18:54:02 jonas
  1387. * a_load_reg_reg() now has two size parameters: source and dest. This
  1388. allows some optimizations on architectures that don't encode the
  1389. register size in the register name.
  1390. Revision 1.22 2002/09/07 15:25:02 peter
  1391. * old logs removed and tabs fixed
  1392. Revision 1.21 2002/09/07 11:50:02 jonas
  1393. * fixed small regalloction info bug
  1394. Revision 1.20 2002/09/02 11:25:20 florian
  1395. * fixed generic procedure variable calling
  1396. Revision 1.19 2002/09/01 21:04:48 florian
  1397. * several powerpc related stuff fixed
  1398. Revision 1.18 2002/09/01 18:43:27 peter
  1399. * include FUNCTION_RETURN_REG in regs_to_push list
  1400. Revision 1.17 2002/09/01 12:13:00 peter
  1401. * use a_call_reg
  1402. * ungetiftemp for procvar of object temp
  1403. Revision 1.16 2002/08/25 19:25:18 peter
  1404. * sym.insert_in_data removed
  1405. * symtable.insertvardata/insertconstdata added
  1406. * removed insert_in_data call from symtable.insert, it needs to be
  1407. called separatly. This allows to deref the address calculation
  1408. * procedures now calculate the parast addresses after the procedure
  1409. directives are parsed. This fixes the cdecl parast problem
  1410. * push_addr_param has an extra argument that specifies if cdecl is used
  1411. or not
  1412. Revision 1.15 2002/08/23 16:14:48 peter
  1413. * tempgen cleanup
  1414. * tt_noreuse temp type added that will be used in genentrycode
  1415. Revision 1.14 2002/08/20 16:55:38 peter
  1416. * don't write (stabs)line info when inlining a procedure
  1417. Revision 1.13 2002/08/19 19:36:42 peter
  1418. * More fixes for cross unit inlining, all tnodes are now implemented
  1419. * Moved pocall_internconst to po_internconst because it is not a
  1420. calling type at all and it conflicted when inlining of these small
  1421. functions was requested
  1422. Revision 1.12 2002/08/18 20:06:23 peter
  1423. * inlining is now also allowed in interface
  1424. * renamed write/load to ppuwrite/ppuload
  1425. * tnode storing in ppu
  1426. * nld,ncon,nbas are already updated for storing in ppu
  1427. Revision 1.11 2002/08/17 22:09:44 florian
  1428. * result type handling in tcgcal.pass_2 overhauled
  1429. * better tnode.dowrite
  1430. * some ppc stuff fixed
  1431. Revision 1.10 2002/08/17 09:23:35 florian
  1432. * first part of procinfo rewrite
  1433. Revision 1.9 2002/08/13 21:40:55 florian
  1434. * more fixes for ppc calling conventions
  1435. Revision 1.8 2002/08/13 18:01:51 carl
  1436. * rename swatoperands to swapoperands
  1437. + m68k first compilable version (still needs a lot of testing):
  1438. assembler generator, system information , inline
  1439. assembler reader.
  1440. Revision 1.7 2002/08/12 15:08:39 carl
  1441. + stab register indexes for powerpc (moved from gdb to cpubase)
  1442. + tprocessor enumeration moved to cpuinfo
  1443. + linker in target_info is now a class
  1444. * many many updates for m68k (will soon start to compile)
  1445. - removed some ifdef or correct them for correct cpu
  1446. Revision 1.6 2002/08/11 14:32:26 peter
  1447. * renamed current_library to objectlibrary
  1448. Revision 1.5 2002/08/11 13:24:11 peter
  1449. * saving of asmsymbols in ppu supported
  1450. * asmsymbollist global is removed and moved into a new class
  1451. tasmlibrarydata that will hold the info of a .a file which
  1452. corresponds with a single module. Added librarydata to tmodule
  1453. to keep the library info stored for the module. In the future the
  1454. objectfiles will also be stored to the tasmlibrarydata class
  1455. * all getlabel/newasmsymbol and friends are moved to the new class
  1456. Revision 1.4 2002/08/06 20:55:20 florian
  1457. * first part of ppc calling conventions fix
  1458. Revision 1.3 2002/07/20 11:57:53 florian
  1459. * types.pas renamed to defbase.pas because D6 contains a types
  1460. unit so this would conflicts if D6 programms are compiled
  1461. + Willamette/SSE2 instructions to assembler added
  1462. Revision 1.2 2002/07/13 19:38:43 florian
  1463. * some more generic calling stuff fixed
  1464. }