ncgcnv.pas 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  1. {
  2. $Id$
  3. Copyright (c) 2000-2002 by Florian Klaempfl
  4. Generate assembler for nodes that handle type conversions 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. unit ncgcnv;
  20. {$i fpcdefs.inc}
  21. interface
  22. uses
  23. node,ncnv,defutil,defcmp;
  24. type
  25. tcgtypeconvnode = class(ttypeconvnode)
  26. procedure second_int_to_int;override;
  27. procedure second_cstring_to_pchar;override;
  28. procedure second_string_to_chararray;override;
  29. procedure second_array_to_pointer;override;
  30. procedure second_pointer_to_array;override;
  31. procedure second_char_to_string;override;
  32. procedure second_real_to_real;override;
  33. procedure second_cord_to_pointer;override;
  34. procedure second_proc_to_procvar;override;
  35. procedure second_bool_to_int;override;
  36. procedure second_bool_to_bool;override;
  37. procedure second_ansistring_to_pchar;override;
  38. procedure second_class_to_intf;override;
  39. procedure second_char_to_char;override;
  40. procedure second_nothing;override;
  41. procedure pass_2;override;
  42. end;
  43. tcgasnode = class(tasnode)
  44. procedure pass_2;override;
  45. end;
  46. implementation
  47. uses
  48. cutils,verbose,globtype,globals,
  49. aasmbase,aasmtai,aasmcpu,symconst,symdef,paramgr,
  50. ncon,ncal,
  51. cpubase,cpuinfo,systems,
  52. pass_2,
  53. procinfo,cgbase,
  54. cgutils,cgobj,
  55. ncgutil,
  56. tgobj
  57. ;
  58. procedure tcgtypeconvnode.second_int_to_int;
  59. var
  60. newsize : tcgsize;
  61. ressize,
  62. leftsize : longint;
  63. begin
  64. newsize:=def_cgsize(resulttype.def);
  65. { insert range check if not explicit conversion }
  66. if not(nf_explicit in flags) then
  67. cg.g_rangecheck(exprasmlist,left.location,left.resulttype.def,resulttype.def);
  68. { is the result size smaller? when typecasting from void
  69. we always reuse the current location, because there is
  70. nothing that we can load in a register }
  71. ressize := resulttype.def.size;
  72. leftsize := left.resulttype.def.size;
  73. if (ressize<>leftsize) and
  74. not is_void(left.resulttype.def) then
  75. begin
  76. location_copy(location,left.location);
  77. { reuse a loc_reference when the newsize is smaller than
  78. than the original, else load it to a register }
  79. if (location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) and
  80. (ressize<leftsize) then
  81. begin
  82. location.size:=newsize;
  83. if (target_info.endian = ENDIAN_BIG) then
  84. inc(location.reference.offset,leftsize-ressize);
  85. end
  86. else
  87. location_force_reg(exprasmlist,location,newsize,false);
  88. end
  89. else
  90. begin
  91. { no special loading is required, reuse current location }
  92. location_copy(location,left.location);
  93. location.size:=newsize;
  94. end;
  95. end;
  96. procedure tcgtypeconvnode.second_cstring_to_pchar;
  97. var
  98. hr : treference;
  99. begin
  100. location_release(exprasmlist,left.location);
  101. location_reset(location,LOC_REGISTER,OS_ADDR);
  102. case tstringdef(left.resulttype.def).string_typ of
  103. st_shortstring :
  104. begin
  105. inc(left.location.reference.offset);
  106. location.register:=cg.getaddressregister(exprasmlist);
  107. cg.a_loadaddr_ref_reg(exprasmlist,left.location.reference,location.register);
  108. end;
  109. {$ifdef ansistring_bits}
  110. st_ansistring16,st_ansistring32,st_ansistring64 :
  111. {$else}
  112. st_ansistring :
  113. {$endif}
  114. begin
  115. if (left.nodetype=stringconstn) and
  116. (str_length(left)=0) then
  117. begin
  118. reference_reset(hr);
  119. hr.symbol:=objectlibrary.newasmsymbol('FPC_EMPTYCHAR',AB_EXTERNAL,AT_DATA);
  120. location.register:=cg.getaddressregister(exprasmlist);
  121. cg.a_loadaddr_ref_reg(exprasmlist,hr,location.register);
  122. end
  123. else
  124. begin
  125. location.register:=cg.getaddressregister(exprasmlist);
  126. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.reference,location.register);
  127. end;
  128. end;
  129. st_longstring:
  130. begin
  131. {!!!!!!!}
  132. internalerror(8888);
  133. end;
  134. st_widestring:
  135. begin
  136. if (left.nodetype=stringconstn) and
  137. (str_length(left)=0) then
  138. begin
  139. reference_reset(hr);
  140. hr.symbol:=objectlibrary.newasmsymbol('FPC_EMPTYCHAR',AB_EXTERNAL,AT_DATA);
  141. location.register:=cg.getaddressregister(exprasmlist);
  142. cg.a_loadaddr_ref_reg(exprasmlist,hr,location.register);
  143. end
  144. else
  145. begin
  146. location.register:=cg.getintregister(exprasmlist,OS_INT);
  147. {$ifdef fpc}
  148. {$warning Todo: convert widestrings to ascii when typecasting them to pchars}
  149. {$endif}
  150. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_INT,left.location.reference,
  151. location.register);
  152. end;
  153. end;
  154. end;
  155. end;
  156. procedure tcgtypeconvnode.second_string_to_chararray;
  157. var
  158. arrsize: longint;
  159. begin
  160. with tarraydef(resulttype.def) do
  161. arrsize := highrange-lowrange+1;
  162. if (left.nodetype = stringconstn) and
  163. { left.length+1 since there's always a terminating #0 character (JM) }
  164. (tstringconstnode(left).len+1 >= arrsize) and
  165. (tstringdef(left.resulttype.def).string_typ=st_shortstring) then
  166. begin
  167. location_copy(location,left.location);
  168. inc(location.reference.offset);
  169. exit;
  170. end
  171. else
  172. { should be handled already in resulttype pass (JM) }
  173. internalerror(200108292);
  174. end;
  175. procedure tcgtypeconvnode.second_array_to_pointer;
  176. begin
  177. location_release(exprasmlist,left.location);
  178. location_reset(location,LOC_REGISTER,OS_ADDR);
  179. location.register:=cg.getaddressregister(exprasmlist);
  180. cg.a_loadaddr_ref_reg(exprasmlist,left.location.reference,location.register);
  181. end;
  182. procedure tcgtypeconvnode.second_pointer_to_array;
  183. begin
  184. location_reset(location,LOC_REFERENCE,OS_NO);
  185. case left.location.loc of
  186. LOC_REGISTER :
  187. begin
  188. {$ifdef cpu_uses_separate_address_registers}
  189. if getregtype(left.location.register)<>R_ADDRESSREGISTER then
  190. begin
  191. location_release(exprasmlist,left.location);
  192. location.reference.base:=rg.getaddressregister(exprasmlist);
  193. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,
  194. left.location.register,location.reference.base);
  195. end
  196. else
  197. {$endif}
  198. location.reference.base := left.location.register;
  199. end;
  200. LOC_CREGISTER :
  201. begin
  202. location.reference.base:=cg.getaddressregister(exprasmlist);
  203. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.register,
  204. location.reference.base);
  205. end;
  206. LOC_REFERENCE,
  207. LOC_CREFERENCE :
  208. begin
  209. location_release(exprasmlist,left.location);
  210. location.reference.base:=cg.getaddressregister(exprasmlist);
  211. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.reference,
  212. location.reference.base);
  213. location_freetemp(exprasmlist,left.location);
  214. end;
  215. else
  216. internalerror(2002032216);
  217. end;
  218. end;
  219. procedure tcgtypeconvnode.second_char_to_string;
  220. begin
  221. location_reset(location,LOC_REFERENCE,OS_NO);
  222. case tstringdef(resulttype.def).string_typ of
  223. st_shortstring :
  224. begin
  225. location_release(exprasmlist,left.location);
  226. tg.GetTemp(exprasmlist,256,tt_normal,location.reference);
  227. cg.a_load_loc_ref(exprasmlist,left.location.size,left.location,
  228. location.reference);
  229. location_freetemp(exprasmlist,left.location);
  230. end;
  231. { the rest is removed in the resulttype pass and converted to compilerprocs }
  232. else
  233. internalerror(4179);
  234. end;
  235. end;
  236. procedure tcgtypeconvnode.second_real_to_real;
  237. begin
  238. location_reset(location,LOC_FPUREGISTER,def_cgsize(resulttype.def));
  239. case left.location.loc of
  240. LOC_FPUREGISTER,
  241. LOC_CFPUREGISTER:
  242. begin
  243. location_copy(location,left.location);
  244. location.size:=def_cgsize(resulttype.def);
  245. case expectloc of
  246. LOC_FPUREGISTER:
  247. ;
  248. LOC_MMREGISTER:
  249. location_force_mmregscalar(exprasmlist,location,false);
  250. else
  251. internalerror(2003012262);
  252. end;
  253. exit
  254. end;
  255. LOC_CREFERENCE,
  256. LOC_REFERENCE:
  257. begin
  258. location_release(exprasmlist,left.location);
  259. location.register:=cg.getfpuregister(exprasmlist,left.location.size);
  260. cg.a_loadfpu_loc_reg(exprasmlist,left.location,location.register);
  261. location_freetemp(exprasmlist,left.location);
  262. end;
  263. LOC_MMREGISTER,
  264. LOC_CMMREGISTER:
  265. begin
  266. location_copy(location,left.location);
  267. case expectloc of
  268. LOC_FPUREGISTER:
  269. begin
  270. location_force_fpureg(exprasmlist,location,false);
  271. location.size:=def_cgsize(resulttype.def);
  272. end;
  273. LOC_MMREGISTER:
  274. ;
  275. else
  276. internalerror(2003012261);
  277. end;
  278. end;
  279. else
  280. internalerror(2002032215);
  281. end;
  282. end;
  283. procedure tcgtypeconvnode.second_cord_to_pointer;
  284. begin
  285. { this can't happen because constants are already processed in
  286. pass 1 }
  287. internalerror(47423985);
  288. end;
  289. procedure tcgtypeconvnode.second_proc_to_procvar;
  290. begin
  291. { method pointer ? }
  292. if tabstractprocdef(left.resulttype.def).is_methodpointer and
  293. not(tabstractprocdef(left.resulttype.def).is_addressonly) then
  294. begin
  295. location_copy(location,left.location);
  296. end
  297. else
  298. begin
  299. location_release(exprasmlist,left.location);
  300. location_reset(location,LOC_REGISTER,OS_ADDR);
  301. location.register:=cg.getaddressregister(exprasmlist);
  302. cg.a_loadaddr_ref_reg(exprasmlist,left.location.reference,location.register);
  303. end;
  304. end;
  305. procedure tcgtypeconvnode.second_bool_to_int;
  306. var
  307. oldtruelabel,oldfalselabel : tasmlabel;
  308. begin
  309. oldtruelabel:=truelabel;
  310. oldfalselabel:=falselabel;
  311. objectlibrary.getlabel(truelabel);
  312. objectlibrary.getlabel(falselabel);
  313. secondpass(left);
  314. location_copy(location,left.location);
  315. { byte(boolean) or word(wordbool) or longint(longbool) must }
  316. { be accepted for var parameters }
  317. if not((nf_explicit in flags) and
  318. (left.resulttype.def.size=resulttype.def.size) and
  319. (left.location.loc in [LOC_REFERENCE,LOC_CREFERENCE,LOC_CREGISTER])) then
  320. location_force_reg(exprasmlist,location,def_cgsize(resulttype.def),false);
  321. truelabel:=oldtruelabel;
  322. falselabel:=oldfalselabel;
  323. end;
  324. procedure tcgtypeconvnode.second_bool_to_bool;
  325. begin
  326. { we can reuse the conversion already available
  327. in bool_to_int to resize the value. But when the
  328. size of the new boolean is smaller we need to calculate
  329. the value as is done in int_to_bool. This is needed because
  330. the bits that define the true status can be outside the limits
  331. of the new size and truncating the register can result in a 0
  332. value }
  333. if resulttype.def.size<left.resulttype.def.size then
  334. second_int_to_bool
  335. else
  336. second_bool_to_int;
  337. end;
  338. procedure tcgtypeconvnode.second_ansistring_to_pchar;
  339. var
  340. l1 : tasmlabel;
  341. hr : treference;
  342. begin
  343. location_reset(location,LOC_REGISTER,OS_ADDR);
  344. objectlibrary.getlabel(l1);
  345. case left.location.loc of
  346. LOC_CREGISTER,LOC_REGISTER:
  347. begin
  348. {$ifdef cpu_uses_separate_address_registers}
  349. if getregtype(left.location.register)<>R_ADDRESSREGISTER then
  350. begin
  351. location_release(exprasmlist,left.location);
  352. location.register:=cg.getaddressregister(exprasmlist);
  353. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,
  354. left.location.register,location.register);
  355. end
  356. else
  357. {$endif}
  358. location.register := left.location.register;
  359. end;
  360. LOC_CREFERENCE,LOC_REFERENCE:
  361. begin
  362. location_release(exprasmlist,left.location);
  363. location.register:=cg.getaddressregister(exprasmlist);
  364. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.reference,location.register);
  365. location_freetemp(exprasmlist,left.location);
  366. end;
  367. else
  368. internalerror(2002032214);
  369. end;
  370. cg.a_cmp_const_reg_label(exprasmlist,OS_ADDR,OC_NE,0,location.register,l1);
  371. reference_reset(hr);
  372. hr.symbol:=objectlibrary.newasmsymbol('FPC_EMPTYCHAR',AB_EXTERNAL,AT_DATA);
  373. cg.a_loadaddr_ref_reg(exprasmlist,hr,location.register);
  374. cg.a_label(exprasmlist,l1);
  375. end;
  376. procedure tcgtypeconvnode.second_class_to_intf;
  377. var
  378. l1 : tasmlabel;
  379. hd : tobjectdef;
  380. begin
  381. location_reset(location,LOC_REGISTER,OS_ADDR);
  382. case left.location.loc of
  383. LOC_CREFERENCE,
  384. LOC_REFERENCE:
  385. begin
  386. location_release(exprasmlist,left.location);
  387. location.register:=cg.getaddressregister(exprasmlist);
  388. cg.a_load_ref_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.reference,location.register);
  389. location_freetemp(exprasmlist,left.location);
  390. end;
  391. LOC_CREGISTER:
  392. begin
  393. location.register:=cg.getaddressregister(exprasmlist);
  394. cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,left.location.register,location.register);
  395. end;
  396. LOC_REGISTER:
  397. location.register:=left.location.register;
  398. else
  399. internalerror(121120001);
  400. end;
  401. objectlibrary.getlabel(l1);
  402. cg.a_cmp_const_reg_label(exprasmlist,OS_ADDR,OC_EQ,0,location.register,l1);
  403. hd:=tobjectdef(left.resulttype.def);
  404. while assigned(hd) do
  405. begin
  406. if hd.implementedinterfaces.searchintf(resulttype.def)<>-1 then
  407. begin
  408. cg.a_op_const_reg(exprasmlist,OP_ADD,OS_ADDR,aword(
  409. hd.implementedinterfaces.ioffsets(
  410. hd.implementedinterfaces.searchintf(resulttype.def))^),location.register);
  411. break;
  412. end;
  413. hd:=hd.childof;
  414. end;
  415. if hd=nil then
  416. internalerror(2002081301);
  417. cg.a_label(exprasmlist,l1);
  418. end;
  419. procedure tcgtypeconvnode.second_char_to_char;
  420. begin
  421. {$ifdef fpc}
  422. {$warning todo: add RTL routine for widechar-char conversion }
  423. {$endif}
  424. { Quick hack to at least generate 'working' code (PFV) }
  425. second_int_to_int;
  426. end;
  427. procedure tcgtypeconvnode.second_nothing;
  428. begin
  429. { we reuse the old value }
  430. location_copy(location,left.location);
  431. { Floats should never be returned as LOC_CONSTANT, do the
  432. moving to memory before the new size is set }
  433. if (resulttype.def.deftype=floatdef) and
  434. (location.loc=LOC_CONSTANT) then
  435. location_force_mem(exprasmlist,location);
  436. { but use the new size, but we don't know the size of all arrays }
  437. location.size:=def_cgsize(resulttype.def);
  438. end;
  439. {$ifdef TESTOBJEXT2}
  440. procedure tcgtypeconvnode.checkobject;
  441. begin
  442. { no checking by default }
  443. end;
  444. {$endif TESTOBJEXT2}
  445. procedure tcgtypeconvnode.pass_2;
  446. begin
  447. { the boolean routines can be called with LOC_JUMP and
  448. call secondpass themselves in the helper }
  449. if not(convtype in [tc_bool_2_int,tc_bool_2_bool,tc_int_2_bool]) then
  450. begin
  451. secondpass(left);
  452. if codegenerror then
  453. exit;
  454. end;
  455. second_call_helper(convtype);
  456. {$ifdef TESTOBJEXT2}
  457. { Check explicit conversions to objects pointers !! }
  458. if p^.explizit and
  459. (p^.resulttype.def.deftype=pointerdef) and
  460. (tpointerdef(p^.resulttype.def).definition.deftype=objectdef) and not
  461. (tobjectdef(tpointerdef(p^.resulttype.def).definition).isclass) and
  462. ((tobjectdef(tpointerdef(p^.resulttype.def).definition).options and oo_hasvmt)<>0) and
  463. (cs_check_range in aktlocalswitches) then
  464. checkobject;
  465. {$endif TESTOBJEXT2}
  466. end;
  467. procedure tcgasnode.pass_2;
  468. begin
  469. secondpass(call);
  470. location_copy(location,call.location);
  471. end;
  472. begin
  473. ctypeconvnode := tcgtypeconvnode;
  474. casnode := tcgasnode;
  475. end.
  476. {
  477. $Log$
  478. Revision 1.57 2004-04-29 19:56:37 daniel
  479. * Prepare compiler infrastructure for multiple ansistring types
  480. Revision 1.56 2004/03/02 00:36:33 olle
  481. * big transformation of Tai_[const_]Symbol.Create[data]name*
  482. Revision 1.55 2004/02/27 10:21:05 florian
  483. * top_symbol killed
  484. + refaddr to treference added
  485. + refsymbol to treference added
  486. * top_local stuff moved to an extra record to save memory
  487. + aint introduced
  488. * tppufile.get/putint64/aint implemented
  489. Revision 1.54 2004/02/05 01:24:08 florian
  490. * several fixes to compile x86-64 system
  491. Revision 1.53 2004/01/31 17:45:17 peter
  492. * Change several $ifdef i386 to x86
  493. * Change several OS_32 to OS_INT/OS_ADDR
  494. Revision 1.52 2003/12/26 00:32:21 florian
  495. + fpu<->mm register conversion
  496. Revision 1.51 2003/12/22 23:08:59 peter
  497. * removed unused checkobject method
  498. Revision 1.50 2003/11/04 22:30:15 florian
  499. + type cast variant<->enum
  500. * cnv. node second pass uses now as well helper wrappers
  501. Revision 1.49 2003/10/10 17:48:13 peter
  502. * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
  503. * tregisteralloctor renamed to trgobj
  504. * removed rgobj from a lot of units
  505. * moved location_* and reference_* to cgobj
  506. * first things for mmx register allocation
  507. Revision 1.48 2003/10/09 21:31:37 daniel
  508. * Register allocator splitted, ans abstract now
  509. Revision 1.47 2003/10/01 20:34:48 peter
  510. * procinfo unit contains tprocinfo
  511. * cginfo renamed to cgbase
  512. * moved cgmessage to verbose
  513. * fixed ppc and sparc compiles
  514. Revision 1.46 2003/09/28 13:39:38 peter
  515. * optimized releasing of registers
  516. Revision 1.45 2003/08/26 12:43:02 peter
  517. * methodpointer fixes
  518. Revision 1.44 2003/06/03 21:11:09 peter
  519. * cg.a_load_* get a from and to size specifier
  520. * makeregsize only accepts newregister
  521. * i386 uses generic tcgnotnode,tcgunaryminus
  522. Revision 1.43 2003/06/01 21:38:06 peter
  523. * getregisterfpu size parameter added
  524. * op_const_reg size parameter added
  525. * sparc updates
  526. Revision 1.42 2003/05/25 09:27:13 jonas
  527. - undid previous patch, it was not necessary and on top of that, it
  528. contained a bug :/
  529. Revision 1.40 2003/05/23 14:27:35 peter
  530. * remove some unit dependencies
  531. * current_procinfo changes to store more info
  532. Revision 1.39 2003/04/22 23:50:22 peter
  533. * firstpass uses expectloc
  534. * checks if there are differences between the expectloc and
  535. location.loc from secondpass in EXTDEBUG
  536. Revision 1.38 2003/04/06 21:11:23 olle
  537. * changed newasmsymbol to newasmsymboldata for data symbols
  538. Revision 1.37 2003/03/28 19:16:56 peter
  539. * generic constructor working for i386
  540. * remove fixed self register
  541. * esi added as address register for i386
  542. Revision 1.36 2003/02/19 22:00:14 daniel
  543. * Code generator converted to new register notation
  544. - Horribily outdated todo.txt removed
  545. Revision 1.35 2003/01/02 22:20:51 peter
  546. * fix typecasts from void to int
  547. Revision 1.34 2002/11/25 17:43:17 peter
  548. * splitted defbase in defutil,symutil,defcmp
  549. * merged isconvertable and is_equal into compare_defs(_ext)
  550. * made operator search faster by walking the list only once
  551. Revision 1.33 2002/10/05 12:43:25 carl
  552. * fixes for Delphi 6 compilation
  553. (warning : Some features do not work under Delphi)
  554. Revision 1.32 2002/09/17 18:54:02 jonas
  555. * a_load_reg_reg() now has two size parameters: source and dest. This
  556. allows some optimizations on architectures that don't encode the
  557. register size in the register name.
  558. Revision 1.31 2002/09/16 13:08:44 jonas
  559. * big endian fix for second_int_to_int
  560. Revision 1.30 2002/09/07 15:25:02 peter
  561. * old logs removed and tabs fixed
  562. Revision 1.29 2002/09/02 18:46:00 peter
  563. * reuse a reference when resizing ordinal values to smaller sizes,
  564. this is required for constructions like byte(w):=1 that are
  565. allowed in tp mode only
  566. Revision 1.28 2002/08/25 09:06:58 peter
  567. * add calls to release temps
  568. Revision 1.27 2002/08/23 16:14:48 peter
  569. * tempgen cleanup
  570. * tt_noreuse temp type added that will be used in genentrycode
  571. Revision 1.26 2002/08/20 18:23:32 jonas
  572. * the as node again uses a compilerproc
  573. + (untested) support for interface "as" statements
  574. Revision 1.25 2002/08/13 18:01:52 carl
  575. * rename swatoperands to swapoperands
  576. + m68k first compilable version (still needs a lot of testing):
  577. assembler generator, system information , inline
  578. assembler reader.
  579. Revision 1.24 2002/08/12 20:39:17 florian
  580. * casting of classes to interface fixed when the interface was
  581. implemented by a parent class
  582. Revision 1.23 2002/08/11 14:32:26 peter
  583. * renamed current_library to objectlibrary
  584. Revision 1.22 2002/08/11 13:24:11 peter
  585. * saving of asmsymbols in ppu supported
  586. * asmsymbollist global is removed and moved into a new class
  587. tasmlibrarydata that will hold the info of a .a file which
  588. corresponds with a single module. Added librarydata to tmodule
  589. to keep the library info stored for the module. In the future the
  590. objectfiles will also be stored to the tasmlibrarydata class
  591. * all getlabel/newasmsymbol and friends are moved to the new class
  592. Revision 1.21 2002/07/20 11:57:53 florian
  593. * types.pas renamed to defbase.pas because D6 contains a types
  594. unit so this would conflicts if D6 programms are compiled
  595. + Willamette/SSE2 instructions to assembler added
  596. Revision 1.20 2002/07/11 14:41:28 florian
  597. * start of the new generic parameter handling
  598. Revision 1.19 2002/07/07 09:52:32 florian
  599. * powerpc target fixed, very simple units can be compiled
  600. * some basic stuff for better callparanode handling, far from being finished
  601. Revision 1.18 2002/07/04 20:43:01 florian
  602. * first x86-64 patches
  603. Revision 1.17 2002/07/01 18:46:22 peter
  604. * internal linker
  605. * reorganized aasm layer
  606. Revision 1.16 2002/07/01 16:23:53 peter
  607. * cg64 patch
  608. * basics for currency
  609. * asnode updates for class and interface (not finished)
  610. Revision 1.15 2002/05/18 13:34:09 peter
  611. * readded missing revisions
  612. Revision 1.14 2002/05/16 19:46:37 carl
  613. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  614. + try to fix temp allocation (still in ifdef)
  615. + generic constructor calls
  616. + start of tassembler / tmodulebase class cleanup
  617. Revision 1.12 2002/05/12 16:53:07 peter
  618. * moved entry and exitcode to ncgutil and cgobj
  619. * foreach gets extra argument for passing local data to the
  620. iterator function
  621. * -CR checks also class typecasts at runtime by changing them
  622. into as
  623. * fixed compiler to cycle with the -CR option
  624. * fixed stabs with elf writer, finally the global variables can
  625. be watched
  626. * removed a lot of routines from cga unit and replaced them by
  627. calls to cgobj
  628. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  629. u32bit then the other is typecasted also to u32bit without giving
  630. a rangecheck warning/error.
  631. * fixed pascal calling method with reversing also the high tree in
  632. the parast, detected by tcalcst3 test
  633. Revision 1.11 2002/04/21 19:02:03 peter
  634. * removed newn and disposen nodes, the code is now directly
  635. inlined from pexpr
  636. * -an option that will write the secondpass nodes to the .s file, this
  637. requires EXTDEBUG define to actually write the info
  638. * fixed various internal errors and crashes due recent code changes
  639. Revision 1.10 2002/04/19 15:39:34 peter
  640. * removed some more routines from cga
  641. * moved location_force_reg/mem to ncgutil
  642. * moved arrayconstructnode secondpass to ncgld
  643. Revision 1.9 2002/04/15 19:44:19 peter
  644. * fixed stackcheck that would be called recursively when a stack
  645. error was found
  646. * generic changeregsize(reg,size) for i386 register resizing
  647. * removed some more routines from cga unit
  648. * fixed returnvalue handling
  649. * fixed default stacksize of linux and go32v2, 8kb was a bit small :-)
  650. }