nadd.pas 49 KB

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