tcadd.pas 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290
  1. {
  2. $Id$
  3. Copyright (c) 1993-98 by Florian Klaempfl
  4. Type checking and register allocation for add node
  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 tcadd;
  19. interface
  20. uses
  21. tree;
  22. procedure firstadd(var p : ptree);
  23. function isbinaryoverloaded(var p : ptree) : boolean;
  24. implementation
  25. uses
  26. globtype,systems,tokens,
  27. cobjects,verbose,globals,
  28. symconst,symtable,aasm,types,
  29. hcodegen,htypechk,pass_1,
  30. cpubase,tccnv
  31. ;
  32. function isbinaryoverloaded(var p : ptree) : boolean;
  33. var
  34. rd,ld : pdef;
  35. t : ptree;
  36. optoken : ttoken;
  37. begin
  38. isbinaryoverloaded:=false;
  39. { overloaded operator ? }
  40. { load easier access variables }
  41. rd:=p^.right^.resulttype;
  42. ld:=p^.left^.resulttype;
  43. if (p^.treetype=starstarn) or
  44. (ld^.deftype=recorddef) or
  45. ((ld^.deftype=arraydef) and
  46. not((cs_mmx in aktlocalswitches) and
  47. is_mmx_able_array(ld)) and
  48. (not (rd^.deftype in [orddef])) and
  49. (not is_chararray(ld))
  50. ) or
  51. { <> and = are defined for classes }
  52. ((ld^.deftype=objectdef) and
  53. (not(pobjectdef(ld)^.is_class) or
  54. not(p^.treetype in [equaln,unequaln])
  55. )
  56. ) or
  57. (rd^.deftype=recorddef) or
  58. ((rd^.deftype=arraydef) and
  59. not((cs_mmx in aktlocalswitches) and
  60. is_mmx_able_array(rd)) and
  61. (not (ld^.deftype in [orddef])) and
  62. (not is_chararray(rd))
  63. ) or
  64. { <> and = are defined for classes }
  65. ((rd^.deftype=objectdef) and
  66. (not(pobjectdef(rd)^.is_class) or
  67. not(p^.treetype in [equaln,unequaln])
  68. )
  69. ) then
  70. begin
  71. isbinaryoverloaded:=true;
  72. {!!!!!!!!! handle paras }
  73. case p^.treetype of
  74. { the nil as symtable signs firstcalln that this is
  75. an overloaded operator }
  76. addn:
  77. optoken:=_PLUS;
  78. subn:
  79. optoken:=_MINUS;
  80. muln:
  81. optoken:=_STAR;
  82. starstarn:
  83. optoken:=_STARSTAR;
  84. slashn:
  85. optoken:=_SLASH;
  86. ltn:
  87. optoken:=tokens._lt;
  88. gtn:
  89. optoken:=tokens._gt;
  90. lten:
  91. optoken:=_lte;
  92. gten:
  93. optoken:=_gte;
  94. equaln,unequaln :
  95. optoken:=_EQUAL;
  96. symdifn :
  97. optoken:=_SYMDIF;
  98. modn :
  99. optoken:=_OP_MOD;
  100. orn :
  101. optoken:=_OP_OR;
  102. xorn :
  103. optoken:=_OP_XOR;
  104. andn :
  105. optoken:=_OP_AND;
  106. divn :
  107. optoken:=_OP_DIV;
  108. shln :
  109. optoken:=_OP_SHL;
  110. shrn :
  111. optoken:=_OP_SHR;
  112. else
  113. exit;
  114. end;
  115. t:=gencallnode(overloaded_operators[optoken],nil);
  116. { we have to convert p^.left and p^.right into
  117. callparanodes }
  118. if t^.symtableprocentry=nil then
  119. begin
  120. CGMessage(parser_e_operator_not_overloaded);
  121. putnode(t);
  122. end
  123. else
  124. begin
  125. inc(t^.symtableprocentry^.refs);
  126. t^.left:=gencallparanode(p^.left,nil);
  127. t^.left:=gencallparanode(p^.right,t^.left);
  128. if p^.treetype=unequaln then
  129. t:=gensinglenode(notn,t);
  130. firstpass(t);
  131. putnode(p);
  132. p:=t;
  133. end;
  134. end;
  135. end;
  136. {*****************************************************************************
  137. FirstAdd
  138. *****************************************************************************}
  139. procedure firstadd(var p : ptree);
  140. procedure make_bool_equal_size(var p:ptree);
  141. begin
  142. if porddef(p^.left^.resulttype)^.typ>porddef(p^.right^.resulttype)^.typ then
  143. begin
  144. p^.right:=gentypeconvnode(p^.right,porddef(p^.left^.resulttype));
  145. p^.right^.convtyp:=tc_bool_2_int;
  146. p^.right^.explizit:=true;
  147. firstpass(p^.right);
  148. end
  149. else
  150. if porddef(p^.left^.resulttype)^.typ<porddef(p^.right^.resulttype)^.typ then
  151. begin
  152. p^.left:=gentypeconvnode(p^.left,porddef(p^.right^.resulttype));
  153. p^.left^.convtyp:=tc_bool_2_int;
  154. p^.left^.explizit:=true;
  155. firstpass(p^.left);
  156. end;
  157. end;
  158. var
  159. t,hp : ptree;
  160. ot,
  161. lt,rt : ttreetyp;
  162. rv,lv : longint;
  163. rvd,lvd : bestreal;
  164. resdef,
  165. rd,ld : pdef;
  166. tempdef : pdef;
  167. concatstrings : boolean;
  168. { to evalute const sets }
  169. resultset : pconstset;
  170. i : longint;
  171. b : boolean;
  172. convdone : boolean;
  173. s1,s2 : pchar;
  174. l1,l2 : longint;
  175. begin
  176. { first do the two subtrees }
  177. firstpass(p^.left);
  178. firstpass(p^.right);
  179. if codegenerror then
  180. exit;
  181. { convert array constructors to sets, because there is no other operator
  182. possible for array constructors }
  183. if is_array_constructor(p^.left^.resulttype) then
  184. arrayconstructor_to_set(p^.left);
  185. if is_array_constructor(p^.right^.resulttype) then
  186. arrayconstructor_to_set(p^.right);
  187. { both left and right need to be valid }
  188. set_varstate(p^.left,true);
  189. set_varstate(p^.right,true);
  190. { load easier access variables }
  191. lt:=p^.left^.treetype;
  192. rt:=p^.right^.treetype;
  193. rd:=p^.right^.resulttype;
  194. ld:=p^.left^.resulttype;
  195. convdone:=false;
  196. if isbinaryoverloaded(p) then
  197. exit;
  198. { compact consts }
  199. { convert int consts to real consts, if the }
  200. { other operand is a real const }
  201. if (rt=realconstn) and is_constintnode(p^.left) then
  202. begin
  203. t:=genrealconstnode(p^.left^.value,p^.right^.resulttype);
  204. disposetree(p^.left);
  205. p^.left:=t;
  206. lt:=realconstn;
  207. end;
  208. if (lt=realconstn) and is_constintnode(p^.right) then
  209. begin
  210. t:=genrealconstnode(p^.right^.value,p^.left^.resulttype);
  211. disposetree(p^.right);
  212. p^.right:=t;
  213. rt:=realconstn;
  214. end;
  215. { both are int constants, also allow operations on two equal enums
  216. in fpc mode (Needed for conversion of C code) }
  217. if ((lt=ordconstn) and (rt=ordconstn)) and
  218. ((is_constintnode(p^.left) and is_constintnode(p^.right)) or
  219. (is_constboolnode(p^.left) and is_constboolnode(p^.right) and
  220. (p^.treetype in [ltn,lten,gtn,gten,equaln,unequaln,andn,xorn,orn]))) then
  221. begin
  222. { return a boolean for boolean operations (and,xor,or) }
  223. if is_constboolnode(p^.left) then
  224. resdef:=booldef
  225. else
  226. resdef:=s32bitdef;
  227. lv:=p^.left^.value;
  228. rv:=p^.right^.value;
  229. case p^.treetype of
  230. addn : t:=genordinalconstnode(lv+rv,resdef);
  231. subn : t:=genordinalconstnode(lv-rv,resdef);
  232. muln : t:=genordinalconstnode(lv*rv,resdef);
  233. xorn : t:=genordinalconstnode(lv xor rv,resdef);
  234. orn : t:=genordinalconstnode(lv or rv,resdef);
  235. andn : t:=genordinalconstnode(lv and rv,resdef);
  236. ltn : t:=genordinalconstnode(ord(lv<rv),booldef);
  237. lten : t:=genordinalconstnode(ord(lv<=rv),booldef);
  238. gtn : t:=genordinalconstnode(ord(lv>rv),booldef);
  239. gten : t:=genordinalconstnode(ord(lv>=rv),booldef);
  240. equaln : t:=genordinalconstnode(ord(lv=rv),booldef);
  241. unequaln : t:=genordinalconstnode(ord(lv<>rv),booldef);
  242. slashn : begin
  243. { int/int becomes a real }
  244. if int(rv)=0 then
  245. begin
  246. Message(parser_e_invalid_float_operation);
  247. t:=genrealconstnode(0,bestrealdef^);
  248. end
  249. else
  250. t:=genrealconstnode(int(lv)/int(rv),bestrealdef^);
  251. firstpass(t);
  252. end;
  253. else
  254. CGMessage(type_e_mismatch);
  255. end;
  256. disposetree(p);
  257. firstpass(t);
  258. p:=t;
  259. exit;
  260. end;
  261. { both real constants ? }
  262. if (lt=realconstn) and (rt=realconstn) then
  263. begin
  264. lvd:=p^.left^.value_real;
  265. rvd:=p^.right^.value_real;
  266. case p^.treetype of
  267. addn : t:=genrealconstnode(lvd+rvd,bestrealdef^);
  268. subn : t:=genrealconstnode(lvd-rvd,bestrealdef^);
  269. muln : t:=genrealconstnode(lvd*rvd,bestrealdef^);
  270. starstarn,
  271. caretn : begin
  272. if lvd<0 then
  273. begin
  274. Message(parser_e_invalid_float_operation);
  275. t:=genrealconstnode(0,bestrealdef^);
  276. end
  277. else if lvd=0 then
  278. t:=genrealconstnode(1.0,bestrealdef^)
  279. else
  280. t:=genrealconstnode(exp(ln(lvd)*rvd),bestrealdef^);
  281. end;
  282. slashn :
  283. begin
  284. if rvd=0 then
  285. begin
  286. Message(parser_e_invalid_float_operation);
  287. t:=genrealconstnode(0,bestrealdef^);
  288. end
  289. else
  290. t:=genrealconstnode(lvd/rvd,bestrealdef^);
  291. end;
  292. ltn : t:=genordinalconstnode(ord(lvd<rvd),booldef);
  293. lten : t:=genordinalconstnode(ord(lvd<=rvd),booldef);
  294. gtn : t:=genordinalconstnode(ord(lvd>rvd),booldef);
  295. gten : t:=genordinalconstnode(ord(lvd>=rvd),booldef);
  296. equaln : t:=genordinalconstnode(ord(lvd=rvd),booldef);
  297. unequaln : t:=genordinalconstnode(ord(lvd<>rvd),booldef);
  298. else
  299. CGMessage(type_e_mismatch);
  300. end;
  301. disposetree(p);
  302. p:=t;
  303. firstpass(p);
  304. exit;
  305. end;
  306. { concating strings ? }
  307. concatstrings:=false;
  308. s1:=nil;
  309. s2:=nil;
  310. if (lt=ordconstn) and (rt=ordconstn) and
  311. is_char(ld) and is_char(rd) then
  312. begin
  313. s1:=strpnew(char(byte(p^.left^.value)));
  314. s2:=strpnew(char(byte(p^.right^.value)));
  315. l1:=1;
  316. l2:=1;
  317. concatstrings:=true;
  318. end
  319. else
  320. if (lt=stringconstn) and (rt=ordconstn) and is_char(rd) then
  321. begin
  322. s1:=getpcharcopy(p^.left);
  323. l1:=p^.left^.length;
  324. s2:=strpnew(char(byte(p^.right^.value)));
  325. l2:=1;
  326. concatstrings:=true;
  327. end
  328. else
  329. if (lt=ordconstn) and (rt=stringconstn) and is_char(ld) then
  330. begin
  331. s1:=strpnew(char(byte(p^.left^.value)));
  332. l1:=1;
  333. s2:=getpcharcopy(p^.right);
  334. l2:=p^.right^.length;
  335. concatstrings:=true;
  336. end
  337. else if (lt=stringconstn) and (rt=stringconstn) then
  338. begin
  339. s1:=getpcharcopy(p^.left);
  340. l1:=p^.left^.length;
  341. s2:=getpcharcopy(p^.right);
  342. l2:=p^.right^.length;
  343. concatstrings:=true;
  344. end;
  345. { I will need to translate all this to ansistrings !!! }
  346. if concatstrings then
  347. begin
  348. case p^.treetype of
  349. addn :
  350. t:=genpcharconstnode(concatansistrings(s1,s2,l1,l2),l1+l2);
  351. ltn :
  352. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)<0),booldef);
  353. lten :
  354. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)<=0),booldef);
  355. gtn :
  356. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)>0),booldef);
  357. gten :
  358. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)>=0),booldef);
  359. equaln :
  360. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)=0),booldef);
  361. unequaln :
  362. t:=genordinalconstnode(byte(compareansistrings(s1,s2,l1,l2)<>0),booldef);
  363. end;
  364. ansistringdispose(s1,l1);
  365. ansistringdispose(s2,l2);
  366. disposetree(p);
  367. firstpass(t);
  368. p:=t;
  369. exit;
  370. end;
  371. { if both are orddefs then check sub types }
  372. if (ld^.deftype=orddef) and (rd^.deftype=orddef) then
  373. begin
  374. { 2 booleans ? }
  375. if is_boolean(ld) and is_boolean(rd) then
  376. begin
  377. case p^.treetype of
  378. andn,
  379. orn:
  380. begin
  381. calcregisters(p,0,0,0);
  382. make_bool_equal_size(p);
  383. p^.location.loc:=LOC_JUMP;
  384. end;
  385. xorn,ltn,lten,gtn,gten :
  386. begin
  387. make_bool_equal_size(p);
  388. if (p^.left^.location.loc in [LOC_JUMP,LOC_FLAGS]) and
  389. (p^.left^.location.loc in [LOC_JUMP,LOC_FLAGS]) then
  390. calcregisters(p,2,0,0)
  391. else
  392. calcregisters(p,1,0,0);
  393. end;
  394. unequaln,
  395. equaln:
  396. begin
  397. make_bool_equal_size(p);
  398. { Remove any compares with constants }
  399. if (p^.left^.treetype=ordconstn) then
  400. begin
  401. hp:=p^.right;
  402. b:=(p^.left^.value<>0);
  403. ot:=p^.treetype;
  404. disposetree(p^.left);
  405. putnode(p);
  406. p:=hp;
  407. if (not(b) and (ot=equaln)) or
  408. (b and (ot=unequaln)) then
  409. begin
  410. p:=gensinglenode(notn,p);
  411. firstpass(p);
  412. end;
  413. exit;
  414. end;
  415. if (p^.right^.treetype=ordconstn) then
  416. begin
  417. hp:=p^.left;
  418. b:=(p^.right^.value<>0);
  419. ot:=p^.treetype;
  420. disposetree(p^.right);
  421. putnode(p);
  422. p:=hp;
  423. if (not(b) and (ot=equaln)) or
  424. (b and (ot=unequaln)) then
  425. begin
  426. p:=gensinglenode(notn,p);
  427. firstpass(p);
  428. end;
  429. exit;
  430. end;
  431. if (p^.left^.location.loc in [LOC_JUMP,LOC_FLAGS]) and
  432. (p^.left^.location.loc in [LOC_JUMP,LOC_FLAGS]) then
  433. calcregisters(p,2,0,0)
  434. else
  435. calcregisters(p,1,0,0);
  436. end;
  437. else
  438. CGMessage(type_e_mismatch);
  439. end;
  440. { these one can't be in flags! }
  441. if p^.treetype in [xorn,unequaln,equaln] then
  442. begin
  443. if p^.left^.location.loc=LOC_FLAGS then
  444. begin
  445. p^.left:=gentypeconvnode(p^.left,porddef(p^.left^.resulttype));
  446. p^.left^.convtyp:=tc_bool_2_int;
  447. p^.left^.explizit:=true;
  448. firstpass(p^.left);
  449. end;
  450. if p^.right^.location.loc=LOC_FLAGS then
  451. begin
  452. p^.right:=gentypeconvnode(p^.right,porddef(p^.right^.resulttype));
  453. p^.right^.convtyp:=tc_bool_2_int;
  454. p^.right^.explizit:=true;
  455. firstpass(p^.right);
  456. end;
  457. { readjust registers }
  458. calcregisters(p,1,0,0);
  459. end;
  460. convdone:=true;
  461. end
  462. else
  463. { Both are chars? only convert to shortstrings for addn }
  464. if is_char(rd) and is_char(ld) then
  465. begin
  466. if p^.treetype=addn then
  467. begin
  468. p^.left:=gentypeconvnode(p^.left,cshortstringdef);
  469. p^.right:=gentypeconvnode(p^.right,cshortstringdef);
  470. firstpass(p^.left);
  471. firstpass(p^.right);
  472. { here we call STRCOPY }
  473. procinfo^.flags:=procinfo^.flags or pi_do_call;
  474. calcregisters(p,0,0,0);
  475. p^.location.loc:=LOC_MEM;
  476. end
  477. else
  478. calcregisters(p,1,0,0);
  479. convdone:=true;
  480. end
  481. { is there a 64 bit type ? }
  482. else if (porddef(rd)^.typ=s64bit) or (porddef(ld)^.typ=s64bit) then
  483. begin
  484. if (porddef(ld)^.typ<>s64bit) then
  485. begin
  486. p^.left:=gentypeconvnode(p^.left,cs64bitdef);
  487. firstpass(p^.left);
  488. end;
  489. if (porddef(rd)^.typ<>s64bit) then
  490. begin
  491. p^.right:=gentypeconvnode(p^.right,cs64bitdef);
  492. firstpass(p^.right);
  493. end;
  494. calcregisters(p,2,0,0);
  495. convdone:=true;
  496. end
  497. else if (porddef(rd)^.typ=u64bit) or (porddef(ld)^.typ=u64bit) then
  498. begin
  499. if (porddef(ld)^.typ<>u64bit) then
  500. begin
  501. p^.left:=gentypeconvnode(p^.left,cu64bitdef);
  502. firstpass(p^.left);
  503. end;
  504. if (porddef(rd)^.typ<>u64bit) then
  505. begin
  506. p^.right:=gentypeconvnode(p^.right,cu64bitdef);
  507. firstpass(p^.right);
  508. end;
  509. calcregisters(p,2,0,0);
  510. convdone:=true;
  511. end
  512. else
  513. { is there a cardinal? }
  514. if (porddef(rd)^.typ=u32bit) or (porddef(ld)^.typ=u32bit) then
  515. begin
  516. { convert constants to u32bit }
  517. if (porddef(ld)^.typ<>u32bit) then
  518. begin
  519. { s32bit will be used for when the other is also s32bit }
  520. if (porddef(rd)^.typ=s32bit) and (lt<>ordconstn) then
  521. p^.left:=gentypeconvnode(p^.left,s32bitdef)
  522. else
  523. p^.left:=gentypeconvnode(p^.left,u32bitdef);
  524. firstpass(p^.left);
  525. end;
  526. if (porddef(rd)^.typ<>u32bit) then
  527. begin
  528. { s32bit will be used for when the other is also s32bit }
  529. if (porddef(ld)^.typ=s32bit) and (rt<>ordconstn) then
  530. p^.right:=gentypeconvnode(p^.right,s32bitdef)
  531. else
  532. p^.right:=gentypeconvnode(p^.right,u32bitdef);
  533. firstpass(p^.right);
  534. end;
  535. calcregisters(p,1,0,0);
  536. { for unsigned mul we need an extra register }
  537. { p^.registers32:=p^.left^.registers32+p^.right^.registers32; }
  538. if p^.treetype=muln then
  539. inc(p^.registers32);
  540. convdone:=true;
  541. end;
  542. end
  543. else
  544. { left side a setdef, must be before string processing,
  545. else array constructor can be seen as array of char (PFV) }
  546. if (ld^.deftype=setdef) {or is_array_constructor(ld)} then
  547. begin
  548. { trying to add a set element? }
  549. if (p^.treetype=addn) and (rd^.deftype<>setdef) then
  550. begin
  551. if (rt=setelementn) then
  552. begin
  553. if not(is_equal(psetdef(ld)^.elementtype.def,rd)) then
  554. CGMessage(type_e_set_element_are_not_comp);
  555. end
  556. else
  557. CGMessage(type_e_mismatch)
  558. end
  559. else
  560. begin
  561. if not(p^.treetype in [addn,subn,symdifn,muln,equaln,unequaln
  562. {$IfNDef NoSetInclusion}
  563. ,lten,gten
  564. {$EndIf NoSetInclusion}
  565. ]) then
  566. CGMessage(type_e_set_operation_unknown);
  567. { right def must be a also be set }
  568. if (rd^.deftype<>setdef) or not(is_equal(rd,ld)) then
  569. CGMessage(type_e_set_element_are_not_comp);
  570. end;
  571. { ranges require normsets }
  572. if (psetdef(ld)^.settype=smallset) and
  573. (rt=setelementn) and
  574. assigned(p^.right^.right) then
  575. begin
  576. { generate a temporary normset def }
  577. tempdef:=new(psetdef,init(psetdef(ld)^.elementtype.def,255));
  578. p^.left:=gentypeconvnode(p^.left,tempdef);
  579. firstpass(p^.left);
  580. dispose(tempdef,done);
  581. ld:=p^.left^.resulttype;
  582. end;
  583. { if the destination is not a smallset then insert a typeconv
  584. which loads a smallset into a normal set }
  585. if (psetdef(ld)^.settype<>smallset) and
  586. (psetdef(rd)^.settype=smallset) then
  587. begin
  588. if (p^.right^.treetype=setconstn) then
  589. begin
  590. t:=gensetconstnode(p^.right^.value_set,psetdef(p^.left^.resulttype));
  591. t^.left:=p^.right^.left;
  592. putnode(p^.right);
  593. p^.right:=t;
  594. end
  595. else
  596. p^.right:=gentypeconvnode(p^.right,psetdef(p^.left^.resulttype));
  597. firstpass(p^.right);
  598. end;
  599. { do constant evaluation }
  600. if (p^.right^.treetype=setconstn) and
  601. not assigned(p^.right^.left) and
  602. (p^.left^.treetype=setconstn) and
  603. not assigned(p^.left^.left) then
  604. begin
  605. new(resultset);
  606. case p^.treetype of
  607. addn : begin
  608. for i:=0 to 31 do
  609. resultset^[i]:=
  610. p^.right^.value_set^[i] or p^.left^.value_set^[i];
  611. t:=gensetconstnode(resultset,psetdef(ld));
  612. end;
  613. muln : begin
  614. for i:=0 to 31 do
  615. resultset^[i]:=
  616. p^.right^.value_set^[i] and p^.left^.value_set^[i];
  617. t:=gensetconstnode(resultset,psetdef(ld));
  618. end;
  619. subn : begin
  620. for i:=0 to 31 do
  621. resultset^[i]:=
  622. p^.left^.value_set^[i] and not(p^.right^.value_set^[i]);
  623. t:=gensetconstnode(resultset,psetdef(ld));
  624. end;
  625. symdifn : begin
  626. for i:=0 to 31 do
  627. resultset^[i]:=
  628. p^.left^.value_set^[i] xor p^.right^.value_set^[i];
  629. t:=gensetconstnode(resultset,psetdef(ld));
  630. end;
  631. unequaln : begin
  632. b:=true;
  633. for i:=0 to 31 do
  634. if p^.right^.value_set^[i]=p^.left^.value_set^[i] then
  635. begin
  636. b:=false;
  637. break;
  638. end;
  639. t:=genordinalconstnode(ord(b),booldef);
  640. end;
  641. equaln : begin
  642. b:=true;
  643. for i:=0 to 31 do
  644. if p^.right^.value_set^[i]<>p^.left^.value_set^[i] then
  645. begin
  646. b:=false;
  647. break;
  648. end;
  649. t:=genordinalconstnode(ord(b),booldef);
  650. end;
  651. {$IfNDef NoSetInclusion}
  652. lten : Begin
  653. b := true;
  654. For i := 0 to 31 Do
  655. If (p^.right^.value_set^[i] And p^.left^.value_set^[i]) <>
  656. p^.left^.value_set^[i] Then
  657. Begin
  658. b := false;
  659. Break
  660. End;
  661. t := genordinalconstnode(ord(b),booldef);
  662. End;
  663. gten : Begin
  664. b := true;
  665. For i := 0 to 31 Do
  666. If (p^.left^.value_set^[i] And p^.right^.value_set^[i]) <>
  667. p^.right^.value_set^[i] Then
  668. Begin
  669. b := false;
  670. Break
  671. End;
  672. t := genordinalconstnode(ord(b),booldef);
  673. End;
  674. {$EndIf NoSetInclusion}
  675. end;
  676. dispose(resultset);
  677. disposetree(p);
  678. p:=t;
  679. firstpass(p);
  680. exit;
  681. end
  682. else
  683. if psetdef(ld)^.settype=smallset then
  684. begin
  685. calcregisters(p,1,0,0);
  686. { are we adding set elements ? }
  687. if p^.right^.treetype=setelementn then
  688. begin
  689. { we need at least two registers PM }
  690. if p^.registers32<2 then
  691. p^.registers32:=2;
  692. end;
  693. p^.location.loc:=LOC_REGISTER;
  694. end
  695. else
  696. begin
  697. calcregisters(p,0,0,0);
  698. { here we call SET... }
  699. procinfo^.flags:=procinfo^.flags or pi_do_call;
  700. p^.location.loc:=LOC_MEM;
  701. end;
  702. convdone:=true;
  703. end
  704. else
  705. { is one of the operands a string?,
  706. chararrays are also handled as strings (after conversion) }
  707. if (rd^.deftype=stringdef) or (ld^.deftype=stringdef) or
  708. (is_chararray(rd) and is_chararray(ld)) then
  709. begin
  710. if is_widestring(rd) or is_widestring(ld) then
  711. begin
  712. if not(is_widestring(rd)) then
  713. p^.right:=gentypeconvnode(p^.right,cwidestringdef);
  714. if not(is_widestring(ld)) then
  715. p^.left:=gentypeconvnode(p^.left,cwidestringdef);
  716. p^.resulttype:=cwidestringdef;
  717. { this is only for add, the comparisaion is handled later }
  718. p^.location.loc:=LOC_REGISTER;
  719. end
  720. else if is_ansistring(rd) or is_ansistring(ld) then
  721. begin
  722. if not(is_ansistring(rd)) then
  723. p^.right:=gentypeconvnode(p^.right,cansistringdef);
  724. if not(is_ansistring(ld)) then
  725. p^.left:=gentypeconvnode(p^.left,cansistringdef);
  726. p^.resulttype:=cansistringdef;
  727. { this is only for add, the comparisaion is handled later }
  728. p^.location.loc:=LOC_REGISTER;
  729. end
  730. else if is_longstring(rd) or is_longstring(ld) then
  731. begin
  732. if not(is_longstring(rd)) then
  733. p^.right:=gentypeconvnode(p^.right,clongstringdef);
  734. if not(is_longstring(ld)) then
  735. p^.left:=gentypeconvnode(p^.left,clongstringdef);
  736. p^.resulttype:=clongstringdef;
  737. { this is only for add, the comparisaion is handled later }
  738. p^.location.loc:=LOC_MEM;
  739. end
  740. else
  741. begin
  742. if not(is_shortstring(rd)) then
  743. p^.right:=gentypeconvnode(p^.right,cshortstringdef);
  744. if not(is_shortstring(ld)) then
  745. p^.left:=gentypeconvnode(p^.left,cshortstringdef);
  746. p^.resulttype:=cshortstringdef;
  747. { this is only for add, the comparisaion is handled later }
  748. p^.location.loc:=LOC_MEM;
  749. end;
  750. { only if there is a type cast we need to do again }
  751. { the first pass }
  752. if p^.left^.treetype=typeconvn then
  753. firstpass(p^.left);
  754. if p^.right^.treetype=typeconvn then
  755. firstpass(p^.right);
  756. { here we call STRCONCAT or STRCMP or STRCOPY }
  757. procinfo^.flags:=procinfo^.flags or pi_do_call;
  758. if p^.location.loc=LOC_MEM then
  759. calcregisters(p,0,0,0)
  760. else
  761. calcregisters(p,1,0,0);
  762. convdone:=true;
  763. end
  764. else
  765. { is one a real float ? }
  766. if (rd^.deftype=floatdef) or (ld^.deftype=floatdef) then
  767. begin
  768. { if one is a fixed, then convert to f32bit }
  769. if ((rd^.deftype=floatdef) and (pfloatdef(rd)^.typ=f32bit)) or
  770. ((ld^.deftype=floatdef) and (pfloatdef(ld)^.typ=f32bit)) then
  771. begin
  772. if not is_integer(rd) or (p^.treetype<>muln) then
  773. p^.right:=gentypeconvnode(p^.right,s32fixeddef);
  774. if not is_integer(ld) or (p^.treetype<>muln) then
  775. p^.left:=gentypeconvnode(p^.left,s32fixeddef);
  776. firstpass(p^.left);
  777. firstpass(p^.right);
  778. calcregisters(p,1,0,0);
  779. p^.location.loc:=LOC_REGISTER;
  780. end
  781. else
  782. { convert both to bestreal }
  783. begin
  784. p^.right:=gentypeconvnode(p^.right,bestrealdef^);
  785. p^.left:=gentypeconvnode(p^.left,bestrealdef^);
  786. firstpass(p^.left);
  787. firstpass(p^.right);
  788. calcregisters(p,1,1,0);
  789. p^.location.loc:=LOC_FPU;
  790. end;
  791. convdone:=true;
  792. end
  793. else
  794. { pointer comperation and subtraction }
  795. if (rd^.deftype=pointerdef) and (ld^.deftype=pointerdef) then
  796. begin
  797. p^.location.loc:=LOC_REGISTER;
  798. { p^.right:=gentypeconvnode(p^.right,ld); }
  799. { firstpass(p^.right); }
  800. calcregisters(p,1,0,0);
  801. case p^.treetype of
  802. equaln,unequaln :
  803. begin
  804. if is_equal(p^.right^.resulttype,voidpointerdef) then
  805. begin
  806. p^.right:=gentypeconvnode(p^.right,ld);
  807. firstpass(p^.right);
  808. end
  809. else if is_equal(p^.left^.resulttype,voidpointerdef) then
  810. begin
  811. p^.left:=gentypeconvnode(p^.left,rd);
  812. firstpass(p^.left);
  813. end
  814. else if not(is_equal(ld,rd)) then
  815. CGMessage(type_e_mismatch);
  816. end;
  817. ltn,lten,gtn,gten:
  818. begin
  819. if is_equal(p^.right^.resulttype,voidpointerdef) then
  820. begin
  821. p^.right:=gentypeconvnode(p^.right,ld);
  822. firstpass(p^.right);
  823. end
  824. else if is_equal(p^.left^.resulttype,voidpointerdef) then
  825. begin
  826. p^.left:=gentypeconvnode(p^.left,rd);
  827. firstpass(p^.left);
  828. end
  829. else if not(is_equal(ld,rd)) then
  830. CGMessage(type_e_mismatch);
  831. if not(cs_extsyntax in aktmoduleswitches) then
  832. CGMessage(type_e_mismatch);
  833. end;
  834. subn:
  835. begin
  836. if not(is_equal(ld,rd)) then
  837. CGMessage(type_e_mismatch);
  838. if not(cs_extsyntax in aktmoduleswitches) then
  839. CGMessage(type_e_mismatch);
  840. p^.resulttype:=s32bitdef;
  841. exit;
  842. end;
  843. else CGMessage(type_e_mismatch);
  844. end;
  845. convdone:=true;
  846. end
  847. else
  848. if (rd^.deftype=objectdef) and (ld^.deftype=objectdef) and
  849. pobjectdef(rd)^.is_class and pobjectdef(ld)^.is_class then
  850. begin
  851. p^.location.loc:=LOC_REGISTER;
  852. if pobjectdef(rd)^.is_related(pobjectdef(ld)) then
  853. p^.right:=gentypeconvnode(p^.right,ld)
  854. else
  855. p^.left:=gentypeconvnode(p^.left,rd);
  856. firstpass(p^.right);
  857. firstpass(p^.left);
  858. calcregisters(p,1,0,0);
  859. case p^.treetype of
  860. equaln,unequaln : ;
  861. else CGMessage(type_e_mismatch);
  862. end;
  863. convdone:=true;
  864. end
  865. else
  866. if (rd^.deftype=classrefdef) and (ld^.deftype=classrefdef) then
  867. begin
  868. p^.location.loc:=LOC_REGISTER;
  869. if pobjectdef(pclassrefdef(rd)^.pointertype.def)^.is_related(pobjectdef(
  870. pclassrefdef(ld)^.pointertype.def)) then
  871. p^.right:=gentypeconvnode(p^.right,ld)
  872. else
  873. p^.left:=gentypeconvnode(p^.left,rd);
  874. firstpass(p^.right);
  875. firstpass(p^.left);
  876. calcregisters(p,1,0,0);
  877. case p^.treetype of
  878. equaln,unequaln : ;
  879. else CGMessage(type_e_mismatch);
  880. end;
  881. convdone:=true;
  882. end
  883. else
  884. { allows comperasion with nil pointer }
  885. if (rd^.deftype=objectdef) and
  886. pobjectdef(rd)^.is_class then
  887. begin
  888. p^.location.loc:=LOC_REGISTER;
  889. p^.left:=gentypeconvnode(p^.left,rd);
  890. firstpass(p^.left);
  891. calcregisters(p,1,0,0);
  892. case p^.treetype of
  893. equaln,unequaln : ;
  894. else CGMessage(type_e_mismatch);
  895. end;
  896. convdone:=true;
  897. end
  898. else
  899. if (ld^.deftype=objectdef) and
  900. pobjectdef(ld)^.is_class then
  901. begin
  902. p^.location.loc:=LOC_REGISTER;
  903. p^.right:=gentypeconvnode(p^.right,ld);
  904. firstpass(p^.right);
  905. calcregisters(p,1,0,0);
  906. case p^.treetype of
  907. equaln,unequaln : ;
  908. else CGMessage(type_e_mismatch);
  909. end;
  910. convdone:=true;
  911. end
  912. else
  913. if (rd^.deftype=classrefdef) then
  914. begin
  915. p^.left:=gentypeconvnode(p^.left,rd);
  916. firstpass(p^.left);
  917. calcregisters(p,1,0,0);
  918. case p^.treetype of
  919. equaln,unequaln : ;
  920. else CGMessage(type_e_mismatch);
  921. end;
  922. convdone:=true;
  923. end
  924. else
  925. if (ld^.deftype=classrefdef) then
  926. begin
  927. p^.right:=gentypeconvnode(p^.right,ld);
  928. firstpass(p^.right);
  929. calcregisters(p,1,0,0);
  930. case p^.treetype of
  931. equaln,unequaln : ;
  932. else
  933. CGMessage(type_e_mismatch);
  934. end;
  935. convdone:=true;
  936. end
  937. else
  938. { support procvar=nil,procvar<>nil }
  939. if ((ld^.deftype=procvardef) and (rt=niln)) or
  940. ((rd^.deftype=procvardef) and (lt=niln)) then
  941. begin
  942. calcregisters(p,1,0,0);
  943. p^.location.loc:=LOC_REGISTER;
  944. case p^.treetype of
  945. equaln,unequaln : ;
  946. else
  947. CGMessage(type_e_mismatch);
  948. end;
  949. convdone:=true;
  950. end
  951. else
  952. if (rd^.deftype=pointerdef) or
  953. is_zero_based_array(rd) then
  954. begin
  955. if is_zero_based_array(rd) then
  956. begin
  957. p^.resulttype:=new(ppointerdef,init(parraydef(rd)^.elementtype));
  958. p^.right:=gentypeconvnode(p^.right,p^.resulttype);
  959. firstpass(p^.right);
  960. end;
  961. p^.location.loc:=LOC_REGISTER;
  962. p^.left:=gentypeconvnode(p^.left,s32bitdef);
  963. firstpass(p^.left);
  964. calcregisters(p,1,0,0);
  965. if p^.treetype=addn then
  966. begin
  967. if not(cs_extsyntax in aktmoduleswitches) or
  968. (not(is_pchar(ld)) and not(m_add_pointer in aktmodeswitches)) then
  969. CGMessage(type_e_mismatch);
  970. { Dirty hack, to support multiple firstpasses (PFV) }
  971. if (p^.resulttype=nil) and
  972. (rd^.deftype=pointerdef) and
  973. (ppointerdef(rd)^.pointertype.def^.size>1) then
  974. begin
  975. p^.left:=gennode(muln,p^.left,genordinalconstnode(ppointerdef(rd)^.pointertype.def^.size,s32bitdef));
  976. firstpass(p^.left);
  977. end;
  978. end
  979. else
  980. CGMessage(type_e_mismatch);
  981. convdone:=true;
  982. end
  983. else
  984. if (ld^.deftype=pointerdef) or
  985. is_zero_based_array(ld) then
  986. begin
  987. if is_zero_based_array(ld) then
  988. begin
  989. p^.resulttype:=new(ppointerdef,init(parraydef(ld)^.elementtype));
  990. p^.left:=gentypeconvnode(p^.left,p^.resulttype);
  991. firstpass(p^.left);
  992. end;
  993. p^.location.loc:=LOC_REGISTER;
  994. p^.right:=gentypeconvnode(p^.right,s32bitdef);
  995. firstpass(p^.right);
  996. calcregisters(p,1,0,0);
  997. case p^.treetype of
  998. addn,subn : begin
  999. if not(cs_extsyntax in aktmoduleswitches) or
  1000. (not(is_pchar(ld)) and not(m_add_pointer in aktmodeswitches)) then
  1001. CGMessage(type_e_mismatch);
  1002. { Dirty hack, to support multiple firstpasses (PFV) }
  1003. if (p^.resulttype=nil) and
  1004. (ld^.deftype=pointerdef) and
  1005. (ppointerdef(ld)^.pointertype.def^.size>1) then
  1006. begin
  1007. p^.right:=gennode(muln,p^.right,
  1008. genordinalconstnode(ppointerdef(ld)^.pointertype.def^.size,s32bitdef));
  1009. firstpass(p^.right);
  1010. end;
  1011. end;
  1012. else
  1013. CGMessage(type_e_mismatch);
  1014. end;
  1015. convdone:=true;
  1016. end
  1017. else
  1018. if (rd^.deftype=procvardef) and (ld^.deftype=procvardef) and is_equal(rd,ld) then
  1019. begin
  1020. calcregisters(p,1,0,0);
  1021. p^.location.loc:=LOC_REGISTER;
  1022. case p^.treetype of
  1023. equaln,unequaln : ;
  1024. else
  1025. CGMessage(type_e_mismatch);
  1026. end;
  1027. convdone:=true;
  1028. end
  1029. else
  1030. {$ifdef SUPPORT_MMX}
  1031. if (cs_mmx in aktlocalswitches) and is_mmx_able_array(ld) and
  1032. is_mmx_able_array(rd) and is_equal(ld,rd) then
  1033. begin
  1034. firstpass(p^.right);
  1035. firstpass(p^.left);
  1036. case p^.treetype of
  1037. addn,subn,xorn,orn,andn:
  1038. ;
  1039. { mul is a little bit restricted }
  1040. muln:
  1041. if not(mmx_type(p^.left^.resulttype) in
  1042. [mmxu16bit,mmxs16bit,mmxfixed16]) then
  1043. CGMessage(type_e_mismatch);
  1044. else
  1045. CGMessage(type_e_mismatch);
  1046. end;
  1047. p^.location.loc:=LOC_MMXREGISTER;
  1048. calcregisters(p,0,0,1);
  1049. convdone:=true;
  1050. end
  1051. else
  1052. {$endif SUPPORT_MMX}
  1053. if (ld^.deftype=enumdef) and (rd^.deftype=enumdef) and (is_equal(ld,rd)) then
  1054. begin
  1055. calcregisters(p,1,0,0);
  1056. case p^.treetype of
  1057. equaln,unequaln,
  1058. ltn,lten,gtn,gten : ;
  1059. else CGMessage(type_e_mismatch);
  1060. end;
  1061. convdone:=true;
  1062. end;
  1063. { the general solution is to convert to 32 bit int }
  1064. if not convdone then
  1065. begin
  1066. { but an int/int gives real/real! }
  1067. if p^.treetype=slashn then
  1068. begin
  1069. CGMessage(type_h_use_div_for_int);
  1070. p^.right:=gentypeconvnode(p^.right,bestrealdef^);
  1071. p^.left:=gentypeconvnode(p^.left,bestrealdef^);
  1072. firstpass(p^.left);
  1073. firstpass(p^.right);
  1074. { maybe we need an integer register to save }
  1075. { a reference }
  1076. if ((p^.left^.location.loc<>LOC_FPU) or
  1077. (p^.right^.location.loc<>LOC_FPU)) and
  1078. (p^.left^.registers32=p^.right^.registers32) then
  1079. calcregisters(p,1,1,0)
  1080. else
  1081. calcregisters(p,0,1,0);
  1082. p^.location.loc:=LOC_FPU;
  1083. end
  1084. else
  1085. begin
  1086. p^.right:=gentypeconvnode(p^.right,s32bitdef);
  1087. p^.left:=gentypeconvnode(p^.left,s32bitdef);
  1088. firstpass(p^.left);
  1089. firstpass(p^.right);
  1090. calcregisters(p,1,0,0);
  1091. p^.location.loc:=LOC_REGISTER;
  1092. end;
  1093. end;
  1094. if codegenerror then
  1095. exit;
  1096. { determines result type for comparions }
  1097. { here the is a problem with multiple passes }
  1098. { example length(s)+1 gets internal 'longint' type first }
  1099. { if it is a arg it is converted to 'LONGINT' }
  1100. { but a second first pass will reset this to 'longint' }
  1101. case p^.treetype of
  1102. ltn,lten,gtn,gten,equaln,unequaln:
  1103. begin
  1104. if (not assigned(p^.resulttype)) or
  1105. (p^.resulttype^.deftype=stringdef) then
  1106. p^.resulttype:=booldef;
  1107. if is_64bitint(p^.left^.resulttype) then
  1108. p^.location.loc:=LOC_JUMP
  1109. else
  1110. p^.location.loc:=LOC_FLAGS;
  1111. end;
  1112. xorn:
  1113. begin
  1114. if not assigned(p^.resulttype) then
  1115. p^.resulttype:=p^.left^.resulttype;
  1116. p^.location.loc:=LOC_REGISTER;
  1117. end;
  1118. addn:
  1119. begin
  1120. if not assigned(p^.resulttype) then
  1121. begin
  1122. { for strings, return is always a 255 char string }
  1123. if is_shortstring(p^.left^.resulttype) then
  1124. p^.resulttype:=cshortstringdef
  1125. else
  1126. p^.resulttype:=p^.left^.resulttype;
  1127. end;
  1128. end;
  1129. else
  1130. p^.resulttype:=p^.left^.resulttype;
  1131. end;
  1132. end;
  1133. end.
  1134. {
  1135. $Log$
  1136. Revision 1.58 1999-11-30 10:40:56 peter
  1137. + ttype, tsymlist
  1138. Revision 1.57 1999/11/26 13:51:29 pierre
  1139. * fix for overloading of shr shl mod and div
  1140. Revision 1.56 1999/11/18 15:34:48 pierre
  1141. * Notes/Hints for local syms changed to
  1142. Set_varstate function
  1143. Revision 1.55 1999/11/17 17:05:06 pierre
  1144. * Notes/hints changes
  1145. Revision 1.54 1999/11/16 23:45:28 pierre
  1146. * global var token was changed by overload code (form bug 707)
  1147. Revision 1.53 1999/11/15 21:53:42 peter
  1148. * fixed constant eval for bool xor/or/and bool
  1149. Revision 1.52 1999/11/15 17:53:00 pierre
  1150. + one field added for ttoken record for operator
  1151. linking the id to the corresponding operator token that
  1152. can now now all be overloaded
  1153. * overloaded operators are resetted to nil in InitSymtable
  1154. (bug when trying to compile a uint that overloads operators twice)
  1155. Revision 1.51 1999/11/06 14:34:29 peter
  1156. * truncated log to 20 revs
  1157. Revision 1.50 1999/09/27 23:45:00 peter
  1158. * procinfo is now a pointer
  1159. * support for result setting in sub procedure
  1160. Revision 1.49 1999/09/16 13:39:14 peter
  1161. * arrayconstructor 2 set conversion is now called always in the
  1162. beginning of firstadd
  1163. Revision 1.48 1999/09/15 20:35:45 florian
  1164. * small fix to operator overloading when in MMX mode
  1165. + the compiler uses now fldz and fld1 if possible
  1166. + some fixes to floating point registers
  1167. + some math. functions (arctan, ln, sin, cos, sqrt, sqr, pi) are now inlined
  1168. * .... ???
  1169. Revision 1.47 1999/09/13 16:28:05 peter
  1170. * typo in previous commit open_array -> chararray :(
  1171. Revision 1.46 1999/09/10 15:40:46 peter
  1172. * fixed array check for operators, becuase array can also be a set
  1173. Revision 1.45 1999/09/08 16:05:29 peter
  1174. * pointer add/sub is now as expected and the same results as inc/dec
  1175. Revision 1.44 1999/09/07 07:52:19 peter
  1176. * > < >= <= support for boolean
  1177. * boolean constants are now calculated like integer constants
  1178. Revision 1.43 1999/08/23 23:44:05 pierre
  1179. * setelementn registers32 corrected
  1180. Revision 1.42 1999/08/07 11:29:27 peter
  1181. * better fix for muln register allocation
  1182. Revision 1.41 1999/08/05 21:58:57 peter
  1183. * fixed register count ord*ord
  1184. Revision 1.40 1999/08/04 13:03:13 jonas
  1185. * all tokens now start with an underscore
  1186. * PowerPC compiles!!
  1187. Revision 1.39 1999/08/04 00:23:33 florian
  1188. * renamed i386asm and i386base to cpuasm and cpubase
  1189. Revision 1.38 1999/08/03 22:03:24 peter
  1190. * moved bitmask constants to sets
  1191. * some other type/const renamings
  1192. Revision 1.37 1999/07/16 10:04:37 peter
  1193. * merged
  1194. Revision 1.36 1999/06/17 15:32:48 pierre
  1195. * merged from 0-99-12 branch
  1196. Revision 1.34.2.3 1999/07/16 09:54:58 peter
  1197. * @procvar support in tp7 mode works again
  1198. Revision 1.34.2.2 1999/06/17 15:25:07 pierre
  1199. * for arrays of char operators can not be overloaded
  1200. Revision 1.35 1999/06/17 13:19:57 pierre
  1201. * merged from 0_99_12 branch
  1202. Revision 1.34.2.1 1999/06/17 12:35:23 pierre
  1203. * allow array binary operator overloading if not with orddef
  1204. Revision 1.34 1999/06/02 10:11:52 florian
  1205. * make cycle fixed i.e. compilation with 0.99.10
  1206. * some fixes for qword
  1207. * start of register calling conventions
  1208. }