ncgld.pas 53 KB

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