ncgcon.pas 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Generate assembler for constant nodes which are the same for
  5. 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 ncgcon;
  20. {$i fpcdefs.inc}
  21. interface
  22. uses
  23. node,ncon;
  24. type
  25. tcgrealconstnode = class(trealconstnode)
  26. procedure pass_2;override;
  27. end;
  28. tcgordconstnode = class(tordconstnode)
  29. procedure pass_2;override;
  30. end;
  31. tcgpointerconstnode = class(tpointerconstnode)
  32. procedure pass_2;override;
  33. end;
  34. tcgstringconstnode = class(tstringconstnode)
  35. procedure pass_2;override;
  36. end;
  37. tcgsetconstnode = class(tsetconstnode)
  38. procedure pass_2;override;
  39. end;
  40. tcgnilnode = class(tnilnode)
  41. procedure pass_2;override;
  42. end;
  43. tcgguidconstnode = class(tguidconstnode)
  44. procedure pass_2;override;
  45. end;
  46. implementation
  47. uses
  48. globtype,widestr,systems,
  49. verbose,globals,
  50. symconst,symdef,aasmbase,aasmtai,aasmcpu,defutil,
  51. cpuinfo,cpubase,
  52. cgbase,tgobj,cgobj
  53. {$ifdef delphi}
  54. ,dmisc
  55. {$endif}
  56. ;
  57. {*****************************************************************************
  58. TCGREALCONSTNODE
  59. *****************************************************************************}
  60. procedure tcgrealconstnode.pass_2;
  61. { I suppose the parser/pass_1 must make sure the generated real }
  62. { constants are actually supported by the target processor? (JM) }
  63. const
  64. floattype2ait:array[tfloattype] of taitype=
  65. (ait_real_32bit,ait_real_64bit,ait_real_80bit,ait_comp_64bit,ait_comp_64bit,ait_real_128bit);
  66. var
  67. hp1 : tai;
  68. lastlabel : tasmlabel;
  69. realait : taitype;
  70. {$ifdef ARM}
  71. hiloswapped : boolean;
  72. {$endif ARM}
  73. begin
  74. location_reset(location,LOC_CREFERENCE,def_cgsize(resulttype.def));
  75. lastlabel:=nil;
  76. realait:=floattype2ait[tfloatdef(resulttype.def).typ];
  77. {$ifdef ARM}
  78. hiloswapped:=aktfputype in [fpu_fpa,fpu_fpa10,fpu_fpa11];
  79. {$endif ARM}
  80. { const already used ? }
  81. if not assigned(lab_real) then
  82. begin
  83. { tries to find an old entry }
  84. hp1:=tai(Consts.first);
  85. while assigned(hp1) do
  86. begin
  87. if hp1.typ=ait_label then
  88. lastlabel:=tai_label(hp1).l
  89. else
  90. begin
  91. if (hp1.typ=realait) and (lastlabel<>nil) then
  92. begin
  93. if is_number_float(value_real) and
  94. (
  95. ((realait=ait_real_32bit) and (tai_real_32bit(hp1).value=value_real) and is_number_float(tai_real_32bit(hp1).value)) or
  96. ((realait=ait_real_64bit) and
  97. {$ifdef ARM}
  98. ((tai_real_64bit(hp1).formatoptions=fo_hiloswapped)=hiloswapped) and
  99. {$endif ARM}
  100. (tai_real_64bit(hp1).value=value_real) and is_number_float(tai_real_64bit(hp1).value)) or
  101. ((realait=ait_real_80bit) and (tai_real_80bit(hp1).value=value_real) and is_number_float(tai_real_80bit(hp1).value)) or
  102. {$ifdef cpufloat128}
  103. ((realait=ait_real_128bit) and (tai_real_128bit(hp1).value=value_real) and is_number_float(tai_real_128bit(hp1).value)) or
  104. {$endif cpufloat128}
  105. ((realait=ait_comp_64bit) and (tai_comp_64bit(hp1).value=value_real) and is_number_float(tai_comp_64bit(hp1).value))
  106. ) then
  107. begin
  108. { found! }
  109. lab_real:=lastlabel;
  110. break;
  111. end;
  112. end;
  113. lastlabel:=nil;
  114. end;
  115. hp1:=tai(hp1.next);
  116. end;
  117. { :-(, we must generate a new entry }
  118. if not assigned(lab_real) then
  119. begin
  120. objectlibrary.getdatalabel(lastlabel);
  121. lab_real:=lastlabel;
  122. if (cs_create_smart in aktmoduleswitches) then
  123. Consts.concat(Tai_cut.Create);
  124. consts.concat(tai_align.create(const_align(resulttype.def.size)));
  125. Consts.concat(Tai_label.Create(lastlabel));
  126. case realait of
  127. ait_real_32bit :
  128. Consts.concat(Tai_real_32bit.Create(ts32real(value_real)));
  129. ait_real_64bit :
  130. {$ifdef ARM}
  131. if hiloswapped then
  132. Consts.concat(Tai_real_64bit.Create_hiloswapped(ts64real(value_real)))
  133. else
  134. {$endif ARM}
  135. Consts.concat(Tai_real_64bit.Create(ts64real(value_real)));
  136. ait_real_80bit :
  137. Consts.concat(Tai_real_80bit.Create(value_real));
  138. {$ifdef cpufloat128}
  139. ait_real_128bit :
  140. Consts.concat(Tai_real_128bit.Create(value_real));
  141. {$endif cpufloat128}
  142. {$ifdef ver1_0}
  143. ait_comp_64bit :
  144. Consts.concat(Tai_comp_64bit.Create(value_real));
  145. {$else ver1_0}
  146. { the round is necessary for native compilers where comp isn't a float }
  147. ait_comp_64bit :
  148. begin
  149. if (value_real>9223372036854775807.0) or (value_real<-9223372036854775808.0) then
  150. Message(parser_e_range_check_error)
  151. else
  152. Consts.concat(Tai_comp_64bit.Create(round(value_real)));
  153. end;
  154. {$endif ver1_0}
  155. else
  156. internalerror(10120);
  157. end;
  158. end;
  159. end;
  160. location.reference.symbol:=lab_real;
  161. end;
  162. {*****************************************************************************
  163. TCGORDCONSTNODE
  164. *****************************************************************************}
  165. procedure tcgordconstnode.pass_2;
  166. begin
  167. location_reset(location,LOC_CONSTANT,def_cgsize(resulttype.def));
  168. location.valueqword:=TConstExprUInt(value);
  169. end;
  170. {*****************************************************************************
  171. TCGPOINTERCONSTNODE
  172. *****************************************************************************}
  173. procedure tcgpointerconstnode.pass_2;
  174. begin
  175. { an integer const. behaves as a memory reference }
  176. location_reset(location,LOC_CONSTANT,OS_ADDR);
  177. location.value:=AWord(value);
  178. end;
  179. {*****************************************************************************
  180. TCGSTRINGCONSTNODE
  181. *****************************************************************************}
  182. procedure tcgstringconstnode.pass_2;
  183. var
  184. hp1,hp2 : tai;
  185. l1,l2,
  186. lastlabel : tasmlabel;
  187. lastlabelhp : tai;
  188. pc : pchar;
  189. same_string : boolean;
  190. l,j,
  191. i,mylength : longint;
  192. begin
  193. { for empty ansistrings we could return a constant 0 }
  194. if (st_type in [st_ansistring,st_widestring]) and
  195. (len=0) then
  196. begin
  197. location_reset(location,LOC_CONSTANT,OS_ADDR);
  198. location.value:=0;
  199. exit;
  200. end;
  201. { return a constant reference in memory }
  202. location_reset(location,LOC_CREFERENCE,def_cgsize(resulttype.def));
  203. { const already used ? }
  204. lastlabel:=nil;
  205. lastlabelhp:=nil;
  206. if not assigned(lab_str) then
  207. begin
  208. if is_shortstring(resulttype.def) then
  209. mylength:=len+2
  210. else
  211. mylength:=len+1;
  212. { widestrings can't be reused yet }
  213. if not(is_widestring(resulttype.def)) then
  214. begin
  215. { tries to found an old entry }
  216. hp1:=tai(Consts.first);
  217. while assigned(hp1) do
  218. begin
  219. if hp1.typ=ait_label then
  220. begin
  221. lastlabel:=tai_label(hp1).l;
  222. lastlabelhp:=hp1;
  223. end
  224. else
  225. begin
  226. { when changing that code, be careful that }
  227. { you don't use typed consts, which are }
  228. { are also written to consts }
  229. { currently, this is no problem, because }
  230. { typed consts have no leading length or }
  231. { they have no trailing zero }
  232. if (hp1.typ=ait_string) and (lastlabel<>nil) and
  233. (tai_string(hp1).len=mylength) then
  234. begin
  235. same_string:=true;
  236. { if shortstring then check the length byte first and
  237. set the start index to 1 }
  238. case st_type of
  239. st_shortstring:
  240. begin
  241. if len=ord(tai_string(hp1).str[0]) then
  242. j:=1
  243. else
  244. same_string:=false;
  245. end;
  246. st_ansistring,
  247. st_widestring :
  248. begin
  249. { before the string the following sequence must be found:
  250. <label>
  251. constsymbol <datalabel>
  252. const32 <len>
  253. const32 <len>
  254. const32 -1
  255. we must then return <label> to reuse
  256. }
  257. hp2:=tai(lastlabelhp.previous);
  258. if assigned(hp2) and
  259. (hp2.typ=ait_const_32bit) and
  260. (tai_const(hp2).value=aword(-1)) and
  261. assigned(hp2.previous) and
  262. (tai(hp2.previous).typ=ait_const_32bit) and
  263. (tai_const(hp2.previous).value=len) and
  264. assigned(hp2.previous.previous) and
  265. (tai(hp2.previous.previous).typ=ait_const_32bit) and
  266. (tai_const(hp2.previous.previous).value=len) and
  267. assigned(hp2.previous.previous.previous) and
  268. (tai(hp2.previous.previous.previous).typ=ait_const_symbol) and
  269. assigned(hp2.previous.previous.previous.previous) and
  270. (tai(hp2.previous.previous.previous.previous).typ=ait_label) then
  271. begin
  272. lastlabel:=tai_label(hp2.previous.previous.previous.previous).l;
  273. j:=0;
  274. end
  275. else
  276. same_string:=false;
  277. end;
  278. else
  279. same_string:=false;
  280. end;
  281. { don't check if the length byte was already wrong }
  282. if same_string then
  283. begin
  284. for i:=0 to len do
  285. begin
  286. if tai_string(hp1).str[j]<>value_str[i] then
  287. begin
  288. same_string:=false;
  289. break;
  290. end;
  291. inc(j);
  292. end;
  293. end;
  294. { found ? }
  295. if same_string then
  296. begin
  297. lab_str:=lastlabel;
  298. break;
  299. end;
  300. end;
  301. lastlabel:=nil;
  302. end;
  303. hp1:=tai(hp1.next);
  304. end;
  305. end;
  306. { :-(, we must generate a new entry }
  307. if not assigned(lab_str) then
  308. begin
  309. objectlibrary.getdatalabel(lastlabel);
  310. lab_str:=lastlabel;
  311. if (cs_create_smart in aktmoduleswitches) then
  312. Consts.concat(Tai_cut.Create);
  313. consts.concat(tai_align.create(const_align(4)));
  314. Consts.concat(Tai_label.Create(lastlabel));
  315. { generate an ansi string ? }
  316. case st_type of
  317. st_ansistring:
  318. begin
  319. { an empty ansi string is nil! }
  320. if len=0 then
  321. Consts.concat(Tai_const.Create_32bit(0))
  322. else
  323. begin
  324. objectlibrary.getdatalabel(l1);
  325. objectlibrary.getdatalabel(l2);
  326. Consts.concat(Tai_label.Create(l2));
  327. Consts.concat(Tai_const_symbol.Create(l1));
  328. Consts.concat(Tai_const.Create_32bit(len));
  329. Consts.concat(Tai_const.Create_32bit(len));
  330. Consts.concat(Tai_const.Create_32bit(Cardinal(-1)));
  331. Consts.concat(Tai_label.Create(l1));
  332. getmem(pc,len+2);
  333. move(value_str^,pc^,len);
  334. pc[len]:=#0;
  335. { to overcome this problem we set the length explicitly }
  336. { with the ending null char }
  337. Consts.concat(Tai_string.Create_length_pchar(pc,len+1));
  338. { return the offset of the real string }
  339. lab_str:=l2;
  340. end;
  341. end;
  342. st_widestring:
  343. begin
  344. { an empty wide string is nil! }
  345. if len=0 then
  346. Consts.concat(Tai_const.Create_32bit(0))
  347. else
  348. begin
  349. objectlibrary.getdatalabel(l1);
  350. objectlibrary.getdatalabel(l2);
  351. Consts.concat(Tai_label.Create(l2));
  352. Consts.concat(Tai_const_symbol.Create(l1));
  353. { we use always UTF-16 coding for constants }
  354. { at least for now }
  355. { Consts.concat(Tai_const.Create_8bit(2)); }
  356. Consts.concat(Tai_const.Create_32bit(len));
  357. Consts.concat(Tai_const.Create_32bit(len));
  358. Consts.concat(Tai_const.Create_32bit(Cardinal(-1)));
  359. Consts.concat(Tai_label.Create(l1));
  360. for i:=0 to len-1 do
  361. Consts.concat(Tai_const.Create_16bit(pcompilerwidestring(value_str)^.data[i]));
  362. { terminating zero }
  363. Consts.concat(Tai_const.Create_16bit(0));
  364. { return the offset of the real string }
  365. lab_str:=l2;
  366. end;
  367. end;
  368. st_shortstring:
  369. begin
  370. { truncate strings larger than 255 chars }
  371. if len>255 then
  372. l:=255
  373. else
  374. l:=len;
  375. { also length and terminating zero }
  376. getmem(pc,l+3);
  377. move(value_str^,pc[1],l+1);
  378. pc[0]:=chr(l);
  379. { to overcome this problem we set the length explicitly }
  380. { with the ending null char }
  381. pc[l+1]:=#0;
  382. Consts.concat(Tai_string.Create_length_pchar(pc,l+2));
  383. end;
  384. end;
  385. end;
  386. end;
  387. location.reference.symbol:=lab_str;
  388. end;
  389. {*****************************************************************************
  390. TCGSETCONSTNODE
  391. *****************************************************************************}
  392. procedure tcgsetconstnode.pass_2;
  393. var
  394. hp1 : tai;
  395. lastlabel : tasmlabel;
  396. i : longint;
  397. neededtyp : taitype;
  398. indexadjust : longint;
  399. type
  400. setbytes=array[0..31] of byte;
  401. Psetbytes=^setbytes;
  402. begin
  403. { xor indexadjust with indexes in a set typecasted to an array of }
  404. { bytes to get the correct locations, also when endianess of source }
  405. { and destiantion differs (JM) }
  406. if (source_info.endian = target_info.endian) then
  407. indexadjust := 0
  408. else
  409. indexadjust := 3;
  410. { small sets are loaded as constants }
  411. if tsetdef(resulttype.def).settype=smallset then
  412. begin
  413. location_reset(location,LOC_CONSTANT,OS_32);
  414. location.value:=PAWord(value_set)^;
  415. exit;
  416. end;
  417. location_reset(location,LOC_CREFERENCE,OS_NO);
  418. neededtyp:=ait_const_8bit;
  419. lastlabel:=nil;
  420. { const already used ? }
  421. if not assigned(lab_set) then
  422. begin
  423. { tries to found an old entry }
  424. hp1:=tai(Consts.first);
  425. while assigned(hp1) do
  426. begin
  427. if hp1.typ=ait_label then
  428. lastlabel:=tai_label(hp1).l
  429. else
  430. begin
  431. if (lastlabel<>nil) and (hp1.typ=neededtyp) then
  432. begin
  433. if (hp1.typ=ait_const_8bit) then
  434. begin
  435. { compare normal set }
  436. i:=0;
  437. while assigned(hp1) and (i<32) do
  438. begin
  439. if tai_const(hp1).value<>Psetbytes(value_set)^[i xor indexadjust] then
  440. break;
  441. inc(i);
  442. hp1:=tai(hp1.next);
  443. end;
  444. if i=32 then
  445. begin
  446. { found! }
  447. lab_set:=lastlabel;
  448. break;
  449. end;
  450. { leave when the end of consts is reached, so no
  451. hp1.next is done }
  452. if not assigned(hp1) then
  453. break;
  454. end
  455. else
  456. begin
  457. { compare small set }
  458. if paword(value_set)^=tai_const(hp1).value then
  459. begin
  460. { found! }
  461. lab_set:=lastlabel;
  462. break;
  463. end;
  464. end;
  465. end;
  466. lastlabel:=nil;
  467. end;
  468. hp1:=tai(hp1.next);
  469. end;
  470. { :-(, we must generate a new entry }
  471. if not assigned(lab_set) then
  472. begin
  473. objectlibrary.getdatalabel(lastlabel);
  474. lab_set:=lastlabel;
  475. if (cs_create_smart in aktmoduleswitches) then
  476. Consts.concat(Tai_cut.Create);
  477. consts.concat(tai_align.create(const_align(4)));
  478. Consts.concat(Tai_label.Create(lastlabel));
  479. { already handled at the start of this method?? (JM)
  480. if tsetdef(resulttype.def).settype=smallset then
  481. begin
  482. move(value_set^,i,sizeof(longint));
  483. Consts.concat(Tai_const.Create_32bit(i));
  484. end
  485. else
  486. }
  487. begin
  488. for i:=0 to 31 do
  489. Consts.concat(Tai_const.Create_8bit(Psetbytes(value_set)^[i xor indexadjust]));
  490. end;
  491. end;
  492. end;
  493. location.reference.symbol:=lab_set;
  494. end;
  495. {*****************************************************************************
  496. TCGNILNODE
  497. *****************************************************************************}
  498. procedure tcgnilnode.pass_2;
  499. begin
  500. location_reset(location,LOC_CONSTANT,OS_ADDR);
  501. location.value:=0;
  502. end;
  503. {*****************************************************************************
  504. TCGPOINTERCONSTNODE
  505. *****************************************************************************}
  506. procedure tcgguidconstnode.pass_2;
  507. var
  508. tmplabel : TAsmLabel;
  509. i : integer;
  510. begin
  511. location_reset(location,LOC_CREFERENCE,OS_NO);
  512. { label for GUID }
  513. objectlibrary.getdatalabel(tmplabel);
  514. consts.concat(tai_align.create(const_align(16)));
  515. consts.concat(Tai_label.Create(tmplabel));
  516. consts.concat(Tai_const.Create_32bit(value.D1));
  517. consts.concat(Tai_const.Create_16bit(value.D2));
  518. consts.concat(Tai_const.Create_16bit(value.D3));
  519. for i:=Low(value.D4) to High(value.D4) do
  520. consts.concat(Tai_const.Create_8bit(value.D4[i]));
  521. location.reference.symbol:=tmplabel;
  522. end;
  523. begin
  524. crealconstnode:=tcgrealconstnode;
  525. cordconstnode:=tcgordconstnode;
  526. cpointerconstnode:=tcgpointerconstnode;
  527. cstringconstnode:=tcgstringconstnode;
  528. csetconstnode:=tcgsetconstnode;
  529. cnilnode:=tcgnilnode;
  530. cguidconstnode:=tcgguidconstnode;
  531. end.
  532. {
  533. $Log$
  534. Revision 1.36 2004-01-24 18:12:40 florian
  535. * fixed several arm floating point issues
  536. Revision 1.35 2004/01/12 16:39:40 peter
  537. * sparc updates, mostly float related
  538. Revision 1.34 2003/12/08 22:34:24 peter
  539. * tai_const.create_32bit changed to cardinal
  540. Revision 1.33 2003/10/26 13:37:22 florian
  541. * fixed web bug 2128
  542. Revision 1.32 2003/10/10 17:48:13 peter
  543. * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
  544. * tregisteralloctor renamed to trgobj
  545. * removed rgobj from a lot of units
  546. * moved location_* and reference_* to cgobj
  547. * first things for mmx register allocation
  548. Revision 1.31 2003/10/01 20:34:48 peter
  549. * procinfo unit contains tprocinfo
  550. * cginfo renamed to cgbase
  551. * moved cgmessage to verbose
  552. * fixed ppc and sparc compiles
  553. Revision 1.30 2003/09/06 16:47:24 florian
  554. + support of NaN and Inf in the compiler as values of real constants
  555. Revision 1.29 2003/09/03 15:55:00 peter
  556. * NEWRA branch merged
  557. Revision 1.28 2003/05/01 12:24:22 jonas
  558. * fixed endian issues when writing out set constants
  559. Revision 1.27 2003/04/24 22:29:57 florian
  560. * fixed a lot of PowerPC related stuff
  561. Revision 1.26 2003/01/05 13:36:53 florian
  562. * x86-64 compiles
  563. + very basic support for float128 type (x86-64 only)
  564. Revision 1.25 2002/12/29 16:58:11 peter
  565. * write terminating 0 for widestring constants
  566. Revision 1.24 2002/12/07 14:10:21 carl
  567. * fix warnings by adding explicit typecasts
  568. Revision 1.23 2002/11/25 17:43:17 peter
  569. * splitted defbase in defutil,symutil,defcmp
  570. * merged isconvertable and is_equal into compare_defs(_ext)
  571. * made operator search faster by walking the list only once
  572. Revision 1.22 2002/11/09 15:36:50 carl
  573. * align all constants correctly (default of 4 size for real type constants)
  574. Revision 1.21 2002/10/06 21:01:50 peter
  575. * use tconstexpruint instead of qword
  576. Revision 1.20 2002/10/05 12:43:25 carl
  577. * fixes for Delphi 6 compilation
  578. (warning : Some features do not work under Delphi)
  579. Revision 1.19 2002/08/18 20:06:23 peter
  580. * inlining is now also allowed in interface
  581. * renamed write/load to ppuwrite/ppuload
  582. * tnode storing in ppu
  583. * nld,ncon,nbas are already updated for storing in ppu
  584. Revision 1.18 2002/08/11 14:32:26 peter
  585. * renamed current_library to objectlibrary
  586. Revision 1.17 2002/08/11 13:24:11 peter
  587. * saving of asmsymbols in ppu supported
  588. * asmsymbollist global is removed and moved into a new class
  589. tasmlibrarydata that will hold the info of a .a file which
  590. corresponds with a single module. Added librarydata to tmodule
  591. to keep the library info stored for the module. In the future the
  592. objectfiles will also be stored to the tasmlibrarydata class
  593. * all getlabel/newasmsymbol and friends are moved to the new class
  594. Revision 1.16 2002/08/10 17:15:06 jonas
  595. * endianess fix
  596. Revision 1.15 2002/07/23 12:34:30 daniel
  597. * Readded old set code. To use it define 'oldset'. Activated by default
  598. for ppc.
  599. Revision 1.14 2002/07/22 11:48:04 daniel
  600. * Sets are now internally sets.
  601. Revision 1.13 2002/07/20 11:57:53 florian
  602. * types.pas renamed to defbase.pas because D6 contains a types
  603. unit so this would conflicts if D6 programms are compiled
  604. + Willamette/SSE2 instructions to assembler added
  605. Revision 1.12 2002/07/01 18:46:22 peter
  606. * internal linker
  607. * reorganized aasm layer
  608. Revision 1.11 2002/07/01 16:23:53 peter
  609. * cg64 patch
  610. * basics for currency
  611. * asnode updates for class and interface (not finished)
  612. Revision 1.10 2002/05/18 13:34:09 peter
  613. * readded missing revisions
  614. Revision 1.9 2002/05/16 19:46:37 carl
  615. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  616. + try to fix temp allocation (still in ifdef)
  617. + generic constructor calls
  618. + start of tassembler / tmodulebase class cleanup
  619. Revision 1.7 2002/04/04 19:05:57 peter
  620. * removed unused units
  621. * use tlocation.size in cg.a_*loc*() routines
  622. Revision 1.6 2002/04/02 17:11:28 peter
  623. * tlocation,treference update
  624. * LOC_CONSTANT added for better constant handling
  625. * secondadd splitted in multiple routines
  626. * location_force_reg added for loading a location to a register
  627. of a specified size
  628. * secondassignment parses now first the right and then the left node
  629. (this is compatible with Kylix). This saves a lot of push/pop especially
  630. with string operations
  631. * adapted some routines to use the new cg methods
  632. Revision 1.5 2002/03/31 20:26:34 jonas
  633. + a_loadfpu_* and a_loadmm_* methods in tcg
  634. * register allocation is now handled by a class and is mostly processor
  635. independent (+rgobj.pas and i386/rgcpu.pas)
  636. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  637. * some small improvements and fixes to the optimizer
  638. * some register allocation fixes
  639. * some fpuvaroffset fixes in the unary minus node
  640. * push/popusedregisters is now called rg.save/restoreusedregisters and
  641. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  642. also better optimizable)
  643. * fixed and optimized register saving/restoring for new/dispose nodes
  644. * LOC_FPU locations now also require their "register" field to be set to
  645. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  646. - list field removed of the tnode class because it's not used currently
  647. and can cause hard-to-find bugs
  648. Revision 1.4 2002/02/26 09:12:39 jonas
  649. * fixed problem when compiling the compiler with Delphi (reported by
  650. "Luc Langlois" <[email protected]>) (lo/hi don't work as in FPC
  651. when used with int64's under Delphi)
  652. }