ncgcon.pas 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  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. same_string:=false;
  227. if (hp1.typ=ait_string) and
  228. (lastlabel<>nil) and
  229. (tai_string(hp1).len=mylength) then
  230. begin
  231. { if shortstring then check the length byte first and
  232. set the start index to 1 }
  233. case st_type of
  234. st_shortstring:
  235. begin
  236. if len=ord(tai_string(hp1).str[0]) then
  237. begin
  238. j:=1;
  239. same_string:=true;
  240. for i:=0 to len-1 do
  241. begin
  242. if tai_string(hp1).str[j]<>value_str[i] then
  243. begin
  244. same_string:=false;
  245. break;
  246. end;
  247. inc(j);
  248. end;
  249. end;
  250. end;
  251. st_ansistring,
  252. st_widestring :
  253. begin
  254. { before the string the following sequence must be found:
  255. <label>
  256. constsymbol <datalabel>
  257. const32 <len>
  258. const32 <len>
  259. const32 -1
  260. we must then return <label> to reuse
  261. }
  262. hp2:=tai(lastlabelhp.previous);
  263. if assigned(hp2) and
  264. (hp2.typ=ait_const_32bit) and
  265. (tai_const(hp2).value=aword(-1)) and
  266. assigned(hp2.previous) and
  267. (tai(hp2.previous).typ=ait_const_32bit) and
  268. (tai_const(hp2.previous).value=len) and
  269. assigned(hp2.previous.previous) and
  270. (tai(hp2.previous.previous).typ=ait_const_32bit) and
  271. (tai_const(hp2.previous.previous).value=len) and
  272. assigned(hp2.previous.previous.previous) and
  273. (tai(hp2.previous.previous.previous).typ=ait_const_symbol) and
  274. assigned(hp2.previous.previous.previous.previous) and
  275. (tai(hp2.previous.previous.previous.previous).typ=ait_label) then
  276. begin
  277. lastlabel:=tai_label(hp2.previous.previous.previous.previous).l;
  278. same_string:=true;
  279. j:=0;
  280. for i:=0 to len-1 do
  281. begin
  282. if tai_string(hp1).str[j]<>value_str[i] then
  283. begin
  284. same_string:=false;
  285. break;
  286. end;
  287. inc(j);
  288. end;
  289. end;
  290. end;
  291. end;
  292. { found ? }
  293. if same_string then
  294. begin
  295. lab_str:=lastlabel;
  296. break;
  297. end;
  298. end;
  299. lastlabel:=nil;
  300. end;
  301. hp1:=tai(hp1.next);
  302. end;
  303. end;
  304. { :-(, we must generate a new entry }
  305. if not assigned(lab_str) then
  306. begin
  307. objectlibrary.getdatalabel(lastlabel);
  308. lab_str:=lastlabel;
  309. if (cs_create_smart in aktmoduleswitches) then
  310. Consts.concat(Tai_cut.Create);
  311. consts.concat(tai_align.create(const_align(4)));
  312. Consts.concat(Tai_label.Create(lastlabel));
  313. { generate an ansi string ? }
  314. case st_type of
  315. st_ansistring:
  316. begin
  317. { an empty ansi string is nil! }
  318. if len=0 then
  319. Consts.concat(Tai_const.Create_ptr(0))
  320. else
  321. begin
  322. objectlibrary.getdatalabel(l1);
  323. objectlibrary.getdatalabel(l2);
  324. Consts.concat(Tai_label.Create(l2));
  325. Consts.concat(Tai_const_symbol.Create(l1));
  326. Consts.concat(Tai_const.Create_32bit(len));
  327. Consts.concat(Tai_const.Create_32bit(len));
  328. Consts.concat(Tai_const.Create_32bit(Cardinal(-1)));
  329. Consts.concat(Tai_label.Create(l1));
  330. getmem(pc,len+2);
  331. move(value_str^,pc^,len);
  332. pc[len]:=#0;
  333. { to overcome this problem we set the length explicitly }
  334. { with the ending null char }
  335. Consts.concat(Tai_string.Create_length_pchar(pc,len+1));
  336. { return the offset of the real string }
  337. lab_str:=l2;
  338. end;
  339. end;
  340. st_widestring:
  341. begin
  342. { an empty wide string is nil! }
  343. if len=0 then
  344. Consts.concat(Tai_const.Create_ptr(0))
  345. else
  346. begin
  347. objectlibrary.getdatalabel(l1);
  348. objectlibrary.getdatalabel(l2);
  349. Consts.concat(Tai_label.Create(l2));
  350. Consts.concat(Tai_const_symbol.Create(l1));
  351. { we use always UTF-16 coding for constants }
  352. { at least for now }
  353. { Consts.concat(Tai_const.Create_8bit(2)); }
  354. Consts.concat(Tai_const.Create_32bit(len));
  355. Consts.concat(Tai_const.Create_32bit(len));
  356. Consts.concat(Tai_const.Create_32bit(Cardinal(-1)));
  357. Consts.concat(Tai_label.Create(l1));
  358. for i:=0 to len-1 do
  359. Consts.concat(Tai_const.Create_16bit(pcompilerwidestring(value_str)^.data[i]));
  360. { terminating zero }
  361. Consts.concat(Tai_const.Create_16bit(0));
  362. { return the offset of the real string }
  363. lab_str:=l2;
  364. end;
  365. end;
  366. st_shortstring:
  367. begin
  368. { truncate strings larger than 255 chars }
  369. if len>255 then
  370. l:=255
  371. else
  372. l:=len;
  373. { also length and terminating zero }
  374. getmem(pc,l+3);
  375. move(value_str^,pc[1],l+1);
  376. pc[0]:=chr(l);
  377. { to overcome this problem we set the length explicitly }
  378. { with the ending null char }
  379. pc[l+1]:=#0;
  380. Consts.concat(Tai_string.Create_length_pchar(pc,l+2));
  381. end;
  382. end;
  383. end;
  384. end;
  385. location.reference.symbol:=lab_str;
  386. end;
  387. {*****************************************************************************
  388. TCGSETCONSTNODE
  389. *****************************************************************************}
  390. procedure tcgsetconstnode.pass_2;
  391. var
  392. hp1 : tai;
  393. lastlabel : tasmlabel;
  394. i : longint;
  395. neededtyp : taitype;
  396. indexadjust : longint;
  397. type
  398. setbytes=array[0..31] of byte;
  399. Psetbytes=^setbytes;
  400. begin
  401. { xor indexadjust with indexes in a set typecasted to an array of }
  402. { bytes to get the correct locations, also when endianess of source }
  403. { and destiantion differs (JM) }
  404. if (source_info.endian = target_info.endian) then
  405. indexadjust := 0
  406. else
  407. indexadjust := 3;
  408. { small sets are loaded as constants }
  409. if tsetdef(resulttype.def).settype=smallset then
  410. begin
  411. location_reset(location,LOC_CONSTANT,OS_32);
  412. location.value:=PAWord(value_set)^;
  413. exit;
  414. end;
  415. location_reset(location,LOC_CREFERENCE,OS_NO);
  416. neededtyp:=ait_const_8bit;
  417. lastlabel:=nil;
  418. { const already used ? }
  419. if not assigned(lab_set) then
  420. begin
  421. { tries to found an old entry }
  422. hp1:=tai(Consts.first);
  423. while assigned(hp1) do
  424. begin
  425. if hp1.typ=ait_label then
  426. lastlabel:=tai_label(hp1).l
  427. else
  428. begin
  429. if (lastlabel<>nil) and (hp1.typ=neededtyp) then
  430. begin
  431. if (hp1.typ=ait_const_8bit) then
  432. begin
  433. { compare normal set }
  434. i:=0;
  435. while assigned(hp1) and (i<32) do
  436. begin
  437. if tai_const(hp1).value<>Psetbytes(value_set)^[i xor indexadjust] then
  438. break;
  439. inc(i);
  440. hp1:=tai(hp1.next);
  441. end;
  442. if i=32 then
  443. begin
  444. { found! }
  445. lab_set:=lastlabel;
  446. break;
  447. end;
  448. { leave when the end of consts is reached, so no
  449. hp1.next is done }
  450. if not assigned(hp1) then
  451. break;
  452. end
  453. else
  454. begin
  455. { compare small set }
  456. if paword(value_set)^=tai_const(hp1).value then
  457. begin
  458. { found! }
  459. lab_set:=lastlabel;
  460. break;
  461. end;
  462. end;
  463. end;
  464. lastlabel:=nil;
  465. end;
  466. hp1:=tai(hp1.next);
  467. end;
  468. { :-(, we must generate a new entry }
  469. if not assigned(lab_set) then
  470. begin
  471. objectlibrary.getdatalabel(lastlabel);
  472. lab_set:=lastlabel;
  473. if (cs_create_smart in aktmoduleswitches) then
  474. Consts.concat(Tai_cut.Create);
  475. consts.concat(tai_align.create(const_align(4)));
  476. Consts.concat(Tai_label.Create(lastlabel));
  477. { already handled at the start of this method?? (JM)
  478. if tsetdef(resulttype.def).settype=smallset then
  479. begin
  480. move(value_set^,i,sizeof(longint));
  481. Consts.concat(Tai_const.Create_32bit(i));
  482. end
  483. else
  484. }
  485. begin
  486. for i:=0 to 31 do
  487. Consts.concat(Tai_const.Create_8bit(Psetbytes(value_set)^[i xor indexadjust]));
  488. end;
  489. end;
  490. end;
  491. location.reference.symbol:=lab_set;
  492. end;
  493. {*****************************************************************************
  494. TCGNILNODE
  495. *****************************************************************************}
  496. procedure tcgnilnode.pass_2;
  497. begin
  498. location_reset(location,LOC_CONSTANT,OS_ADDR);
  499. location.value:=0;
  500. end;
  501. {*****************************************************************************
  502. TCGPOINTERCONSTNODE
  503. *****************************************************************************}
  504. procedure tcgguidconstnode.pass_2;
  505. var
  506. tmplabel : TAsmLabel;
  507. i : integer;
  508. begin
  509. location_reset(location,LOC_CREFERENCE,OS_NO);
  510. { label for GUID }
  511. objectlibrary.getdatalabel(tmplabel);
  512. consts.concat(tai_align.create(const_align(16)));
  513. consts.concat(Tai_label.Create(tmplabel));
  514. consts.concat(Tai_const.Create_32bit(value.D1));
  515. consts.concat(Tai_const.Create_16bit(value.D2));
  516. consts.concat(Tai_const.Create_16bit(value.D3));
  517. for i:=Low(value.D4) to High(value.D4) do
  518. consts.concat(Tai_const.Create_8bit(value.D4[i]));
  519. location.reference.symbol:=tmplabel;
  520. end;
  521. begin
  522. crealconstnode:=tcgrealconstnode;
  523. cordconstnode:=tcgordconstnode;
  524. cpointerconstnode:=tcgpointerconstnode;
  525. cstringconstnode:=tcgstringconstnode;
  526. csetconstnode:=tcgsetconstnode;
  527. cnilnode:=tcgnilnode;
  528. cguidconstnode:=tcgguidconstnode;
  529. end.
  530. {
  531. $Log$
  532. Revision 1.38 2004-03-16 16:19:44 peter
  533. * fix out of bounds for string compares
  534. Revision 1.37 2004/02/26 16:16:38 peter
  535. * tai_const.create_ptr added
  536. Revision 1.36 2004/01/24 18:12:40 florian
  537. * fixed several arm floating point issues
  538. Revision 1.35 2004/01/12 16:39:40 peter
  539. * sparc updates, mostly float related
  540. Revision 1.34 2003/12/08 22:34:24 peter
  541. * tai_const.create_32bit changed to cardinal
  542. Revision 1.33 2003/10/26 13:37:22 florian
  543. * fixed web bug 2128
  544. Revision 1.32 2003/10/10 17:48:13 peter
  545. * old trgobj moved to x86/rgcpu and renamed to trgx86fpu
  546. * tregisteralloctor renamed to trgobj
  547. * removed rgobj from a lot of units
  548. * moved location_* and reference_* to cgobj
  549. * first things for mmx register allocation
  550. Revision 1.31 2003/10/01 20:34:48 peter
  551. * procinfo unit contains tprocinfo
  552. * cginfo renamed to cgbase
  553. * moved cgmessage to verbose
  554. * fixed ppc and sparc compiles
  555. Revision 1.30 2003/09/06 16:47:24 florian
  556. + support of NaN and Inf in the compiler as values of real constants
  557. Revision 1.29 2003/09/03 15:55:00 peter
  558. * NEWRA branch merged
  559. Revision 1.28 2003/05/01 12:24:22 jonas
  560. * fixed endian issues when writing out set constants
  561. Revision 1.27 2003/04/24 22:29:57 florian
  562. * fixed a lot of PowerPC related stuff
  563. Revision 1.26 2003/01/05 13:36:53 florian
  564. * x86-64 compiles
  565. + very basic support for float128 type (x86-64 only)
  566. Revision 1.25 2002/12/29 16:58:11 peter
  567. * write terminating 0 for widestring constants
  568. Revision 1.24 2002/12/07 14:10:21 carl
  569. * fix warnings by adding explicit typecasts
  570. Revision 1.23 2002/11/25 17:43:17 peter
  571. * splitted defbase in defutil,symutil,defcmp
  572. * merged isconvertable and is_equal into compare_defs(_ext)
  573. * made operator search faster by walking the list only once
  574. Revision 1.22 2002/11/09 15:36:50 carl
  575. * align all constants correctly (default of 4 size for real type constants)
  576. Revision 1.21 2002/10/06 21:01:50 peter
  577. * use tconstexpruint instead of qword
  578. Revision 1.20 2002/10/05 12:43:25 carl
  579. * fixes for Delphi 6 compilation
  580. (warning : Some features do not work under Delphi)
  581. Revision 1.19 2002/08/18 20:06:23 peter
  582. * inlining is now also allowed in interface
  583. * renamed write/load to ppuwrite/ppuload
  584. * tnode storing in ppu
  585. * nld,ncon,nbas are already updated for storing in ppu
  586. Revision 1.18 2002/08/11 14:32:26 peter
  587. * renamed current_library to objectlibrary
  588. Revision 1.17 2002/08/11 13:24:11 peter
  589. * saving of asmsymbols in ppu supported
  590. * asmsymbollist global is removed and moved into a new class
  591. tasmlibrarydata that will hold the info of a .a file which
  592. corresponds with a single module. Added librarydata to tmodule
  593. to keep the library info stored for the module. In the future the
  594. objectfiles will also be stored to the tasmlibrarydata class
  595. * all getlabel/newasmsymbol and friends are moved to the new class
  596. Revision 1.16 2002/08/10 17:15:06 jonas
  597. * endianess fix
  598. Revision 1.15 2002/07/23 12:34:30 daniel
  599. * Readded old set code. To use it define 'oldset'. Activated by default
  600. for ppc.
  601. Revision 1.14 2002/07/22 11:48:04 daniel
  602. * Sets are now internally sets.
  603. Revision 1.13 2002/07/20 11:57:53 florian
  604. * types.pas renamed to defbase.pas because D6 contains a types
  605. unit so this would conflicts if D6 programms are compiled
  606. + Willamette/SSE2 instructions to assembler added
  607. Revision 1.12 2002/07/01 18:46:22 peter
  608. * internal linker
  609. * reorganized aasm layer
  610. Revision 1.11 2002/07/01 16:23:53 peter
  611. * cg64 patch
  612. * basics for currency
  613. * asnode updates for class and interface (not finished)
  614. Revision 1.10 2002/05/18 13:34:09 peter
  615. * readded missing revisions
  616. Revision 1.9 2002/05/16 19:46:37 carl
  617. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  618. + try to fix temp allocation (still in ifdef)
  619. + generic constructor calls
  620. + start of tassembler / tmodulebase class cleanup
  621. Revision 1.7 2002/04/04 19:05:57 peter
  622. * removed unused units
  623. * use tlocation.size in cg.a_*loc*() routines
  624. Revision 1.6 2002/04/02 17:11:28 peter
  625. * tlocation,treference update
  626. * LOC_CONSTANT added for better constant handling
  627. * secondadd splitted in multiple routines
  628. * location_force_reg added for loading a location to a register
  629. of a specified size
  630. * secondassignment parses now first the right and then the left node
  631. (this is compatible with Kylix). This saves a lot of push/pop especially
  632. with string operations
  633. * adapted some routines to use the new cg methods
  634. Revision 1.5 2002/03/31 20:26:34 jonas
  635. + a_loadfpu_* and a_loadmm_* methods in tcg
  636. * register allocation is now handled by a class and is mostly processor
  637. independent (+rgobj.pas and i386/rgcpu.pas)
  638. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  639. * some small improvements and fixes to the optimizer
  640. * some register allocation fixes
  641. * some fpuvaroffset fixes in the unary minus node
  642. * push/popusedregisters is now called rg.save/restoreusedregisters and
  643. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  644. also better optimizable)
  645. * fixed and optimized register saving/restoring for new/dispose nodes
  646. * LOC_FPU locations now also require their "register" field to be set to
  647. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  648. - list field removed of the tnode class because it's not used currently
  649. and can cause hard-to-find bugs
  650. Revision 1.4 2002/02/26 09:12:39 jonas
  651. * fixed problem when compiling the compiler with Delphi (reported by
  652. "Luc Langlois" <[email protected]>) (lo/hi don't work as in FPC
  653. when used with int64's under Delphi)
  654. }