nadd.pas 48 KB

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