ncgld.pas 53 KB

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