nadd.pas 50 KB

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