ncgcal.pas 67 KB

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