ncgcon.pas 30 KB

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