nadd.pas 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289
  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) or is_class_or_interface(ld) then
  853. begin
  854. location.loc:=LOC_REGISTER;
  855. if is_class_or_interface(rd) and is_class_or_interface(ld) then
  856. begin
  857. if pobjectdef(rd)^.is_related(pobjectdef(ld)) then
  858. right:=gentypeconvnode(right,ld)
  859. else
  860. left:=gentypeconvnode(left,rd);
  861. end
  862. else if is_class_or_interface(rd) then
  863. left:=gentypeconvnode(left,rd)
  864. else
  865. right:=gentypeconvnode(right,ld);
  866. firstpass(right);
  867. firstpass(left);
  868. calcregisters(self,1,0,0);
  869. case nodetype of
  870. equaln,unequaln:
  871. ;
  872. else CGMessage(type_e_mismatch);
  873. end;
  874. convdone:=true;
  875. end
  876. else
  877. if (rd^.deftype=classrefdef) and (ld^.deftype=classrefdef) then
  878. begin
  879. location.loc:=LOC_REGISTER;
  880. if pobjectdef(pclassrefdef(rd)^.pointertype.def)^.is_related(pobjectdef(
  881. pclassrefdef(ld)^.pointertype.def)) then
  882. right:=gentypeconvnode(right,ld)
  883. else
  884. left:=gentypeconvnode(left,rd);
  885. firstpass(right);
  886. firstpass(left);
  887. calcregisters(self,1,0,0);
  888. case nodetype of
  889. equaln,unequaln : ;
  890. else CGMessage(type_e_mismatch);
  891. end;
  892. convdone:=true;
  893. end
  894. else
  895. { allows comperasion with nil pointer }
  896. if is_class_or_interface(rd) then
  897. begin
  898. location.loc:=LOC_REGISTER;
  899. left:=gentypeconvnode(left,rd);
  900. firstpass(left);
  901. calcregisters(self,1,0,0);
  902. case nodetype of
  903. equaln,unequaln : ;
  904. else CGMessage(type_e_mismatch);
  905. end;
  906. convdone:=true;
  907. end
  908. else
  909. if is_class_or_interface(ld) then
  910. begin
  911. location.loc:=LOC_REGISTER;
  912. right:=gentypeconvnode(right,ld);
  913. firstpass(right);
  914. calcregisters(self,1,0,0);
  915. case nodetype of
  916. equaln,unequaln : ;
  917. else CGMessage(type_e_mismatch);
  918. end;
  919. convdone:=true;
  920. end
  921. else
  922. if (rd^.deftype=classrefdef) then
  923. begin
  924. left:=gentypeconvnode(left,rd);
  925. firstpass(left);
  926. calcregisters(self,1,0,0);
  927. case nodetype of
  928. equaln,unequaln : ;
  929. else CGMessage(type_e_mismatch);
  930. end;
  931. convdone:=true;
  932. end
  933. else
  934. if (ld^.deftype=classrefdef) then
  935. begin
  936. right:=gentypeconvnode(right,ld);
  937. firstpass(right);
  938. calcregisters(self,1,0,0);
  939. case nodetype of
  940. equaln,unequaln : ;
  941. else
  942. CGMessage(type_e_mismatch);
  943. end;
  944. convdone:=true;
  945. end
  946. else
  947. { support procvar=nil,procvar<>nil }
  948. if ((ld^.deftype=procvardef) and (rt=niln)) or
  949. ((rd^.deftype=procvardef) and (lt=niln)) then
  950. begin
  951. calcregisters(self,1,0,0);
  952. location.loc:=LOC_REGISTER;
  953. case nodetype of
  954. equaln,unequaln : ;
  955. else
  956. CGMessage(type_e_mismatch);
  957. end;
  958. convdone:=true;
  959. end
  960. else
  961. {$ifdef SUPPORT_MMX}
  962. if (cs_mmx in aktlocalswitches) and is_mmx_able_array(ld) and
  963. is_mmx_able_array(rd) and is_equal(ld,rd) then
  964. begin
  965. firstpass(right);
  966. firstpass(left);
  967. case nodetype of
  968. addn,subn,xorn,orn,andn:
  969. ;
  970. { mul is a little bit restricted }
  971. muln:
  972. if not(mmx_type(left.resulttype) in
  973. [mmxu16bit,mmxs16bit,mmxfixed16]) then
  974. CGMessage(type_e_mismatch);
  975. else
  976. CGMessage(type_e_mismatch);
  977. end;
  978. location.loc:=LOC_MMXREGISTER;
  979. calcregisters(self,0,0,1);
  980. convdone:=true;
  981. end
  982. else
  983. {$endif SUPPORT_MMX}
  984. { this is a little bit dangerous, also the left type }
  985. { should be checked! This broke the mmx support }
  986. if (rd^.deftype=pointerdef) or
  987. is_zero_based_array(rd) then
  988. begin
  989. if is_zero_based_array(rd) then
  990. begin
  991. resulttype:=new(ppointerdef,init(parraydef(rd)^.elementtype));
  992. right:=gentypeconvnode(right,resulttype);
  993. firstpass(right);
  994. end;
  995. location.loc:=LOC_REGISTER;
  996. left:=gentypeconvnode(left,s32bitdef);
  997. firstpass(left);
  998. calcregisters(self,1,0,0);
  999. if nodetype=addn then
  1000. begin
  1001. if not(cs_extsyntax in aktmoduleswitches) or
  1002. (not(is_pchar(ld)) and not(m_add_pointer in aktmodeswitches)) then
  1003. CGMessage(type_e_mismatch);
  1004. { Dirty hack, to support multiple firstpasses (PFV) }
  1005. if (resulttype=nil) and
  1006. (rd^.deftype=pointerdef) and
  1007. (ppointerdef(rd)^.pointertype.def^.size>1) then
  1008. begin
  1009. left:=caddnode.create(muln,left,genordinalconstnode(ppointerdef(rd)^.pointertype.def^.size,s32bitdef));
  1010. firstpass(left);
  1011. end;
  1012. end
  1013. else
  1014. CGMessage(type_e_mismatch);
  1015. convdone:=true;
  1016. end
  1017. else
  1018. if (ld^.deftype=pointerdef) or
  1019. is_zero_based_array(ld) then
  1020. begin
  1021. if is_zero_based_array(ld) then
  1022. begin
  1023. resulttype:=new(ppointerdef,init(parraydef(ld)^.elementtype));
  1024. left:=gentypeconvnode(left,resulttype);
  1025. firstpass(left);
  1026. end;
  1027. location.loc:=LOC_REGISTER;
  1028. right:=gentypeconvnode(right,s32bitdef);
  1029. firstpass(right);
  1030. calcregisters(self,1,0,0);
  1031. case nodetype of
  1032. addn,subn : begin
  1033. if not(cs_extsyntax in aktmoduleswitches) or
  1034. (not(is_pchar(ld)) and not(m_add_pointer in aktmodeswitches)) then
  1035. CGMessage(type_e_mismatch);
  1036. { Dirty hack, to support multiple firstpasses (PFV) }
  1037. if (resulttype=nil) and
  1038. (ld^.deftype=pointerdef) and
  1039. (ppointerdef(ld)^.pointertype.def^.size>1) then
  1040. begin
  1041. right:=caddnode.create(muln,right,
  1042. genordinalconstnode(ppointerdef(ld)^.pointertype.def^.size,s32bitdef));
  1043. firstpass(right);
  1044. end;
  1045. end;
  1046. else
  1047. CGMessage(type_e_mismatch);
  1048. end;
  1049. convdone:=true;
  1050. end
  1051. else
  1052. if (rd^.deftype=procvardef) and (ld^.deftype=procvardef) and is_equal(rd,ld) then
  1053. begin
  1054. calcregisters(self,1,0,0);
  1055. location.loc:=LOC_REGISTER;
  1056. case nodetype of
  1057. equaln,unequaln : ;
  1058. else
  1059. CGMessage(type_e_mismatch);
  1060. end;
  1061. convdone:=true;
  1062. end
  1063. else
  1064. if (ld^.deftype=enumdef) and (rd^.deftype=enumdef) then
  1065. begin
  1066. if not(is_equal(ld,rd)) then
  1067. begin
  1068. right:=gentypeconvnode(right,ld);
  1069. firstpass(right);
  1070. end;
  1071. calcregisters(self,1,0,0);
  1072. case nodetype of
  1073. equaln,unequaln,
  1074. ltn,lten,gtn,gten : ;
  1075. else CGMessage(type_e_mismatch);
  1076. end;
  1077. convdone:=true;
  1078. end;
  1079. { the general solution is to convert to 32 bit int }
  1080. if not convdone then
  1081. begin
  1082. { but an int/int gives real/real! }
  1083. if nodetype=slashn then
  1084. begin
  1085. CGMessage(type_h_use_div_for_int);
  1086. right:=gentypeconvnode(right,bestrealdef^);
  1087. left:=gentypeconvnode(left,bestrealdef^);
  1088. firstpass(left);
  1089. firstpass(right);
  1090. { maybe we need an integer register to save }
  1091. { a reference }
  1092. if ((left.location.loc<>LOC_FPU) or
  1093. (right.location.loc<>LOC_FPU)) and
  1094. (left.registers32=right.registers32) then
  1095. calcregisters(self,1,1,0)
  1096. else
  1097. calcregisters(self,0,1,0);
  1098. location.loc:=LOC_FPU;
  1099. end
  1100. else
  1101. begin
  1102. right:=gentypeconvnode(right,s32bitdef);
  1103. left:=gentypeconvnode(left,s32bitdef);
  1104. firstpass(left);
  1105. firstpass(right);
  1106. calcregisters(self,1,0,0);
  1107. location.loc:=LOC_REGISTER;
  1108. end;
  1109. end;
  1110. if codegenerror then
  1111. exit;
  1112. { determines result type for comparions }
  1113. { here the is a problem with multiple passes }
  1114. { example length(s)+1 gets internal 'longint' type first }
  1115. { if it is a arg it is converted to 'LONGINT' }
  1116. { but a second first pass will reset this to 'longint' }
  1117. case nodetype of
  1118. ltn,lten,gtn,gten,equaln,unequaln:
  1119. begin
  1120. if (not assigned(resulttype)) or
  1121. (resulttype^.deftype=stringdef) then
  1122. resulttype:=booldef;
  1123. if is_64bitint(left.resulttype) then
  1124. location.loc:=LOC_JUMP
  1125. else
  1126. location.loc:=LOC_FLAGS;
  1127. end;
  1128. xorn:
  1129. begin
  1130. if not assigned(resulttype) then
  1131. resulttype:=left.resulttype;
  1132. location.loc:=LOC_REGISTER;
  1133. end;
  1134. addn:
  1135. begin
  1136. if not assigned(resulttype) then
  1137. begin
  1138. { for strings, return is always a 255 char string }
  1139. if is_shortstring(left.resulttype) then
  1140. resulttype:=cshortstringdef
  1141. else
  1142. resulttype:=left.resulttype;
  1143. end;
  1144. end;
  1145. {$ifdef cardinalmulfix}
  1146. muln:
  1147. { if we multiply an unsigned with a signed number, the result is signed }
  1148. { in the other cases, the result remains signed or unsigned depending on }
  1149. { the multiplication factors (JM) }
  1150. if (left.resulttype^.deftype = orddef) and
  1151. (right.resulttype^.deftype = orddef) and
  1152. is_signed(right.resulttype) then
  1153. resulttype := right.resulttype
  1154. else resulttype := left.resulttype;
  1155. (*
  1156. subn:
  1157. { if we substract a u32bit from a positive constant, the result becomes }
  1158. { s32bit as well (JM) }
  1159. begin
  1160. if (right.resulttype^.deftype = orddef) and
  1161. (left.resulttype^.deftype = orddef) and
  1162. (porddef(right.resulttype)^.typ = u32bit) and
  1163. is_constintnode(left) and
  1164. { (porddef(left.resulttype)^.typ <> u32bit) and}
  1165. (left.value > 0) then
  1166. begin
  1167. left := gentypeconvnode(left,u32bitdef);
  1168. firstpass(left);
  1169. end;
  1170. resulttype:=left.resulttype;
  1171. end;
  1172. *)
  1173. {$endif cardinalmulfix}
  1174. else
  1175. resulttype:=left.resulttype;
  1176. end;
  1177. end;
  1178. begin
  1179. caddnode:=taddnode;
  1180. end.
  1181. {
  1182. $Log$
  1183. Revision 1.16 2000-11-13 11:30:55 florian
  1184. * some bugs with interfaces and NIL fixed
  1185. Revision 1.15 2000/11/04 14:25:20 florian
  1186. + merged Attila's changes for interfaces, not tested yet
  1187. Revision 1.14 2000/10/31 22:02:47 peter
  1188. * symtable splitted, no real code changes
  1189. Revision 1.13 2000/10/14 10:14:50 peter
  1190. * moehrendorf oct 2000 rewrite
  1191. Revision 1.12 2000/10/01 19:48:23 peter
  1192. * lot of compile updates for cg11
  1193. Revision 1.11 2000/09/30 16:08:45 peter
  1194. * more cg11 updates
  1195. Revision 1.10 2000/09/28 19:49:52 florian
  1196. *** empty log message ***
  1197. Revision 1.9 2000/09/27 21:33:22 florian
  1198. * finally nadd.pas compiles
  1199. Revision 1.8 2000/09/27 20:25:44 florian
  1200. * more stuff fixed
  1201. Revision 1.7 2000/09/27 18:14:31 florian
  1202. * fixed a lot of syntax errors in the n*.pas stuff
  1203. Revision 1.6 2000/09/24 15:06:19 peter
  1204. * use defines.inc
  1205. Revision 1.5 2000/09/22 22:42:52 florian
  1206. * more fixes
  1207. Revision 1.4 2000/09/21 12:22:42 jonas
  1208. * put piece of code between -dnewoptimizations2 since it wasn't
  1209. necessary otherwise
  1210. + support for full boolean evaluation (from tcadd)
  1211. Revision 1.3 2000/09/20 21:50:59 florian
  1212. * updated
  1213. Revision 1.2 2000/08/29 08:24:45 jonas
  1214. * some modifications to -dcardinalmulfix code
  1215. Revision 1.1 2000/08/26 12:24:20 florian
  1216. * initial release
  1217. }