nadd.pas 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl
  4. Type checking and register allocation for add nodes
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. unit nadd;
  19. {$i defines.inc}
  20. interface
  21. uses
  22. node;
  23. type
  24. taddnode = class(tbinopnode)
  25. procedure make_bool_equal_size;
  26. function pass_1 : tnode;override;
  27. end;
  28. var
  29. { caddnode is used to create nodes of the add type }
  30. { the virtual constructor allows to assign }
  31. { another class type to caddnode => processor }
  32. { specific node types can be created }
  33. caddnode : class of taddnode;
  34. implementation
  35. uses
  36. globtype,systems,
  37. cutils,verbose,globals,
  38. symconst,symtype,symdef,types,
  39. cpuinfo,
  40. {$ifdef newcg}
  41. cgbase,
  42. {$else newcg}
  43. hcodegen,
  44. {$endif newcg}
  45. htypechk,pass_1,
  46. nmat,ncnv,nld,ncon,nset,nopt,
  47. cpubase;
  48. {*****************************************************************************
  49. TADDNODE
  50. *****************************************************************************}
  51. {$ifdef fpc}
  52. {$maxfpuregisters 0}
  53. {$endif fpc}
  54. procedure taddnode.make_bool_equal_size;
  55. begin
  56. if porddef(left.resulttype)^.typ>porddef(right.resulttype)^.typ then
  57. begin
  58. right:=gentypeconvnode(right,porddef(left.resulttype));
  59. ttypeconvnode(right).convtype:=tc_bool_2_int;
  60. include(right.flags,nf_explizit);
  61. firstpass(right);
  62. end
  63. else
  64. if porddef(left.resulttype)^.typ<porddef(right.resulttype)^.typ then
  65. begin
  66. left:=gentypeconvnode(left,porddef(right.resulttype));
  67. ttypeconvnode(left).convtype:=tc_bool_2_int;
  68. include(left.flags,nf_explizit);
  69. firstpass(left);
  70. end;
  71. end;
  72. function taddnode.pass_1 : tnode;
  73. var
  74. t,hp : tnode;
  75. ot,
  76. lt,rt : tnodetype;
  77. rv,lv : tconstexprint;
  78. rvd,lvd : bestreal;
  79. rd,ld : pdef;
  80. tempdef : pdef;
  81. concatstrings : boolean;
  82. { to evalute const sets }
  83. resultset : pconstset;
  84. i : longint;
  85. b : boolean;
  86. boolres,
  87. convdone : boolean;
  88. s1,s2 : pchar;
  89. l1,l2 : longint;
  90. begin
  91. pass_1:=nil;
  92. { first do the two subtrees }
  93. firstpass(left);
  94. firstpass(right);
  95. if codegenerror then
  96. exit;
  97. { convert array constructors to sets, because there is no other operator
  98. possible for array constructors }
  99. if is_array_constructor(left.resulttype) then
  100. arrayconstructor_to_set(tarrayconstructornode(left));
  101. if is_array_constructor(right.resulttype) then
  102. arrayconstructor_to_set(tarrayconstructornode(right));
  103. { both left and right need to be valid }
  104. set_varstate(left,true);
  105. set_varstate(right,true);
  106. { load easier access variables }
  107. lt:=left.nodetype;
  108. rt:=right.nodetype;
  109. rd:=right.resulttype;
  110. ld:=left.resulttype;
  111. convdone:=false;
  112. hp:=self;
  113. if isbinaryoverloaded(hp) then
  114. begin
  115. pass_1:=hp;
  116. exit;
  117. end;
  118. { compact consts }
  119. { convert int consts to real consts, if the }
  120. { other operand is a real const }
  121. if (rt=realconstn) and is_constintnode(left) then
  122. begin
  123. t:=genrealconstnode(tordconstnode(left).value,right.resulttype);
  124. left.free;
  125. left:=t;
  126. lt:=realconstn;
  127. end;
  128. if (lt=realconstn) and is_constintnode(right) then
  129. begin
  130. t:=genrealconstnode(tordconstnode(right).value,left.resulttype);
  131. right.free;
  132. right:=t;
  133. rt:=realconstn;
  134. end;
  135. { both are int constants }
  136. if ((lt=ordconstn) and (rt=ordconstn)) and
  137. ((is_constintnode(left) and is_constintnode(right)) or
  138. (is_constboolnode(left) and is_constboolnode(right) and
  139. (nodetype in [ltn,lten,gtn,gten,equaln,unequaln,andn,xorn,orn]))) then
  140. begin
  141. { xor, and, or are handled different from arithmetic }
  142. { operations regarding the result type }
  143. { return a boolean for boolean operations (and,xor,or) }
  144. boolres:=is_constboolnode(left);
  145. lv:=tordconstnode(left).value;
  146. rv:=tordconstnode(right).value;
  147. case nodetype of
  148. addn : t:=genintconstnode(lv+rv);
  149. subn : t:=genintconstnode(lv-rv);
  150. muln : t:=genintconstnode(lv*rv);
  151. xorn : if boolres then
  152. t:=genordinalconstnode(lv xor rv,booldef)
  153. else
  154. t:=genintconstnode(lv xor rv);
  155. orn : if boolres then
  156. t:=genordinalconstnode(lv or rv,booldef)
  157. else
  158. t:=genintconstnode(lv or rv);
  159. andn : if boolres then
  160. t:=genordinalconstnode(lv and rv,booldef)
  161. else
  162. t:=genintconstnode(lv and rv);
  163. ltn : t:=genordinalconstnode(ord(lv<rv),booldef);
  164. lten : t:=genordinalconstnode(ord(lv<=rv),booldef);
  165. gtn : t:=genordinalconstnode(ord(lv>rv),booldef);
  166. gten : t:=genordinalconstnode(ord(lv>=rv),booldef);
  167. equaln : t:=genordinalconstnode(ord(lv=rv),booldef);
  168. unequaln : t:=genordinalconstnode(ord(lv<>rv),booldef);
  169. slashn : begin
  170. { int/int becomes a real }
  171. if int(rv)=0 then
  172. begin
  173. Message(parser_e_invalid_float_operation);
  174. t:=genrealconstnode(0,bestrealdef^);
  175. end
  176. else
  177. t:=genrealconstnode(int(lv)/int(rv),bestrealdef^);
  178. firstpass(t);
  179. end;
  180. else
  181. CGMessage(type_e_mismatch);
  182. end;
  183. pass_1:=t;
  184. exit;
  185. end;
  186. { both real constants ? }
  187. if (lt=realconstn) and (rt=realconstn) then
  188. begin
  189. lvd:=trealconstnode(left).value_real;
  190. rvd:=trealconstnode(right).value_real;
  191. case nodetype of
  192. addn : t:=genrealconstnode(lvd+rvd,bestrealdef^);
  193. subn : t:=genrealconstnode(lvd-rvd,bestrealdef^);
  194. muln : t:=genrealconstnode(lvd*rvd,bestrealdef^);
  195. starstarn,
  196. caretn : begin
  197. if lvd<0 then
  198. begin
  199. Message(parser_e_invalid_float_operation);
  200. t:=genrealconstnode(0,bestrealdef^);
  201. end
  202. else if lvd=0 then
  203. t:=genrealconstnode(1.0,bestrealdef^)
  204. else
  205. t:=genrealconstnode(exp(ln(lvd)*rvd),bestrealdef^);
  206. end;
  207. slashn :
  208. begin
  209. if rvd=0 then
  210. begin
  211. Message(parser_e_invalid_float_operation);
  212. t:=genrealconstnode(0,bestrealdef^);
  213. end
  214. else
  215. t:=genrealconstnode(lvd/rvd,bestrealdef^);
  216. end;
  217. ltn : t:=genordinalconstnode(ord(lvd<rvd),booldef);
  218. lten : t:=genordinalconstnode(ord(lvd<=rvd),booldef);
  219. gtn : t:=genordinalconstnode(ord(lvd>rvd),booldef);
  220. gten : t:=genordinalconstnode(ord(lvd>=rvd),booldef);
  221. equaln : t:=genordinalconstnode(ord(lvd=rvd),booldef);
  222. unequaln : t:=genordinalconstnode(ord(lvd<>rvd),booldef);
  223. else
  224. CGMessage(type_e_mismatch);
  225. end;
  226. pass_1:=t;
  227. exit;
  228. end;
  229. { concating strings ? }
  230. concatstrings:=false;
  231. s1:=nil;
  232. s2:=nil;
  233. if (lt=ordconstn) and (rt=ordconstn) and
  234. is_char(ld) and is_char(rd) then
  235. begin
  236. s1:=strpnew(char(byte(tordconstnode(left).value)));
  237. s2:=strpnew(char(byte(tordconstnode(right).value)));
  238. l1:=1;
  239. l2:=1;
  240. concatstrings:=true;
  241. end
  242. else
  243. if (lt=stringconstn) and (rt=ordconstn) and is_char(rd) then
  244. begin
  245. s1:=tstringconstnode(left).getpcharcopy;
  246. l1:=tstringconstnode(left).len;
  247. s2:=strpnew(char(byte(tordconstnode(right).value)));
  248. l2:=1;
  249. concatstrings:=true;
  250. end
  251. else
  252. if (lt=ordconstn) and (rt=stringconstn) and is_char(ld) then
  253. begin
  254. s1:=strpnew(char(byte(tordconstnode(left).value)));
  255. l1:=1;
  256. s2:=tstringconstnode(right).getpcharcopy;
  257. l2:=tstringconstnode(right).len;
  258. concatstrings:=true;
  259. end
  260. else if (lt=stringconstn) and (rt=stringconstn) then
  261. begin
  262. s1:=tstringconstnode(left).getpcharcopy;
  263. l1:=tstringconstnode(left).len;
  264. s2:=tstringconstnode(right).getpcharcopy;
  265. l2:=tstringconstnode(right).len;
  266. concatstrings:=true;
  267. end;
  268. { I will need to translate all this to ansistrings !!! }
  269. if concatstrings then
  270. begin
  271. case nodetype of
  272. addn :
  273. t:=genpcharconstnode(concatansistrings(s1,s2,l1,l2),l1+l2);
  274. ltn :
  275. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)<0),booldef);
  276. lten :
  277. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)<=0),booldef);
  278. gtn :
  279. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)>0),booldef);
  280. gten :
  281. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)>=0),booldef);
  282. equaln :
  283. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)=0),booldef);
  284. unequaln :
  285. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)<>0),booldef);
  286. end;
  287. ansistringdispose(s1,l1);
  288. ansistringdispose(s2,l2);
  289. pass_1:=t;
  290. exit;
  291. end;
  292. { if both are orddefs then check sub types }
  293. if (ld^.deftype=orddef) and (rd^.deftype=orddef) then
  294. begin
  295. { 2 booleans ? }
  296. if is_boolean(ld) and is_boolean(rd) then
  297. begin
  298. if (cs_full_boolean_eval in aktlocalswitches) or
  299. (nodetype in [xorn,ltn,lten,gtn,gten]) then
  300. begin
  301. make_bool_equal_size;
  302. if (left.location.loc in [LOC_JUMP,LOC_FLAGS]) and
  303. (left.location.loc in [LOC_JUMP,LOC_FLAGS]) then
  304. calcregisters(self,2,0,0)
  305. else
  306. calcregisters(self,1,0,0);
  307. end
  308. else
  309. case nodetype of
  310. andn,
  311. orn:
  312. begin
  313. make_bool_equal_size;
  314. calcregisters(self,0,0,0);
  315. location.loc:=LOC_JUMP;
  316. end;
  317. unequaln,
  318. equaln:
  319. begin
  320. make_bool_equal_size;
  321. { Remove any compares with constants }
  322. if (left.nodetype=ordconstn) then
  323. begin
  324. hp:=right;
  325. b:=(tordconstnode(left).value<>0);
  326. ot:=nodetype;
  327. left.free;
  328. left:=nil;
  329. right:=nil;
  330. if (not(b) and (ot=equaln)) or
  331. (b and (ot=unequaln)) then
  332. begin
  333. hp:=cnotnode.create(hp);
  334. firstpass(hp);
  335. end;
  336. pass_1:=hp;
  337. exit;
  338. end;
  339. if (right.nodetype=ordconstn) then
  340. begin
  341. hp:=left;
  342. b:=(tordconstnode(right).value<>0);
  343. ot:=nodetype;
  344. right.free;
  345. right:=nil;
  346. left:=nil;
  347. if (not(b) and (ot=equaln)) or
  348. (b and (ot=unequaln)) then
  349. begin
  350. hp:=cnotnode.create(hp);
  351. firstpass(hp);
  352. end;
  353. pass_1:=hp;
  354. exit;
  355. end;
  356. if (left.location.loc in [LOC_JUMP,LOC_FLAGS]) and
  357. (left.location.loc in [LOC_JUMP,LOC_FLAGS]) then
  358. calcregisters(self,2,0,0)
  359. else
  360. calcregisters(self,1,0,0);
  361. end;
  362. else
  363. CGMessage(type_e_mismatch);
  364. end;
  365. (*
  366. { these one can't be in flags! }
  367. Yes they can, secondadd converts the loc_flags to a register.
  368. The typeconversions below are simply removed by firsttypeconv()
  369. because the resulttype of left = left.resulttype
  370. (surprise! :) (JM)
  371. if nodetype in [xorn,unequaln,equaln] then
  372. begin
  373. if left.location.loc=LOC_FLAGS then
  374. begin
  375. left:=gentypeconvnode(left,porddef(left.resulttype));
  376. left.convtype:=tc_bool_2_int;
  377. left.explizit:=true;
  378. firstpass(left);
  379. end;
  380. if right.location.loc=LOC_FLAGS then
  381. begin
  382. right:=gentypeconvnode(right,porddef(right.resulttype));
  383. right.convtype:=tc_bool_2_int;
  384. right.explizit:=true;
  385. firstpass(right);
  386. end;
  387. { readjust registers }
  388. calcregisters(p,1,0,0);
  389. end;
  390. *)
  391. convdone:=true;
  392. end
  393. else
  394. { Both are chars? only convert to shortstrings for addn }
  395. if is_char(rd) and is_char(ld) then
  396. begin
  397. if nodetype=addn then
  398. begin
  399. left:=gentypeconvnode(left,cshortstringdef);
  400. firstpass(left);
  401. hp := genaddsstringcharoptnode(self);
  402. firstpass(hp);
  403. pass_1 := hp;
  404. exit;
  405. end
  406. else
  407. calcregisters(self,1,0,0);
  408. convdone:=true;
  409. end
  410. { is there a 64 bit type ? }
  411. else if ((porddef(rd)^.typ=s64bit) or (porddef(ld)^.typ=s64bit)) and
  412. { the / operator is handled later }
  413. (nodetype<>slashn) then
  414. begin
  415. if (porddef(ld)^.typ<>s64bit) then
  416. begin
  417. left:=gentypeconvnode(left,cs64bitdef);
  418. firstpass(left);
  419. end;
  420. if (porddef(rd)^.typ<>s64bit) then
  421. begin
  422. right:=gentypeconvnode(right,cs64bitdef);
  423. firstpass(right);
  424. end;
  425. calcregisters(self,2,0,0);
  426. convdone:=true;
  427. end
  428. else if ((porddef(rd)^.typ=u64bit) or (porddef(ld)^.typ=u64bit)) and
  429. { the / operator is handled later }
  430. (nodetype<>slashn) then
  431. begin
  432. if (porddef(ld)^.typ<>u64bit) then
  433. begin
  434. left:=gentypeconvnode(left,cu64bitdef);
  435. firstpass(left);
  436. end;
  437. if (porddef(rd)^.typ<>u64bit) then
  438. begin
  439. right:=gentypeconvnode(right,cu64bitdef);
  440. firstpass(right);
  441. end;
  442. calcregisters(self,2,0,0);
  443. convdone:=true;
  444. end
  445. else
  446. { is there a cardinal? }
  447. if ((porddef(rd)^.typ=u32bit) or (porddef(ld)^.typ=u32bit)) and
  448. { the / operator is handled later }
  449. (nodetype<>slashn) then
  450. begin
  451. if is_signed(ld) and
  452. { then rd = u32bit }
  453. { convert positive constants to u32bit }
  454. not(is_constintnode(left) and
  455. (tordconstnode(left).value >= 0)) and
  456. { range/overflow checking on mixed signed/cardinal expressions }
  457. { is only possible if you convert everything to 64bit (JM) }
  458. ((aktlocalswitches * [cs_check_overflow,cs_check_range] <> []) and
  459. (nodetype in [addn,subn,muln])) then
  460. begin
  461. { perform the operation in 64bit }
  462. CGMessage(type_w_mixed_signed_unsigned);
  463. left := gentypeconvnode(left,cs64bitdef);
  464. firstpass(left);
  465. right := gentypeconvnode(right,cs64bitdef);
  466. firstpass(right);
  467. end
  468. else
  469. begin
  470. if is_signed(ld) and
  471. not(is_constintnode(left) and
  472. (tordconstnode(left).value >= 0)) and
  473. (cs_check_range in aktlocalswitches) then
  474. CGMessage(type_w_mixed_signed_unsigned2);
  475. left := gentypeconvnode(left,u32bitdef);
  476. firstpass(left);
  477. if is_signed(rd) and
  478. { then ld = u32bit }
  479. { convert positive constants to u32bit }
  480. not(is_constintnode(right) and
  481. (tordconstnode(right).value >= 0)) and
  482. ((aktlocalswitches * [cs_check_overflow,cs_check_range] <> []) and
  483. (nodetype in [addn,subn,muln])) then
  484. begin
  485. { perform the operation in 64bit }
  486. CGMessage(type_w_mixed_signed_unsigned);
  487. left := gentypeconvnode(left,cs64bitdef);
  488. firstpass(left);
  489. right := gentypeconvnode(right,cs64bitdef);
  490. firstpass(right);
  491. end
  492. else
  493. begin
  494. if is_signed(rd) and
  495. not(is_constintnode(right) and
  496. (tordconstnode(right).value >= 0)) and
  497. (cs_check_range in aktlocalswitches) then
  498. CGMessage(type_w_mixed_signed_unsigned2);
  499. right := gentypeconvnode(right,u32bitdef);
  500. firstpass(right);
  501. end;
  502. end;
  503. { did we convert things to 64bit? }
  504. if porddef(left.resulttype)^.typ = s64bit then
  505. calcregisters(self,2,0,0)
  506. else
  507. begin
  508. calcregisters(self,1,0,0);
  509. { for unsigned mul we need an extra register }
  510. if nodetype=muln then
  511. inc(registers32);
  512. end;
  513. convdone:=true;
  514. end;
  515. end
  516. else
  517. { left side a setdef, must be before string processing,
  518. else array constructor can be seen as array of char (PFV) }
  519. if (ld^.deftype=setdef) {or is_array_constructor(ld)} then
  520. begin
  521. { trying to add a set element? }
  522. if (nodetype=addn) and (rd^.deftype<>setdef) then
  523. begin
  524. if (rt=setelementn) then
  525. begin
  526. if not(is_equal(psetdef(ld)^.elementtype.def,rd)) then
  527. CGMessage(type_e_set_element_are_not_comp);
  528. end
  529. else
  530. CGMessage(type_e_mismatch)
  531. end
  532. else
  533. begin
  534. if not(nodetype in [addn,subn,symdifn,muln,equaln,unequaln
  535. {$IfNDef NoSetInclusion}
  536. ,lten,gten
  537. {$EndIf NoSetInclusion}
  538. ]) then
  539. CGMessage(type_e_set_operation_unknown);
  540. { right def must be a also be set }
  541. if (rd^.deftype<>setdef) or not(is_equal(rd,ld)) then
  542. CGMessage(type_e_set_element_are_not_comp);
  543. end;
  544. { ranges require normsets }
  545. if (psetdef(ld)^.settype=smallset) and
  546. (rt=setelementn) and
  547. assigned(tsetelementnode(right).right) then
  548. begin
  549. { generate a temporary normset def, it'll be destroyed
  550. when the symtable is unloaded }
  551. tempdef:=new(psetdef,init(psetdef(ld)^.elementtype.def,255));
  552. left:=gentypeconvnode(left,tempdef);
  553. firstpass(left);
  554. ld:=left.resulttype;
  555. end;
  556. { if the destination is not a smallset then insert a typeconv
  557. which loads a smallset into a normal set }
  558. if (psetdef(ld)^.settype<>smallset) and
  559. (psetdef(rd)^.settype=smallset) then
  560. begin
  561. if (right.nodetype=setconstn) then
  562. begin
  563. t:=gensetconstnode(tsetconstnode(right).value_set,psetdef(left.resulttype));
  564. tsetconstnode(t).left:=tsetconstnode(right).left;
  565. tsetconstnode(right).left:=nil;
  566. right.free;
  567. right:=t;
  568. end
  569. else
  570. right:=gentypeconvnode(right,psetdef(left.resulttype));
  571. firstpass(right);
  572. end;
  573. { do constant evaluation }
  574. if (right.nodetype=setconstn) and
  575. not assigned(tsetconstnode(right).left) and
  576. (left.nodetype=setconstn) and
  577. not assigned(tsetconstnode(left).left) then
  578. begin
  579. new(resultset);
  580. case nodetype of
  581. addn : begin
  582. for i:=0 to 31 do
  583. resultset^[i]:=
  584. tsetconstnode(right).value_set^[i] or tsetconstnode(left).value_set^[i];
  585. t:=gensetconstnode(resultset,psetdef(ld));
  586. end;
  587. muln : begin
  588. for i:=0 to 31 do
  589. resultset^[i]:=
  590. tsetconstnode(right).value_set^[i] and tsetconstnode(left).value_set^[i];
  591. t:=gensetconstnode(resultset,psetdef(ld));
  592. end;
  593. subn : begin
  594. for i:=0 to 31 do
  595. resultset^[i]:=
  596. tsetconstnode(left).value_set^[i] and not(tsetconstnode(right).value_set^[i]);
  597. t:=gensetconstnode(resultset,psetdef(ld));
  598. end;
  599. symdifn : begin
  600. for i:=0 to 31 do
  601. resultset^[i]:=
  602. tsetconstnode(left).value_set^[i] xor tsetconstnode(right).value_set^[i];
  603. t:=gensetconstnode(resultset,psetdef(ld));
  604. end;
  605. unequaln : begin
  606. b:=true;
  607. for i:=0 to 31 do
  608. if tsetconstnode(right).value_set^[i]=tsetconstnode(left).value_set^[i] then
  609. begin
  610. b:=false;
  611. break;
  612. end;
  613. t:=genordinalconstnode(ord(b),booldef);
  614. end;
  615. equaln : begin
  616. b:=true;
  617. for i:=0 to 31 do
  618. if tsetconstnode(right).value_set^[i]<>tsetconstnode(left).value_set^[i] then
  619. begin
  620. b:=false;
  621. break;
  622. end;
  623. t:=genordinalconstnode(ord(b),booldef);
  624. end;
  625. {$IfNDef NoSetInclusion}
  626. lten : Begin
  627. b := true;
  628. For i := 0 to 31 Do
  629. If (tsetconstnode(right).value_set^[i] And tsetconstnode(left).value_set^[i]) <>
  630. tsetconstnode(left).value_set^[i] Then
  631. Begin
  632. b := false;
  633. Break
  634. End;
  635. t := genordinalconstnode(ord(b),booldef);
  636. End;
  637. gten : Begin
  638. b := true;
  639. For i := 0 to 31 Do
  640. If (tsetconstnode(left).value_set^[i] And tsetconstnode(right).value_set^[i]) <>
  641. tsetconstnode(right).value_set^[i] Then
  642. Begin
  643. b := false;
  644. Break
  645. End;
  646. t := genordinalconstnode(ord(b),booldef);
  647. End;
  648. {$EndIf NoSetInclusion}
  649. end;
  650. dispose(resultset);
  651. firstpass(t);
  652. pass_1:=t;
  653. exit;
  654. end
  655. else
  656. if psetdef(ld)^.settype=smallset then
  657. begin
  658. { are we adding set elements ? }
  659. if right.nodetype=setelementn then
  660. calcregisters(self,2,0,0)
  661. else
  662. calcregisters(self,1,0,0);
  663. location.loc:=LOC_REGISTER;
  664. end
  665. else
  666. begin
  667. calcregisters(self,0,0,0);
  668. { here we call SET... }
  669. procinfo^.flags:=procinfo^.flags or pi_do_call;
  670. location.loc:=LOC_MEM;
  671. end;
  672. convdone:=true;
  673. end
  674. else
  675. { compare pchar to char arrays by addresses
  676. like BP/Delphi }
  677. if (is_pchar(ld) and is_chararray(rd)) or
  678. (is_pchar(rd) and is_chararray(ld)) then
  679. begin
  680. if is_chararray(rd) then
  681. begin
  682. right:=gentypeconvnode(right,ld);
  683. firstpass(right);
  684. end
  685. else
  686. begin
  687. left:=gentypeconvnode(left,rd);
  688. firstpass(left);
  689. end;
  690. location.loc:=LOC_REGISTER;
  691. calcregisters(self,1,0,0);
  692. convdone:=true;
  693. end
  694. else
  695. { is one of the operands a string?,
  696. chararrays are also handled as strings (after conversion) }
  697. if (rd^.deftype=stringdef) or (ld^.deftype=stringdef) or
  698. ((is_chararray(rd) or is_char(rd)) and
  699. (is_chararray(ld) or is_char(ld))) then
  700. begin
  701. if is_widestring(rd) or is_widestring(ld) then
  702. begin
  703. if not(is_widestring(rd)) then
  704. right:=gentypeconvnode(right,cwidestringdef);
  705. if not(is_widestring(ld)) then
  706. left:=gentypeconvnode(left,cwidestringdef);
  707. resulttype:=cwidestringdef;
  708. { this is only for add, the comparisaion is handled later }
  709. location.loc:=LOC_REGISTER;
  710. end
  711. else if is_ansistring(rd) or is_ansistring(ld) then
  712. begin
  713. if not(is_ansistring(rd)) then
  714. right:=gentypeconvnode(right,cansistringdef);
  715. if not(is_ansistring(ld)) then
  716. left:=gentypeconvnode(left,cansistringdef);
  717. { we use ansistrings so no fast exit here }
  718. procinfo^.no_fast_exit:=true;
  719. resulttype:=cansistringdef;
  720. { this is only for add, the comparisaion is handled later }
  721. location.loc:=LOC_REGISTER;
  722. end
  723. else if is_longstring(rd) or is_longstring(ld) then
  724. begin
  725. if not(is_longstring(rd)) then
  726. right:=gentypeconvnode(right,clongstringdef);
  727. if not(is_longstring(ld)) then
  728. left:=gentypeconvnode(left,clongstringdef);
  729. resulttype:=clongstringdef;
  730. { this is only for add, the comparisaion is handled later }
  731. location.loc:=LOC_MEM;
  732. end
  733. else
  734. begin
  735. if canbeaddsstringcharoptnode(self) then
  736. begin
  737. hp := genaddsstringcharoptnode(self);
  738. firstpass(hp);
  739. pass_1 := hp;
  740. exit;
  741. end;
  742. if canbeaddsstringcsstringoptnode(self) then
  743. begin
  744. hp := genaddsstringcsstringoptnode(self);
  745. firstpass(hp);
  746. pass_1 := hp;
  747. exit;
  748. end;
  749. if not(is_shortstring(ld)) then
  750. left:=gentypeconvnode(left,cshortstringdef);
  751. if not(is_shortstring(rd)) then
  752. right:=gentypeconvnode(right,cshortstringdef);
  753. resulttype:=left.resulttype;
  754. { this is only for add, the comparisaion is handled later }
  755. location.loc:=LOC_MEM;
  756. end;
  757. { only if there is a type cast we need to do again }
  758. { the first pass }
  759. if left.nodetype=typeconvn then
  760. firstpass(left);
  761. if right.nodetype=typeconvn then
  762. firstpass(right);
  763. { here we call STRCONCAT or STRCMP or STRCOPY }
  764. procinfo^.flags:=procinfo^.flags or pi_do_call;
  765. if location.loc=LOC_MEM then
  766. calcregisters(self,0,0,0)
  767. else
  768. calcregisters(self,1,0,0);
  769. convdone:=true;
  770. end
  771. else
  772. { is one a real float ? }
  773. if (rd^.deftype=floatdef) or (ld^.deftype=floatdef) then
  774. begin
  775. { if one is a fixed, then convert to f32bit }
  776. if ((rd^.deftype=floatdef) and (pfloatdef(rd)^.typ=f32bit)) or
  777. ((ld^.deftype=floatdef) and (pfloatdef(ld)^.typ=f32bit)) then
  778. begin
  779. if not is_integer(rd) or (nodetype<>muln) then
  780. right:=gentypeconvnode(right,s32fixeddef);
  781. if not is_integer(ld) or (nodetype<>muln) then
  782. left:=gentypeconvnode(left,s32fixeddef);
  783. firstpass(left);
  784. firstpass(right);
  785. calcregisters(self,1,0,0);
  786. location.loc:=LOC_REGISTER;
  787. end
  788. else
  789. { convert both to bestreal }
  790. begin
  791. right:=gentypeconvnode(right,bestrealdef^);
  792. left:=gentypeconvnode(left,bestrealdef^);
  793. firstpass(left);
  794. firstpass(right);
  795. calcregisters(self,0,1,0);
  796. location.loc:=LOC_FPU;
  797. end;
  798. convdone:=true;
  799. end
  800. else
  801. { pointer comperation and subtraction }
  802. if (rd^.deftype=pointerdef) and (ld^.deftype=pointerdef) then
  803. begin
  804. location.loc:=LOC_REGISTER;
  805. { right:=gentypeconvnode(right,ld); }
  806. { firstpass(right); }
  807. calcregisters(self,1,0,0);
  808. case nodetype of
  809. equaln,unequaln :
  810. begin
  811. if is_equal(right.resulttype,voidpointerdef) then
  812. begin
  813. right:=gentypeconvnode(right,ld);
  814. firstpass(right);
  815. end
  816. else if is_equal(left.resulttype,voidpointerdef) then
  817. begin
  818. left:=gentypeconvnode(left,rd);
  819. firstpass(left);
  820. end
  821. else if not(is_equal(ld,rd)) then
  822. CGMessage(type_e_mismatch);
  823. end;
  824. ltn,lten,gtn,gten:
  825. begin
  826. if is_equal(right.resulttype,voidpointerdef) then
  827. begin
  828. right:=gentypeconvnode(right,ld);
  829. firstpass(right);
  830. end
  831. else if is_equal(left.resulttype,voidpointerdef) then
  832. begin
  833. left:=gentypeconvnode(left,rd);
  834. firstpass(left);
  835. end
  836. else if not(is_equal(ld,rd)) then
  837. CGMessage(type_e_mismatch);
  838. if not(cs_extsyntax in aktmoduleswitches) then
  839. CGMessage(type_e_mismatch);
  840. end;
  841. subn:
  842. begin
  843. if not(is_equal(ld,rd)) then
  844. CGMessage(type_e_mismatch);
  845. if not(cs_extsyntax in aktmoduleswitches) then
  846. CGMessage(type_e_mismatch);
  847. resulttype:=s32bitdef;
  848. exit;
  849. end;
  850. else CGMessage(type_e_mismatch);
  851. end;
  852. convdone:=true;
  853. end
  854. else
  855. if is_class_or_interface(rd) or is_class_or_interface(ld) then
  856. begin
  857. location.loc:=LOC_REGISTER;
  858. if is_class_or_interface(rd) and is_class_or_interface(ld) then
  859. begin
  860. if pobjectdef(rd)^.is_related(pobjectdef(ld)) then
  861. right:=gentypeconvnode(right,ld)
  862. else
  863. left:=gentypeconvnode(left,rd);
  864. end
  865. else if is_class_or_interface(rd) then
  866. left:=gentypeconvnode(left,rd)
  867. else
  868. right:=gentypeconvnode(right,ld);
  869. firstpass(right);
  870. firstpass(left);
  871. calcregisters(self,1,0,0);
  872. case nodetype of
  873. equaln,unequaln:
  874. ;
  875. else CGMessage(type_e_mismatch);
  876. end;
  877. convdone:=true;
  878. end
  879. else
  880. if (rd^.deftype=classrefdef) and (ld^.deftype=classrefdef) then
  881. begin
  882. location.loc:=LOC_REGISTER;
  883. if pobjectdef(pclassrefdef(rd)^.pointertype.def)^.is_related(pobjectdef(
  884. pclassrefdef(ld)^.pointertype.def)) then
  885. right:=gentypeconvnode(right,ld)
  886. else
  887. left:=gentypeconvnode(left,rd);
  888. firstpass(right);
  889. firstpass(left);
  890. calcregisters(self,1,0,0);
  891. case nodetype of
  892. equaln,unequaln : ;
  893. else CGMessage(type_e_mismatch);
  894. end;
  895. convdone:=true;
  896. end
  897. else
  898. { allows comperasion with nil pointer }
  899. if is_class_or_interface(rd) then
  900. begin
  901. location.loc:=LOC_REGISTER;
  902. left:=gentypeconvnode(left,rd);
  903. firstpass(left);
  904. calcregisters(self,1,0,0);
  905. case nodetype of
  906. equaln,unequaln : ;
  907. else CGMessage(type_e_mismatch);
  908. end;
  909. convdone:=true;
  910. end
  911. else
  912. if is_class_or_interface(ld) then
  913. begin
  914. location.loc:=LOC_REGISTER;
  915. right:=gentypeconvnode(right,ld);
  916. firstpass(right);
  917. calcregisters(self,1,0,0);
  918. case nodetype of
  919. equaln,unequaln : ;
  920. else CGMessage(type_e_mismatch);
  921. end;
  922. convdone:=true;
  923. end
  924. else
  925. if (rd^.deftype=classrefdef) then
  926. begin
  927. left:=gentypeconvnode(left,rd);
  928. firstpass(left);
  929. calcregisters(self,1,0,0);
  930. case nodetype of
  931. equaln,unequaln : ;
  932. else CGMessage(type_e_mismatch);
  933. end;
  934. convdone:=true;
  935. end
  936. else
  937. if (ld^.deftype=classrefdef) then
  938. begin
  939. right:=gentypeconvnode(right,ld);
  940. firstpass(right);
  941. calcregisters(self,1,0,0);
  942. case nodetype of
  943. equaln,unequaln : ;
  944. else
  945. CGMessage(type_e_mismatch);
  946. end;
  947. convdone:=true;
  948. end
  949. else
  950. { support procvar=nil,procvar<>nil }
  951. if ((ld^.deftype=procvardef) and (rt=niln)) or
  952. ((rd^.deftype=procvardef) and (lt=niln)) then
  953. begin
  954. calcregisters(self,1,0,0);
  955. location.loc:=LOC_REGISTER;
  956. case nodetype of
  957. equaln,unequaln : ;
  958. else
  959. CGMessage(type_e_mismatch);
  960. end;
  961. convdone:=true;
  962. end
  963. else
  964. {$ifdef SUPPORT_MMX}
  965. if (cs_mmx in aktlocalswitches) and is_mmx_able_array(ld) and
  966. is_mmx_able_array(rd) and is_equal(ld,rd) then
  967. begin
  968. firstpass(right);
  969. firstpass(left);
  970. case nodetype of
  971. addn,subn,xorn,orn,andn:
  972. ;
  973. { mul is a little bit restricted }
  974. muln:
  975. if not(mmx_type(left.resulttype) in
  976. [mmxu16bit,mmxs16bit,mmxfixed16]) then
  977. CGMessage(type_e_mismatch);
  978. else
  979. CGMessage(type_e_mismatch);
  980. end;
  981. location.loc:=LOC_MMXREGISTER;
  982. calcregisters(self,0,0,1);
  983. convdone:=true;
  984. end
  985. else
  986. {$endif SUPPORT_MMX}
  987. { this is a little bit dangerous, also the left type }
  988. { should be checked! This broke the mmx support }
  989. if (rd^.deftype=pointerdef) or
  990. is_zero_based_array(rd) then
  991. begin
  992. if is_zero_based_array(rd) then
  993. begin
  994. resulttype:=new(ppointerdef,init(parraydef(rd)^.elementtype));
  995. right:=gentypeconvnode(right,resulttype);
  996. firstpass(right);
  997. end;
  998. location.loc:=LOC_REGISTER;
  999. left:=gentypeconvnode(left,s32bitdef);
  1000. firstpass(left);
  1001. calcregisters(self,1,0,0);
  1002. if nodetype=addn then
  1003. begin
  1004. if not(cs_extsyntax in aktmoduleswitches) or
  1005. (not(is_pchar(ld)) and not(m_add_pointer in aktmodeswitches)) then
  1006. CGMessage(type_e_mismatch);
  1007. { Dirty hack, to support multiple firstpasses (PFV) }
  1008. if (resulttype=nil) and
  1009. (rd^.deftype=pointerdef) and
  1010. (ppointerdef(rd)^.pointertype.def^.size>1) then
  1011. begin
  1012. left:=caddnode.create(muln,left,genordinalconstnode(ppointerdef(rd)^.pointertype.def^.size,s32bitdef));
  1013. firstpass(left);
  1014. end;
  1015. end
  1016. else
  1017. CGMessage(type_e_mismatch);
  1018. convdone:=true;
  1019. end
  1020. else
  1021. if (ld^.deftype=pointerdef) or
  1022. is_zero_based_array(ld) then
  1023. begin
  1024. if is_zero_based_array(ld) then
  1025. begin
  1026. resulttype:=new(ppointerdef,init(parraydef(ld)^.elementtype));
  1027. left:=gentypeconvnode(left,resulttype);
  1028. firstpass(left);
  1029. end;
  1030. location.loc:=LOC_REGISTER;
  1031. right:=gentypeconvnode(right,s32bitdef);
  1032. firstpass(right);
  1033. calcregisters(self,1,0,0);
  1034. case nodetype of
  1035. addn,subn : begin
  1036. if not(cs_extsyntax in aktmoduleswitches) or
  1037. (not(is_pchar(ld)) and not(m_add_pointer in aktmodeswitches)) then
  1038. CGMessage(type_e_mismatch);
  1039. { Dirty hack, to support multiple firstpasses (PFV) }
  1040. if (resulttype=nil) and
  1041. (ld^.deftype=pointerdef) and
  1042. (ppointerdef(ld)^.pointertype.def^.size>1) then
  1043. begin
  1044. right:=caddnode.create(muln,right,
  1045. genordinalconstnode(ppointerdef(ld)^.pointertype.def^.size,s32bitdef));
  1046. firstpass(right);
  1047. end;
  1048. end;
  1049. else
  1050. CGMessage(type_e_mismatch);
  1051. end;
  1052. convdone:=true;
  1053. end
  1054. else
  1055. if (rd^.deftype=procvardef) and (ld^.deftype=procvardef) and is_equal(rd,ld) then
  1056. begin
  1057. calcregisters(self,1,0,0);
  1058. location.loc:=LOC_REGISTER;
  1059. case nodetype of
  1060. equaln,unequaln : ;
  1061. else
  1062. CGMessage(type_e_mismatch);
  1063. end;
  1064. convdone:=true;
  1065. end
  1066. else
  1067. if (ld^.deftype=enumdef) and (rd^.deftype=enumdef) then
  1068. begin
  1069. if not(is_equal(ld,rd)) then
  1070. begin
  1071. right:=gentypeconvnode(right,ld);
  1072. firstpass(right);
  1073. end;
  1074. calcregisters(self,1,0,0);
  1075. case nodetype of
  1076. equaln,unequaln,
  1077. ltn,lten,gtn,gten : ;
  1078. else CGMessage(type_e_mismatch);
  1079. end;
  1080. convdone:=true;
  1081. end;
  1082. { the general solution is to convert to 32 bit int }
  1083. if not convdone then
  1084. begin
  1085. { but an int/int gives real/real! }
  1086. if nodetype=slashn then
  1087. begin
  1088. CGMessage(type_h_use_div_for_int);
  1089. right:=gentypeconvnode(right,bestrealdef^);
  1090. left:=gentypeconvnode(left,bestrealdef^);
  1091. firstpass(left);
  1092. firstpass(right);
  1093. { maybe we need an integer register to save }
  1094. { a reference }
  1095. if ((left.location.loc<>LOC_FPU) or
  1096. (right.location.loc<>LOC_FPU)) and
  1097. (left.registers32=right.registers32) then
  1098. calcregisters(self,1,1,0)
  1099. else
  1100. calcregisters(self,0,1,0);
  1101. location.loc:=LOC_FPU;
  1102. end
  1103. else
  1104. begin
  1105. right:=gentypeconvnode(right,s32bitdef);
  1106. left:=gentypeconvnode(left,s32bitdef);
  1107. firstpass(left);
  1108. firstpass(right);
  1109. calcregisters(self,1,0,0);
  1110. location.loc:=LOC_REGISTER;
  1111. end;
  1112. end;
  1113. if codegenerror then
  1114. exit;
  1115. { determines result type for comparions }
  1116. { here the is a problem with multiple passes }
  1117. { example length(s)+1 gets internal 'longint' type first }
  1118. { if it is a arg it is converted to 'LONGINT' }
  1119. { but a second first pass will reset this to 'longint' }
  1120. case nodetype of
  1121. ltn,lten,gtn,gten,equaln,unequaln:
  1122. begin
  1123. if (not assigned(resulttype)) or
  1124. (resulttype^.deftype=stringdef) then
  1125. resulttype:=booldef;
  1126. if is_64bitint(left.resulttype) then
  1127. location.loc:=LOC_JUMP
  1128. else
  1129. location.loc:=LOC_FLAGS;
  1130. end;
  1131. xorn:
  1132. begin
  1133. if not assigned(resulttype) then
  1134. resulttype:=left.resulttype;
  1135. location.loc:=LOC_REGISTER;
  1136. end;
  1137. addn:
  1138. begin
  1139. if not assigned(resulttype) then
  1140. begin
  1141. { for strings, return is always a 255 char string }
  1142. if is_shortstring(left.resulttype) then
  1143. resulttype:=cshortstringdef
  1144. else
  1145. resulttype:=left.resulttype;
  1146. end;
  1147. end;
  1148. else
  1149. if not assigned(resulttype) then
  1150. resulttype:=left.resulttype;
  1151. end;
  1152. end;
  1153. begin
  1154. caddnode:=taddnode;
  1155. end.
  1156. {
  1157. $Log$
  1158. Revision 1.21 2001-01-14 22:13:13 peter
  1159. * constant calculation fixed. The type of the new constant is now
  1160. defined after the calculation is done. This should remove a lot
  1161. of wrong warnings (and errors with -Cr).
  1162. Revision 1.20 2000/12/31 11:14:10 jonas
  1163. + implemented/fixed docompare() mathods for all nodes (not tested)
  1164. + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
  1165. and constant strings/chars together
  1166. * n386add.pas: don't copy temp strings (of size 256) to another temp string
  1167. when adding
  1168. Revision 1.19 2000/12/16 15:55:32 jonas
  1169. + warning when there is a chance to get a range check error because of
  1170. automatic type conversion to u32bit
  1171. * arithmetic operations with a cardinal and a signed operand are carried
  1172. out in 64bit when range checking is on ("merged" from fixes branch)
  1173. Revision 1.18 2000/11/29 00:30:31 florian
  1174. * unused units removed from uses clause
  1175. * some changes for widestrings
  1176. Revision 1.17 2000/11/20 15:30:42 jonas
  1177. * changed types of values used for constant expression evaluation to
  1178. tconstexprint
  1179. Revision 1.16 2000/11/13 11:30:55 florian
  1180. * some bugs with interfaces and NIL fixed
  1181. Revision 1.15 2000/11/04 14:25:20 florian
  1182. + merged Attila's changes for interfaces, not tested yet
  1183. Revision 1.14 2000/10/31 22:02:47 peter
  1184. * symtable splitted, no real code changes
  1185. Revision 1.13 2000/10/14 10:14:50 peter
  1186. * moehrendorf oct 2000 rewrite
  1187. Revision 1.12 2000/10/01 19:48:23 peter
  1188. * lot of compile updates for cg11
  1189. Revision 1.11 2000/09/30 16:08:45 peter
  1190. * more cg11 updates
  1191. Revision 1.10 2000/09/28 19:49:52 florian
  1192. *** empty log message ***
  1193. Revision 1.9 2000/09/27 21:33:22 florian
  1194. * finally nadd.pas compiles
  1195. Revision 1.8 2000/09/27 20:25:44 florian
  1196. * more stuff fixed
  1197. Revision 1.7 2000/09/27 18:14:31 florian
  1198. * fixed a lot of syntax errors in the n*.pas stuff
  1199. Revision 1.6 2000/09/24 15:06:19 peter
  1200. * use defines.inc
  1201. Revision 1.5 2000/09/22 22:42:52 florian
  1202. * more fixes
  1203. Revision 1.4 2000/09/21 12:22:42 jonas
  1204. * put piece of code between -dnewoptimizations2 since it wasn't
  1205. necessary otherwise
  1206. + support for full boolean evaluation (from tcadd)
  1207. Revision 1.3 2000/09/20 21:50:59 florian
  1208. * updated
  1209. Revision 1.2 2000/08/29 08:24:45 jonas
  1210. * some modifications to -dcardinalmulfix code
  1211. Revision 1.1 2000/08/26 12:24:20 florian
  1212. * initial release
  1213. }