ncgcon.pas 29 KB

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