ncgld.pas 52 KB

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