ncgmem.pas 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Generate assembler for memory related nodes which are
  5. 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. { This unit generate assembler for memory related nodes.
  20. }
  21. unit ncgmem;
  22. {$i fpcdefs.inc}
  23. interface
  24. uses
  25. cgbase,cpuinfo,cpubase,
  26. node,nmem;
  27. type
  28. tcgloadvmtaddrnode = class(tloadvmtaddrnode)
  29. procedure pass_2;override;
  30. end;
  31. tcgloadparentfpnode = class(tloadparentfpnode)
  32. procedure pass_2;override;
  33. end;
  34. tcgaddrnode = class(taddrnode)
  35. procedure pass_2;override;
  36. end;
  37. tcgderefnode = class(tderefnode)
  38. procedure pass_2;override;
  39. end;
  40. tcgsubscriptnode = class(tsubscriptnode)
  41. procedure pass_2;override;
  42. end;
  43. tcgwithnode = class(twithnode)
  44. procedure pass_2;override;
  45. end;
  46. tcgvecnode = class(tvecnode)
  47. private
  48. procedure rangecheck_array;
  49. protected
  50. function get_mul_size : longint;
  51. {# This routine is used to calculate the address of the reference.
  52. On entry reg contains the index in the array,
  53. and l contains the size of each element in the array.
  54. This routine should update location.reference correctly,
  55. so it points to the correct address.
  56. }
  57. procedure update_reference_reg_mul(reg:tregister;l:aword);virtual;
  58. procedure second_wideansistring;virtual;
  59. procedure second_dynamicarray;virtual;
  60. public
  61. procedure pass_2;override;
  62. end;
  63. implementation
  64. uses
  65. {$ifdef delphi}
  66. sysutils,
  67. {$else}
  68. strings,
  69. {$endif}
  70. {$ifdef GDB}
  71. gdb,
  72. {$endif GDB}
  73. globtype,systems,
  74. cutils,verbose,globals,
  75. symconst,symdef,symsym,defutil,paramgr,
  76. aasmbase,aasmtai,
  77. procinfo,pass_2,
  78. pass_1,nld,ncon,nadd,nutils,
  79. cgutils,cgobj,
  80. tgobj,ncgutil,symbase
  81. ;
  82. {*****************************************************************************
  83. TCGLOADVMTADDRNODE
  84. *****************************************************************************}
  85. procedure tcgloadvmtaddrnode.pass_2;
  86. var
  87. href : treference;
  88. begin
  89. location_reset(location,LOC_REGISTER,OS_ADDR);
  90. if (left.nodetype<>typen) then
  91. begin
  92. { left contains self, load vmt from self }
  93. secondpass(left);
  94. if is_object(left.resulttype.def) then
  95. begin
  96. case left.location.loc of
  97. LOC_CREFERENCE,
  98. LOC_REFERENCE:
  99. begin
  100. location_release(exprasmlist,left.location);
  101. reference_reset_base(href,cg.getaddressregister(exprasmlist),tobjectdef(left.resulttype.def).vmt_offset);
  102. cg.a_loadaddr_ref_reg(exprasmlist,left.location.reference,href.base);
  103. end;
  104. else
  105. internalerror(200305056);
  106. end;
  107. end
  108. else
  109. begin
  110. case left.location.loc of
  111. LOC_REGISTER:
  112. begin
  113. {$ifdef cpu_uses_separate_address_registers}
  114. if getregtype(left.location.register)<>R_ADDRESSREGISTER then
  115. begin
  116. location_release(exprasmlist,left.location);
  117. reference_reset_base(href,cg.getaddressregister(exprasmlist),tobjectdef(left.resulttype.def).vmt_offset);
  118. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.register,href.base);
  119. end
  120. else
  121. {$endif}
  122. reference_reset_base(href,left.location.register,tobjectdef(left.resulttype.def).vmt_offset);
  123. end;
  124. LOC_CREGISTER,
  125. LOC_CREFERENCE,
  126. LOC_REFERENCE:
  127. begin
  128. location_release(exprasmlist,left.location);
  129. reference_reset_base(href,cg.getaddressregister(exprasmlist),tobjectdef(left.resulttype.def).vmt_offset);
  130. cg.a_load_loc_reg(exprasmlist,OS_ADDR,left.location,href.base);
  131. end;
  132. else
  133. internalerror(200305057);
  134. end;
  135. end;
  136. reference_release(exprasmlist,href);
  137. location.register:=cg.getaddressregister(exprasmlist);
  138. cg.g_maybe_testself(exprasmlist,href.base);
  139. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,href,location.register);
  140. end
  141. else
  142. begin
  143. reference_reset_symbol(href,
  144. objectlibrary.newasmsymboldata(tobjectdef(tclassrefdef(resulttype.def).pointertype.def).vmt_mangledname),0);
  145. location.register:=cg.getaddressregister(exprasmlist);
  146. cg.a_loadaddr_ref_reg(exprasmlist,href,location.register);
  147. end;
  148. end;
  149. {*****************************************************************************
  150. TCGLOADPARENTFPNODE
  151. *****************************************************************************}
  152. procedure tcgloadparentfpnode.pass_2;
  153. var
  154. currpi : tprocinfo;
  155. hsym : tvarsym;
  156. href : treference;
  157. begin
  158. if (current_procinfo.procdef.parast.symtablelevel=parentpd.parast.symtablelevel) then
  159. begin
  160. location_reset(location,LOC_REGISTER,OS_ADDR);
  161. location.register:=current_procinfo.framepointer;
  162. end
  163. else
  164. begin
  165. currpi:=current_procinfo;
  166. location_reset(location,LOC_REGISTER,OS_ADDR);
  167. location.register:=cg.getaddressregister(exprasmlist);
  168. { load framepointer of current proc }
  169. hsym:=tvarsym(currpi.procdef.parast.search('parentfp'));
  170. if not assigned(hsym) then
  171. internalerror(200309281);
  172. case hsym.localloc.loc of
  173. LOC_REFERENCE :
  174. begin
  175. reference_reset_base(href,hsym.localloc.reference.index,hsym.localloc.reference.offset);
  176. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,href,location.register);
  177. end;
  178. LOC_REGISTER :
  179. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,hsym.localloc.register,location.register);
  180. end;
  181. { walk parents }
  182. while (currpi.procdef.owner.symtablelevel>parentpd.parast.symtablelevel) do
  183. begin
  184. currpi:=currpi.parent;
  185. if not assigned(currpi) then
  186. internalerror(200311201);
  187. hsym:=tvarsym(currpi.procdef.parast.search('parentfp'));
  188. if not assigned(hsym) then
  189. internalerror(200309282);
  190. if hsym.localloc.loc<>LOC_REFERENCE then
  191. internalerror(200309283);
  192. reference_reset_base(href,location.register,hsym.localloc.reference.offset);
  193. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,href,location.register);
  194. end;
  195. end;
  196. end;
  197. {*****************************************************************************
  198. TCGADDRNODE
  199. *****************************************************************************}
  200. procedure tcgaddrnode.pass_2;
  201. begin
  202. secondpass(left);
  203. { when loading procvar we do nothing with this node, so load the
  204. location of left }
  205. if nf_procvarload in flags then
  206. begin
  207. location_copy(location,left.location);
  208. exit;
  209. end;
  210. location_release(exprasmlist,left.location);
  211. location_reset(location,LOC_REGISTER,OS_ADDR);
  212. location.register:=cg.getaddressregister(exprasmlist);
  213. { @ on a procvar means returning an address to the procedure that
  214. is stored in it }
  215. if (m_tp_procvar in aktmodeswitches) and
  216. (left.nodetype=loadn) and
  217. (tloadnode(left).resulttype.def.deftype=procvardef) and
  218. assigned(tloadnode(left).symtableentry) and
  219. (tloadnode(left).symtableentry.typ=varsym) then
  220. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.reference,location.register)
  221. else
  222. cg.a_loadaddr_ref_reg(exprasmlist,left.location.reference,location.register);
  223. end;
  224. {*****************************************************************************
  225. TCGDEREFNODE
  226. *****************************************************************************}
  227. procedure tcgderefnode.pass_2;
  228. var
  229. paraloc1 : tparalocation;
  230. begin
  231. secondpass(left);
  232. location_reset(location,LOC_REFERENCE,def_cgsize(resulttype.def));
  233. case left.location.loc of
  234. LOC_REGISTER:
  235. begin
  236. {$ifdef cpu_uses_separate_address_registers}
  237. if getregtype(left.location.register)<>R_ADDRESSREGISTER then
  238. begin
  239. location_release(exprasmlist,left.location);
  240. location.reference.base := cg.getaddressregister(exprasmlist);
  241. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.register,
  242. location.reference.base);
  243. end
  244. else
  245. {$endif}
  246. location.reference.base := left.location.register;
  247. end;
  248. LOC_CREGISTER,
  249. LOC_CREFERENCE,
  250. LOC_REFERENCE:
  251. begin
  252. location_release(exprasmlist,left.location);
  253. location.reference.base:=cg.getaddressregister(exprasmlist);
  254. cg.a_load_loc_reg(exprasmlist,OS_ADDR,left.location,location.reference.base);
  255. end;
  256. end;
  257. if (cs_gdb_heaptrc in aktglobalswitches) and
  258. (cs_checkpointer in aktglobalswitches) and
  259. not(cs_compilesystem in aktmoduleswitches) and
  260. (not tpointerdef(left.resulttype.def).is_far) then
  261. begin
  262. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  263. paramanager.allocparaloc(exprasmlist,paraloc1);
  264. cg.a_param_reg(exprasmlist, OS_ADDR,location.reference.base,paraloc1);
  265. paramanager.freeparaloc(exprasmlist,paraloc1);
  266. { FPC_CHECKPOINTER uses saveregisters }
  267. cg.a_call_name(exprasmlist,'FPC_CHECKPOINTER');
  268. end;
  269. end;
  270. {*****************************************************************************
  271. TCGSUBSCRIPTNODE
  272. *****************************************************************************}
  273. procedure tcgsubscriptnode.pass_2;
  274. var
  275. paraloc1 : tparalocation;
  276. begin
  277. secondpass(left);
  278. if codegenerror then
  279. exit;
  280. { classes and interfaces must be dereferenced implicit }
  281. if is_class_or_interface(left.resulttype.def) then
  282. begin
  283. location_reset(location,LOC_REFERENCE,def_cgsize(resulttype.def));
  284. case left.location.loc of
  285. LOC_CREGISTER,
  286. LOC_REGISTER:
  287. begin
  288. {$ifdef cpu_uses_separate_address_registers}
  289. if getregtype(left.location.register)<>R_ADDRESSREGISTER then
  290. begin
  291. location_release(exprasmlist,left.location);
  292. location.reference.base:=rg.getaddressregister(exprasmlist);
  293. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,
  294. left.location.register,location.reference.base);
  295. end
  296. else
  297. {$endif}
  298. location.reference.base := left.location.register;
  299. end;
  300. LOC_CREFERENCE,
  301. LOC_REFERENCE:
  302. begin
  303. location_release(exprasmlist,left.location);
  304. location.reference.base:=cg.getaddressregister(exprasmlist);
  305. cg.a_load_loc_reg(exprasmlist,OS_ADDR,left.location,location.reference.base);
  306. end;
  307. end;
  308. { implicit deferencing }
  309. if (cs_gdb_heaptrc in aktglobalswitches) and
  310. (cs_checkpointer in aktglobalswitches) and
  311. not(cs_compilesystem in aktmoduleswitches) then
  312. begin
  313. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  314. paramanager.allocparaloc(exprasmlist,paraloc1);
  315. cg.a_param_reg(exprasmlist, OS_ADDR,location.reference.base,paraloc1);
  316. paramanager.freeparaloc(exprasmlist,paraloc1);
  317. { FPC_CHECKPOINTER uses saveregisters }
  318. cg.a_call_name(exprasmlist,'FPC_CHECKPOINTER');
  319. end;
  320. end
  321. else if is_interfacecom(left.resulttype.def) then
  322. begin
  323. tg.GetTempTyped(exprasmlist,left.resulttype.def,tt_normal,location.reference);
  324. cg.a_load_loc_ref(exprasmlist,OS_ADDR,left.location,location.reference);
  325. { implicit deferencing also for interfaces }
  326. if (cs_gdb_heaptrc in aktglobalswitches) and
  327. (cs_checkpointer in aktglobalswitches) and
  328. not(cs_compilesystem in aktmoduleswitches) then
  329. begin
  330. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  331. paramanager.allocparaloc(exprasmlist,paraloc1);
  332. cg.a_param_reg(exprasmlist, OS_ADDR,location.reference.base,paraloc1);
  333. paramanager.freeparaloc(exprasmlist,paraloc1);
  334. { FPC_CHECKPOINTER uses saveregisters }
  335. cg.a_call_name(exprasmlist,'FPC_CHECKPOINTER');
  336. end;
  337. end
  338. else
  339. location_copy(location,left.location);
  340. inc(location.reference.offset,vs.fieldoffset);
  341. { also update the size of the location }
  342. location.size:=def_cgsize(resulttype.def);
  343. end;
  344. {*****************************************************************************
  345. TCGWITHNODE
  346. *****************************************************************************}
  347. procedure tcgwithnode.pass_2;
  348. {$ifdef GDB}
  349. const
  350. withlevel : longint = 0;
  351. var
  352. withstartlabel,withendlabel : tasmlabel;
  353. pp : pchar;
  354. mangled_length : longint;
  355. refnode : tnode;
  356. {$endif GDB}
  357. begin
  358. location_reset(location,LOC_VOID,OS_NO);
  359. {$ifdef GDB}
  360. if (cs_debuginfo in aktmoduleswitches) then
  361. begin
  362. { load reference }
  363. if (withrefnode.nodetype=derefn) and
  364. (tderefnode(withrefnode).left.nodetype=temprefn) then
  365. refnode:=tderefnode(withrefnode).left
  366. else
  367. refnode:=withrefnode;
  368. secondpass(refnode);
  369. location_release(exprasmlist,refnode.location);
  370. location_freetemp(exprasmlist,refnode.location);
  371. if not(refnode.location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
  372. internalerror(2003092810);
  373. inc(withlevel);
  374. objectlibrary.getaddrlabel(withstartlabel);
  375. objectlibrary.getaddrlabel(withendlabel);
  376. cg.a_label(exprasmlist,withstartlabel);
  377. withdebugList.concat(Tai_stabs.Create(strpnew(
  378. '"with'+tostr(withlevel)+':'+tostr(symtablestack.getnewtypecount)+
  379. '=*'+tstoreddef(left.resulttype.def).numberstring+'",'+
  380. tostr(N_LSYM)+',0,0,'+tostr(refnode.location.reference.offset))));
  381. mangled_length:=length(current_procinfo.procdef.mangledname);
  382. getmem(pp,mangled_length+50);
  383. strpcopy(pp,'192,0,0,'+withstartlabel.name);
  384. if (target_info.use_function_relative_addresses) then
  385. begin
  386. strpcopy(strend(pp),'-');
  387. strpcopy(strend(pp),current_procinfo.procdef.mangledname);
  388. end;
  389. withdebugList.concat(Tai_stabn.Create(strnew(pp)));
  390. end;
  391. {$endif GDB}
  392. if assigned(left) then
  393. secondpass(left);
  394. {$ifdef GDB}
  395. if (cs_debuginfo in aktmoduleswitches) then
  396. begin
  397. cg.a_label(exprasmlist,withendlabel);
  398. strpcopy(pp,'224,0,0,'+withendlabel.name);
  399. if (target_info.use_function_relative_addresses) then
  400. begin
  401. strpcopy(strend(pp),'-');
  402. strpcopy(strend(pp),current_procinfo.procdef.mangledname);
  403. end;
  404. withdebugList.concat(Tai_stabn.Create(strnew(pp)));
  405. freemem(pp,mangled_length+50);
  406. dec(withlevel);
  407. end;
  408. {$endif GDB}
  409. end;
  410. {*****************************************************************************
  411. TCGVECNODE
  412. *****************************************************************************}
  413. function tcgvecnode.get_mul_size : longint;
  414. begin
  415. if nf_memindex in flags then
  416. get_mul_size:=1
  417. else
  418. begin
  419. if (left.resulttype.def.deftype=arraydef) then
  420. get_mul_size:=tarraydef(left.resulttype.def).elesize
  421. else
  422. get_mul_size:=resulttype.def.size;
  423. end
  424. end;
  425. procedure tcgvecnode.update_reference_reg_mul(reg:tregister;l:aword);
  426. var
  427. hreg: tregister;
  428. begin
  429. if location.reference.base=NR_NO then
  430. begin
  431. if l<>1 then
  432. cg.a_op_const_reg(exprasmlist,OP_IMUL,OS_ADDR,l,reg);
  433. location.reference.base:=reg;
  434. end
  435. else if location.reference.index=NR_NO then
  436. begin
  437. if l<>1 then
  438. cg.a_op_const_reg(exprasmlist,OP_IMUL,OS_ADDR,l,reg);
  439. location.reference.index:=reg;
  440. end
  441. else
  442. begin
  443. cg.ungetreference(exprasmlist,location.reference);
  444. hreg := cg.getaddressregister(exprasmlist);
  445. cg.a_loadaddr_ref_reg(exprasmlist,location.reference,hreg);
  446. reference_reset_base(location.reference,hreg,0);
  447. { insert new index register }
  448. if l<>1 then
  449. cg.a_op_const_reg(exprasmlist,OP_IMUL,OS_ADDR,l,reg);
  450. location.reference.index:=reg;
  451. end;
  452. end;
  453. procedure tcgvecnode.second_wideansistring;
  454. begin
  455. end;
  456. procedure tcgvecnode.second_dynamicarray;
  457. begin
  458. end;
  459. procedure tcgvecnode.rangecheck_array;
  460. var
  461. freereg : boolean;
  462. hightree : tnode;
  463. poslabel,
  464. neglabel : tasmlabel;
  465. hreg : tregister;
  466. paraloc1,paraloc2 : tparalocation;
  467. begin
  468. if is_open_array(left.resulttype.def) or
  469. is_array_of_const(left.resulttype.def) then
  470. begin
  471. { cdecl functions don't have high() so we can not check the range }
  472. if not(current_procinfo.procdef.proccalloption in [pocall_cdecl,pocall_cppdecl]) then
  473. begin
  474. { Get high value }
  475. hightree:=load_high_value_node(tvarsym(tloadnode(left).symtableentry));
  476. { it must be available }
  477. if not assigned(hightree) then
  478. internalerror(200212201);
  479. firstpass(hightree);
  480. secondpass(hightree);
  481. { generate compares }
  482. freereg:=false;
  483. if (right.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
  484. hreg:=right.location.register
  485. else
  486. begin
  487. hreg:=cg.getintregister(exprasmlist,OS_INT);
  488. freereg:=true;
  489. cg.a_load_loc_reg(exprasmlist,OS_INT,right.location,hreg);
  490. end;
  491. objectlibrary.getlabel(neglabel);
  492. objectlibrary.getlabel(poslabel);
  493. cg.a_cmp_const_reg_label(exprasmlist,OS_INT,OC_LT,0,hreg,poslabel);
  494. location_release(exprasmlist,hightree.location);
  495. cg.a_cmp_loc_reg_label(exprasmlist,OS_INT,OC_BE,hightree.location,hreg,neglabel);
  496. if freereg then
  497. cg.ungetregister(exprasmlist,hreg);
  498. cg.a_label(exprasmlist,poslabel);
  499. cg.a_call_name(exprasmlist,'FPC_RANGEERROR');
  500. cg.a_label(exprasmlist,neglabel);
  501. { release hightree }
  502. hightree.free;
  503. end;
  504. end
  505. else
  506. if is_dynamic_array(left.resulttype.def) then
  507. begin
  508. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  509. paraloc2:=paramanager.getintparaloc(pocall_default,2);
  510. paramanager.allocparaloc(exprasmlist,paraloc2);
  511. cg.a_param_loc(exprasmlist,right.location,paraloc2);
  512. paramanager.allocparaloc(exprasmlist,paraloc1);
  513. cg.a_param_loc(exprasmlist,left.location,paraloc1);
  514. paramanager.freeparaloc(exprasmlist,paraloc1);
  515. paramanager.freeparaloc(exprasmlist,paraloc2);
  516. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  517. cg.a_call_name(exprasmlist,'FPC_DYNARRAY_RANGECHECK');
  518. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  519. end
  520. else
  521. cg.g_rangecheck(exprasmlist,right.location,right.resulttype.def,left.resulttype.def);
  522. end;
  523. procedure tcgvecnode.pass_2;
  524. var
  525. extraoffset : longint;
  526. t : tnode;
  527. href : treference;
  528. otl,ofl : tasmlabel;
  529. newsize : tcgsize;
  530. mulsize: longint;
  531. isjump : boolean;
  532. paraloc1,paraloc2 : tparalocation;
  533. begin
  534. mulsize := get_mul_size;
  535. newsize:=def_cgsize(resulttype.def);
  536. secondpass(left);
  537. if left.location.loc=LOC_CREFERENCE then
  538. location_reset(location,LOC_CREFERENCE,newsize)
  539. else
  540. location_reset(location,LOC_REFERENCE,newsize);
  541. { an ansistring needs to be dereferenced }
  542. if is_ansistring(left.resulttype.def) or
  543. is_widestring(left.resulttype.def) then
  544. begin
  545. if nf_callunique in flags then
  546. internalerror(200304236);
  547. case left.location.loc of
  548. LOC_REGISTER,
  549. LOC_CREGISTER :
  550. location.reference.base:=left.location.register;
  551. LOC_CREFERENCE,
  552. LOC_REFERENCE :
  553. begin
  554. location_release(exprasmlist,left.location);
  555. location.reference.base:=cg.getaddressregister(exprasmlist);
  556. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.reference,location.reference.base);
  557. end;
  558. else
  559. internalerror(2002032218);
  560. end;
  561. { check for a zero length string,
  562. we can use the ansistring routine here }
  563. if (cs_check_range in aktlocalswitches) then
  564. begin
  565. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  566. paramanager.allocparaloc(exprasmlist,paraloc1);
  567. cg.a_param_reg(exprasmlist,OS_ADDR,location.reference.base,paraloc1);
  568. paramanager.freeparaloc(exprasmlist,paraloc1);
  569. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  570. cg.a_call_name(exprasmlist,'FPC_'+upper(tstringdef(left.resulttype.def).stringtypname)+'_CHECKZERO');
  571. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  572. end;
  573. { in ansistrings/widestrings S[1] is p<w>char(S)[0] !! }
  574. if is_ansistring(left.resulttype.def) then
  575. dec(location.reference.offset)
  576. else
  577. dec(location.reference.offset,2);
  578. end
  579. else if is_dynamic_array(left.resulttype.def) then
  580. begin
  581. case left.location.loc of
  582. LOC_REGISTER,
  583. LOC_CREGISTER :
  584. location.reference.base:=left.location.register;
  585. LOC_REFERENCE,
  586. LOC_CREFERENCE :
  587. begin
  588. location_release(exprasmlist,left.location);
  589. location.reference.base:=cg.getaddressregister(exprasmlist);
  590. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,
  591. left.location.reference,location.reference.base);
  592. end;
  593. else
  594. internalerror(2002032219);
  595. end;
  596. end
  597. else
  598. location_copy(location,left.location);
  599. { offset can only differ from 0 if arraydef }
  600. if (left.resulttype.def.deftype=arraydef) and
  601. not(is_dynamic_array(left.resulttype.def)) then
  602. dec(location.reference.offset,mulsize*tarraydef(left.resulttype.def).lowrange);
  603. if right.nodetype=ordconstn then
  604. begin
  605. { offset can only differ from 0 if arraydef }
  606. case left.resulttype.def.deftype of
  607. arraydef :
  608. begin
  609. if not(is_open_array(left.resulttype.def)) and
  610. not(is_array_of_const(left.resulttype.def)) and
  611. not(is_dynamic_array(left.resulttype.def)) then
  612. begin
  613. if (tordconstnode(right).value>tarraydef(left.resulttype.def).highrange) or
  614. (tordconstnode(right).value<tarraydef(left.resulttype.def).lowrange) then
  615. begin
  616. { this should be caught in the resulttypepass! (JM) }
  617. if (cs_check_range in aktlocalswitches) then
  618. CGMessage(parser_e_range_check_error)
  619. else
  620. CGMessage(parser_w_range_check_error);
  621. end;
  622. end
  623. else
  624. begin
  625. { range checking for open and dynamic arrays needs
  626. runtime code }
  627. secondpass(right);
  628. if (cs_check_range in aktlocalswitches) then
  629. rangecheck_array;
  630. end;
  631. end;
  632. stringdef :
  633. begin
  634. if (cs_check_range in aktlocalswitches) then
  635. begin
  636. case tstringdef(left.resulttype.def).string_typ of
  637. { it's the same for ansi- and wide strings }
  638. st_widestring,
  639. st_ansistring:
  640. begin
  641. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  642. paraloc2:=paramanager.getintparaloc(pocall_default,2);
  643. paramanager.allocparaloc(exprasmlist,paraloc2);
  644. cg.a_param_const(exprasmlist,OS_INT,tordconstnode(right).value,paraloc2);
  645. href:=location.reference;
  646. dec(href.offset,7);
  647. paramanager.allocparaloc(exprasmlist,paraloc1);
  648. cg.a_param_ref(exprasmlist,OS_INT,href,paraloc1);
  649. paramanager.freeparaloc(exprasmlist,paraloc1);
  650. paramanager.freeparaloc(exprasmlist,paraloc2);
  651. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  652. cg.a_call_name(exprasmlist,'FPC_'+upper(tstringdef(left.resulttype.def).stringtypname)+'_RANGECHECK');
  653. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  654. end;
  655. st_shortstring:
  656. begin
  657. {!!!!!!!!!!!!!!!!!}
  658. end;
  659. st_longstring:
  660. begin
  661. {!!!!!!!!!!!!!!!!!}
  662. end;
  663. end;
  664. end;
  665. end;
  666. end;
  667. inc(location.reference.offset,
  668. mulsize*tordconstnode(right).value);
  669. end
  670. else
  671. { not nodetype=ordconstn }
  672. begin
  673. if (cs_regvars in aktglobalswitches) and
  674. { if we do range checking, we don't }
  675. { need that fancy code (it would be }
  676. { buggy) }
  677. not(cs_check_range in aktlocalswitches) and
  678. (left.resulttype.def.deftype=arraydef) then
  679. begin
  680. extraoffset:=0;
  681. if (right.nodetype=addn) then
  682. begin
  683. if taddnode(right).right.nodetype=ordconstn then
  684. begin
  685. extraoffset:=tordconstnode(taddnode(right).right).value;
  686. t:=taddnode(right).left;
  687. { First pass processed this with the assumption }
  688. { that there was an add node which may require an }
  689. { extra register. Fake it or die with IE10 (JM) }
  690. t.registersint := taddnode(right).registersint;
  691. taddnode(right).left:=nil;
  692. right.free;
  693. right:=t;
  694. end
  695. else if taddnode(right).left.nodetype=ordconstn then
  696. begin
  697. extraoffset:=tordconstnode(taddnode(right).left).value;
  698. t:=taddnode(right).right;
  699. t.registersint := right.registersint;
  700. taddnode(right).right:=nil;
  701. right.free;
  702. right:=t;
  703. end;
  704. end
  705. else if (right.nodetype=subn) then
  706. begin
  707. if taddnode(right).right.nodetype=ordconstn then
  708. begin
  709. extraoffset:=-tordconstnode(taddnode(right).right).value;
  710. t:=taddnode(right).left;
  711. t.registersint := right.registersint;
  712. taddnode(right).left:=nil;
  713. right.free;
  714. right:=t;
  715. end
  716. { You also have to negate right.right in this case! I can't add an
  717. unaryminusn without causing a crash, so I've disabled it (JM)
  718. else if right.left.nodetype=ordconstn then
  719. begin
  720. extraoffset:=right.left.value;
  721. t:=right.right;
  722. t^.registersint := right.registersint;
  723. putnode(right);
  724. putnode(right.left);
  725. right:=t;
  726. end;}
  727. end;
  728. inc(location.reference.offset,
  729. mulsize*extraoffset);
  730. end;
  731. { calculate from left to right }
  732. if not(location.loc in [LOC_CREFERENCE,LOC_REFERENCE]) then
  733. internalerror(200304237);
  734. isjump:=(right.location.loc=LOC_JUMP);
  735. if isjump then
  736. begin
  737. otl:=truelabel;
  738. objectlibrary.getlabel(truelabel);
  739. ofl:=falselabel;
  740. objectlibrary.getlabel(falselabel);
  741. end;
  742. secondpass(right);
  743. if cs_check_range in aktlocalswitches then
  744. begin
  745. if left.resulttype.def.deftype=arraydef then
  746. rangecheck_array;
  747. end;
  748. { if mulsize = 1, we won't have to modify the index }
  749. location_force_reg(exprasmlist,right.location,OS_ADDR,(mulsize = 1));
  750. if isjump then
  751. begin
  752. truelabel:=otl;
  753. falselabel:=ofl;
  754. end;
  755. { produce possible range check code: }
  756. if cs_check_range in aktlocalswitches then
  757. begin
  758. if left.resulttype.def.deftype=arraydef then
  759. begin
  760. { done defore (PM) }
  761. end
  762. else if (left.resulttype.def.deftype=stringdef) then
  763. begin
  764. case tstringdef(left.resulttype.def).string_typ of
  765. { it's the same for ansi- and wide strings }
  766. st_widestring,
  767. st_ansistring:
  768. begin
  769. paraloc1:=paramanager.getintparaloc(pocall_default,1);
  770. paraloc2:=paramanager.getintparaloc(pocall_default,2);
  771. paramanager.allocparaloc(exprasmlist,paraloc2);
  772. cg.a_param_reg(exprasmlist,OS_INT,right.location.register,paraloc2);
  773. href:=location.reference;
  774. dec(href.offset,7);
  775. paramanager.allocparaloc(exprasmlist,paraloc1);
  776. cg.a_param_ref(exprasmlist,OS_INT,href,paraloc1);
  777. paramanager.freeparaloc(exprasmlist,paraloc1);
  778. paramanager.freeparaloc(exprasmlist,paraloc2);
  779. cg.allocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  780. cg.a_call_name(exprasmlist,'FPC_'+upper(tstringdef(left.resulttype.def).stringtypname)+'_RANGECHECK');
  781. cg.deallocexplicitregisters(exprasmlist,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
  782. end;
  783. st_shortstring:
  784. begin
  785. {!!!!!!!!!!!!!!!!!}
  786. end;
  787. st_longstring:
  788. begin
  789. {!!!!!!!!!!!!!!!!!}
  790. end;
  791. end;
  792. end;
  793. end;
  794. { insert the register and the multiplication factor in the
  795. reference }
  796. update_reference_reg_mul(right.location.register,mulsize);
  797. end;
  798. location.size:=newsize;
  799. end;
  800. begin
  801. cloadvmtaddrnode:=tcgloadvmtaddrnode;
  802. cloadparentfpnode:=tcgloadparentfpnode;
  803. caddrnode:=tcgaddrnode;
  804. cderefnode:=tcgderefnode;
  805. csubscriptnode:=tcgsubscriptnode;
  806. cwithnode:=tcgwithnode;
  807. cvecnode:=tcgvecnode;
  808. end.
  809. {
  810. $Log$
  811. Revision 1.88 2004-02-27 10:21:05 florian
  812. * top_symbol killed
  813. + refaddr to treference added
  814. + refsymbol to treference added
  815. * top_local stuff moved to an extra record to save memory
  816. + aint introduced
  817. * tppufile.get/putint64/aint implemented
  818. Revision 1.87 2004/02/20 21:55:59 peter
  819. * procvar cleanup
  820. Revision 1.86 2004/02/03 22:32:54 peter
  821. * renamed xNNbittype to xNNinttype
  822. * renamed registers32 to registersint
  823. * replace some s32bit,u32bit with torddef([su]inttype).def.typ
  824. Revision 1.85 2004/01/31 17:45:17 peter
  825. * Change several $ifdef i386 to x86
  826. * Change several OS_32 to OS_INT/OS_ADDR
  827. Revision 1.84 2004/01/12 16:38:50 peter
  828. * don't generate IMUL reg,1
  829. Revision 1.83 2003/12/06 01:15:22 florian
  830. * reverted Peter's alloctemp patch; hopefully properly
  831. Revision 1.82 2003/12/03 23:13:20 peter
  832. * delayed paraloc allocation, a_param_*() gets extra parameter
  833. if it needs to allocate temp or real paralocation
  834. * optimized/simplified int-real loading
  835. Revision 1.81 2003/11/23 17:03:35 peter
  836. * fixed parentfp loading, it was using the offset of the current
  837. nested proc instead of the parent
  838. Revision 1.80 2003/11/04 15:35:13 peter
  839. * fix for referencecounted temps
  840. Revision 1.79 2003/10/10 17:48:13 peter
  841. * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
  842. * tregisteralloctor renamed to trgobj
  843. * removed rgobj from a lot of units
  844. * moved location_* and reference_* to cgobj
  845. * first things for mmx register allocation
  846. Revision 1.78 2003/10/09 21:31:37 daniel
  847. * Register allocator splitted, ans abstract now
  848. Revision 1.77 2003/10/01 20:34:48 peter
  849. * procinfo unit contains tprocinfo
  850. * cginfo renamed to cgbase
  851. * moved cgmessage to verbose
  852. * fixed ppc and sparc compiles
  853. Revision 1.76 2003/09/29 20:58:56 peter
  854. * optimized releasing of registers
  855. Revision 1.75 2003/09/28 21:45:52 peter
  856. * fix register leak in with debug
  857. Revision 1.74 2003/09/28 17:55:03 peter
  858. * parent framepointer changed to hidden parameter
  859. * tloadparentfpnode added
  860. Revision 1.73 2003/09/23 17:56:05 peter
  861. * locals and paras are allocated in the code generation
  862. * tvarsym.localloc contains the location of para/local when
  863. generating code for the current procedure
  864. Revision 1.72 2003/09/10 08:31:47 marco
  865. * Patch from Peter for paraloc
  866. Revision 1.71 2003/09/07 22:09:35 peter
  867. * preparations for different default calling conventions
  868. * various RA fixes
  869. Revision 1.70 2003/09/03 15:55:00 peter
  870. * NEWRA branch merged
  871. Revision 1.69.2.1 2003/08/29 17:28:59 peter
  872. * next batch of updates
  873. Revision 1.69 2003/08/10 17:25:23 peter
  874. * fixed some reported bugs
  875. Revision 1.68 2003/08/09 18:56:54 daniel
  876. * cs_regalloc renamed to cs_regvars to avoid confusion with register
  877. allocator
  878. * Some preventive changes to i386 spillinh code
  879. Revision 1.67 2003/07/23 11:01:14 jonas
  880. * several rg.allocexplicitregistersint/rg.deallocexplicitregistersint
  881. pairs round calls to helpers
  882. Revision 1.66 2003/07/06 21:50:33 jonas
  883. * fixed ppc compilation problems and changed VOLATILE_REGISTERS for x86
  884. so that it doesn't include ebp and esp anymore
  885. Revision 1.65 2003/07/06 15:31:20 daniel
  886. * Fixed register allocator. *Lots* of fixes.
  887. Revision 1.64 2003/06/17 19:24:08 jonas
  888. * fixed conversion of fpc_*str_unique to compilerproc
  889. Revision 1.63 2003/06/17 16:34:44 jonas
  890. * lots of newra fixes (need getfuncretparaloc implementation for i386)!
  891. * renamed all_intregisters to paramanager.get_volatile_registers_int(pocall_default) and made it
  892. processor dependent
  893. Revision 1.62 2003/06/13 21:19:30 peter
  894. * current_procdef removed, use current_procinfo.procdef instead
  895. Revision 1.61 2003/06/09 16:45:41 jonas
  896. * fixed update_reference_reg_mul() so that it won't modify CREGISTERs
  897. in a reference
  898. * cache value of get_mul_size()
  899. * if get_mul_size = 1, the index can be a CREGISTER since it won't be
  900. modified
  901. Revision 1.60 2003/06/07 18:57:04 jonas
  902. + added freeintparaloc
  903. * ppc get/freeintparaloc now check whether the parameter regs are
  904. properly allocated/deallocated (and get an extra list para)
  905. * ppc a_call_* now internalerrors if pi_do_call is not yet set
  906. * fixed lot of missing pi_do_call's
  907. Revision 1.59 2003/06/03 21:11:09 peter
  908. * cg.a_load_* get a from and to size specifier
  909. * makeregsize only accepts newregister
  910. * i386 uses generic tcgnotnode,tcgunaryminus
  911. Revision 1.58 2003/06/03 13:01:59 daniel
  912. * Register allocator finished
  913. Revision 1.57 2003/06/02 22:35:45 florian
  914. * better handling of CREGISTER in subscript nodes
  915. Revision 1.56 2003/06/01 21:38:06 peter
  916. * getregisterfpu size parameter added
  917. * op_const_reg size parameter added
  918. * sparc updates
  919. Revision 1.55 2003/05/30 23:49:18 jonas
  920. * a_load_loc_reg now has an extra size parameter for the destination
  921. register (properly fixes what I worked around in revision 1.106 of
  922. ncgutil.pas)
  923. Revision 1.54 2003/05/15 16:10:37 florian
  924. * fixed getintparaloc call for ansi- and widestring range checking
  925. Revision 1.53 2003/05/11 21:37:03 peter
  926. * moved implicit exception frame from ncgutil to psub
  927. * constructor/destructor helpers moved from cobj/ncgutil to psub
  928. Revision 1.52 2003/05/11 14:45:12 peter
  929. * tloadnode does not support objectsymtable,withsymtable anymore
  930. * withnode cleanup
  931. * direct with rewritten to use temprefnode
  932. Revision 1.51 2003/05/09 17:47:02 peter
  933. * self moved to hidden parameter
  934. * removed hdisposen,hnewn,selfn
  935. Revision 1.50 2003/05/07 09:16:23 mazen
  936. - non used units removed from uses clause
  937. Revision 1.49 2003/04/27 11:21:33 peter
  938. * aktprocdef renamed to current_procinfo.procdef
  939. * procinfo renamed to current_procinfo
  940. * procinfo will now be stored in current_module so it can be
  941. cleaned up properly
  942. * gen_main_procsym changed to create_main_proc and release_main_proc
  943. to also generate a tprocinfo structure
  944. * fixed unit implicit initfinal
  945. Revision 1.48 2003/04/22 23:50:22 peter
  946. * firstpass uses expectloc
  947. * checks if there are differences between the expectloc and
  948. location.loc from secondpass in EXTDEBUG
  949. Revision 1.47 2003/04/22 13:47:08 peter
  950. * fixed C style array of const
  951. * fixed C array passing
  952. * fixed left to right with high parameters
  953. Revision 1.46 2003/04/22 10:09:35 daniel
  954. + Implemented the actual register allocator
  955. + Scratch registers unavailable when new register allocator used
  956. + maybe_save/maybe_restore unavailable when new register allocator used
  957. Revision 1.45 2003/04/06 21:11:23 olle
  958. * changed newasmsymbol to newasmsymboldata for data symbols
  959. Revision 1.44 2003/03/28 19:16:56 peter
  960. * generic constructor working for i386
  961. * remove fixed self register
  962. * esi added as address register for i386
  963. Revision 1.43 2003/03/12 22:43:38 jonas
  964. * more powerpc and generic fixes related to the new register allocator
  965. Revision 1.42 2003/02/19 22:00:14 daniel
  966. * Code generator converted to new register notation
  967. - Horribily outdated todo.txt removed
  968. Revision 1.41 2003/01/30 21:46:57 peter
  969. * self fixes for static methods (merged)
  970. Revision 1.40 2003/01/08 18:43:56 daniel
  971. * Tregister changed into a record
  972. Revision 1.39 2002/12/20 18:13:19 peter
  973. * no rangecheck for openarrays with cdecl
  974. Revision 1.38 2002/12/17 22:19:33 peter
  975. * fixed pushing of records>8 bytes with stdcall
  976. * simplified hightree loading
  977. Revision 1.37 2002/12/08 13:39:03 carl
  978. + some documentation added
  979. Revision 1.36 2002/12/07 14:14:19 carl
  980. * bugfix on invalid typecast
  981. Revision 1.35 2002/11/25 17:43:18 peter
  982. * splitted defbase in defutil,symutil,defcmp
  983. * merged isconvertable and is_equal into compare_defs(_ext)
  984. * made operator search faster by walking the list only once
  985. Revision 1.34 2002/11/24 18:19:20 carl
  986. + checkpointer for interfaces also
  987. Revision 1.33 2002/11/23 22:50:06 carl
  988. * some small speed optimizations
  989. + added several new warnings/hints
  990. Revision 1.32 2002/11/15 01:58:51 peter
  991. * merged changes from 1.0.7 up to 04-11
  992. - -V option for generating bug report tracing
  993. - more tracing for option parsing
  994. - errors for cdecl and high()
  995. - win32 import stabs
  996. - win32 records<=8 are returned in eax:edx (turned off by default)
  997. - heaptrc update
  998. - more info for temp management in .s file with EXTDEBUG
  999. Revision 1.31 2002/10/09 20:24:47 florian
  1000. + range checking for dyn. arrays
  1001. Revision 1.30 2002/10/07 21:30:45 peter
  1002. * rangecheck for open arrays added
  1003. Revision 1.29 2002/10/05 12:43:25 carl
  1004. * fixes for Delphi 6 compilation
  1005. (warning : Some features do not work under Delphi)
  1006. Revision 1.28 2002/09/17 18:54:02 jonas
  1007. * a_load_reg_reg() now has two size parameters: source and dest. This
  1008. allows some optimizations on architectures that don't encode the
  1009. register size in the register name.
  1010. Revision 1.27 2002/09/07 15:25:03 peter
  1011. * old logs removed and tabs fixed
  1012. Revision 1.26 2002/09/01 18:46:01 peter
  1013. * fixed generic tcgvecnode
  1014. * move code that updates a reference with index register and multiplier
  1015. to separate method so it can be overriden for scaled indexing
  1016. * i386 uses generic tcgvecnode
  1017. Revision 1.25 2002/08/23 16:14:48 peter
  1018. * tempgen cleanup
  1019. * tt_noreuse temp type added that will be used in genentrycode
  1020. Revision 1.24 2002/08/15 08:13:54 carl
  1021. - a_load_sym_ofs_reg removed
  1022. * loadvmt now calls loadaddr_ref_reg instead
  1023. Revision 1.23 2002/08/11 14:32:26 peter
  1024. * renamed current_library to objectlibrary
  1025. Revision 1.22 2002/08/11 13:24:12 peter
  1026. * saving of asmsymbols in ppu supported
  1027. * asmsymbollist global is removed and moved into a new class
  1028. tasmlibrarydata that will hold the info of a .a file which
  1029. corresponds with a single module. Added librarydata to tmodule
  1030. to keep the library info stored for the module. In the future the
  1031. objectfiles will also be stored to the tasmlibrarydata class
  1032. * all getlabel/newasmsymbol and friends are moved to the new class
  1033. Revision 1.21 2002/08/11 11:36:57 jonas
  1034. * always first try to use base and only then index
  1035. Revision 1.20 2002/08/11 06:14:40 florian
  1036. * fixed powerpc compilation problems
  1037. Revision 1.19 2002/08/10 14:46:29 carl
  1038. + moved target_cpu_string to cpuinfo
  1039. * renamed asmmode enum.
  1040. * assembler reader has now less ifdef's
  1041. * move from nppcmem.pas -> ncgmem.pas vec. node.
  1042. Revision 1.18 2002/07/28 21:34:31 florian
  1043. * more powerpc fixes
  1044. + dummy tcgvecnode
  1045. Revision 1.17 2002/07/11 14:41:28 florian
  1046. * start of the new generic parameter handling
  1047. Revision 1.16 2002/07/07 09:52:32 florian
  1048. * powerpc target fixed, very simple units can be compiled
  1049. * some basic stuff for better callparanode handling, far from being finished
  1050. Revision 1.15 2002/07/01 18:46:23 peter
  1051. * internal linker
  1052. * reorganized aasm layer
  1053. Revision 1.14 2002/07/01 16:23:53 peter
  1054. * cg64 patch
  1055. * basics for currency
  1056. * asnode updates for class and interface (not finished)
  1057. Revision 1.13 2002/05/20 13:30:40 carl
  1058. * bugfix of hdisponen (base must be set, not index)
  1059. * more portability fixes
  1060. Revision 1.12 2002/05/18 13:34:09 peter
  1061. * readded missing revisions
  1062. Revision 1.11 2002/05/16 19:46:37 carl
  1063. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  1064. + try to fix temp allocation (still in ifdef)
  1065. + generic constructor calls
  1066. + start of tassembler / tmodulebase class cleanup
  1067. Revision 1.9 2002/05/12 16:53:07 peter
  1068. * moved entry and exitcode to ncgutil and cgobj
  1069. * foreach gets extra argument for passing local data to the
  1070. iterator function
  1071. * -CR checks also class typecasts at runtime by changing them
  1072. into as
  1073. * fixed compiler to cycle with the -CR option
  1074. * fixed stabs with elf writer, finally the global variables can
  1075. be watched
  1076. * removed a lot of routines from cga unit and replaced them by
  1077. calls to cgobj
  1078. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  1079. u32bit then the other is typecasted also to u32bit without giving
  1080. a rangecheck warning/error.
  1081. * fixed pascal calling method with reversing also the high tree in
  1082. the parast, detected by tcalcst3 test
  1083. Revision 1.8 2002/04/20 21:32:23 carl
  1084. + generic FPC_CHECKPOINTER
  1085. + first parameter offset in stack now portable
  1086. * rename some constants
  1087. + move some cpu stuff to other units
  1088. - remove unused constents
  1089. * fix stacksize for some targets
  1090. * fix generic size problems which depend now on EXTEND_SIZE constant
  1091. Revision 1.7 2002/04/15 18:58:47 carl
  1092. + target_info.size_of_pointer -> pointer_Size
  1093. Revision 1.6 2002/04/04 19:05:57 peter
  1094. * removed unused units
  1095. * use tlocation.size in cg.a_*loc*() routines
  1096. }