tcadd.pas 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300
  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) or is_char(rd)) and
  709. (is_chararray(ld) or is_char(ld))) then
  710. begin
  711. if is_widestring(rd) or is_widestring(ld) then
  712. begin
  713. if not(is_widestring(rd)) then
  714. p^.right:=gentypeconvnode(p^.right,cwidestringdef);
  715. if not(is_widestring(ld)) then
  716. p^.left:=gentypeconvnode(p^.left,cwidestringdef);
  717. p^.resulttype:=cwidestringdef;
  718. { this is only for add, the comparisaion is handled later }
  719. p^.location.loc:=LOC_REGISTER;
  720. end
  721. else if is_ansistring(rd) or is_ansistring(ld) then
  722. begin
  723. if not(is_ansistring(rd)) then
  724. p^.right:=gentypeconvnode(p^.right,cansistringdef);
  725. if not(is_ansistring(ld)) then
  726. p^.left:=gentypeconvnode(p^.left,cansistringdef);
  727. { we use ansistrings so no fast exit here }
  728. procinfo^.no_fast_exit:=true;
  729. p^.resulttype:=cansistringdef;
  730. { this is only for add, the comparisaion is handled later }
  731. p^.location.loc:=LOC_REGISTER;
  732. end
  733. else if is_longstring(rd) or is_longstring(ld) then
  734. begin
  735. if not(is_longstring(rd)) then
  736. p^.right:=gentypeconvnode(p^.right,clongstringdef);
  737. if not(is_longstring(ld)) then
  738. p^.left:=gentypeconvnode(p^.left,clongstringdef);
  739. p^.resulttype:=clongstringdef;
  740. { this is only for add, the comparisaion is handled later }
  741. p^.location.loc:=LOC_MEM;
  742. end
  743. else
  744. begin
  745. if not(is_shortstring(rd)) then
  746. p^.right:=gentypeconvnode(p^.right,cshortstringdef);
  747. if not(is_shortstring(ld)) then
  748. p^.left:=gentypeconvnode(p^.left,cshortstringdef);
  749. p^.resulttype:=cshortstringdef;
  750. { this is only for add, the comparisaion is handled later }
  751. p^.location.loc:=LOC_MEM;
  752. end;
  753. { only if there is a type cast we need to do again }
  754. { the first pass }
  755. if p^.left^.treetype=typeconvn then
  756. firstpass(p^.left);
  757. if p^.right^.treetype=typeconvn then
  758. firstpass(p^.right);
  759. { here we call STRCONCAT or STRCMP or STRCOPY }
  760. procinfo^.flags:=procinfo^.flags or pi_do_call;
  761. if p^.location.loc=LOC_MEM then
  762. calcregisters(p,0,0,0)
  763. else
  764. calcregisters(p,1,0,0);
  765. convdone:=true;
  766. end
  767. else
  768. { is one a real float ? }
  769. if (rd^.deftype=floatdef) or (ld^.deftype=floatdef) then
  770. begin
  771. { if one is a fixed, then convert to f32bit }
  772. if ((rd^.deftype=floatdef) and (pfloatdef(rd)^.typ=f32bit)) or
  773. ((ld^.deftype=floatdef) and (pfloatdef(ld)^.typ=f32bit)) then
  774. begin
  775. if not is_integer(rd) or (p^.treetype<>muln) then
  776. p^.right:=gentypeconvnode(p^.right,s32fixeddef);
  777. if not is_integer(ld) or (p^.treetype<>muln) then
  778. p^.left:=gentypeconvnode(p^.left,s32fixeddef);
  779. firstpass(p^.left);
  780. firstpass(p^.right);
  781. calcregisters(p,1,0,0);
  782. p^.location.loc:=LOC_REGISTER;
  783. end
  784. else
  785. { convert both to bestreal }
  786. begin
  787. p^.right:=gentypeconvnode(p^.right,bestrealdef^);
  788. p^.left:=gentypeconvnode(p^.left,bestrealdef^);
  789. firstpass(p^.left);
  790. firstpass(p^.right);
  791. calcregisters(p,1,1,0);
  792. p^.location.loc:=LOC_FPU;
  793. end;
  794. convdone:=true;
  795. end
  796. else
  797. { pointer comperation and subtraction }
  798. if (rd^.deftype=pointerdef) and (ld^.deftype=pointerdef) then
  799. begin
  800. p^.location.loc:=LOC_REGISTER;
  801. { p^.right:=gentypeconvnode(p^.right,ld); }
  802. { firstpass(p^.right); }
  803. calcregisters(p,1,0,0);
  804. case p^.treetype of
  805. equaln,unequaln :
  806. begin
  807. if is_equal(p^.right^.resulttype,voidpointerdef) then
  808. begin
  809. p^.right:=gentypeconvnode(p^.right,ld);
  810. firstpass(p^.right);
  811. end
  812. else if is_equal(p^.left^.resulttype,voidpointerdef) then
  813. begin
  814. p^.left:=gentypeconvnode(p^.left,rd);
  815. firstpass(p^.left);
  816. end
  817. else if not(is_equal(ld,rd)) then
  818. CGMessage(type_e_mismatch);
  819. end;
  820. ltn,lten,gtn,gten:
  821. begin
  822. if is_equal(p^.right^.resulttype,voidpointerdef) then
  823. begin
  824. p^.right:=gentypeconvnode(p^.right,ld);
  825. firstpass(p^.right);
  826. end
  827. else if is_equal(p^.left^.resulttype,voidpointerdef) then
  828. begin
  829. p^.left:=gentypeconvnode(p^.left,rd);
  830. firstpass(p^.left);
  831. end
  832. else if not(is_equal(ld,rd)) then
  833. CGMessage(type_e_mismatch);
  834. if not(cs_extsyntax in aktmoduleswitches) then
  835. CGMessage(type_e_mismatch);
  836. end;
  837. subn:
  838. begin
  839. if not(is_equal(ld,rd)) then
  840. CGMessage(type_e_mismatch);
  841. if not(cs_extsyntax in aktmoduleswitches) then
  842. CGMessage(type_e_mismatch);
  843. p^.resulttype:=s32bitdef;
  844. exit;
  845. end;
  846. else CGMessage(type_e_mismatch);
  847. end;
  848. convdone:=true;
  849. end
  850. else
  851. if (rd^.deftype=objectdef) and (ld^.deftype=objectdef) and
  852. pobjectdef(rd)^.is_class and pobjectdef(ld)^.is_class then
  853. begin
  854. p^.location.loc:=LOC_REGISTER;
  855. if pobjectdef(rd)^.is_related(pobjectdef(ld)) then
  856. p^.right:=gentypeconvnode(p^.right,ld)
  857. else
  858. p^.left:=gentypeconvnode(p^.left,rd);
  859. firstpass(p^.right);
  860. firstpass(p^.left);
  861. calcregisters(p,1,0,0);
  862. case p^.treetype of
  863. equaln,unequaln : ;
  864. else CGMessage(type_e_mismatch);
  865. end;
  866. convdone:=true;
  867. end
  868. else
  869. if (rd^.deftype=classrefdef) and (ld^.deftype=classrefdef) then
  870. begin
  871. p^.location.loc:=LOC_REGISTER;
  872. if pobjectdef(pclassrefdef(rd)^.pointertype.def)^.is_related(pobjectdef(
  873. pclassrefdef(ld)^.pointertype.def)) then
  874. p^.right:=gentypeconvnode(p^.right,ld)
  875. else
  876. p^.left:=gentypeconvnode(p^.left,rd);
  877. firstpass(p^.right);
  878. firstpass(p^.left);
  879. calcregisters(p,1,0,0);
  880. case p^.treetype of
  881. equaln,unequaln : ;
  882. else CGMessage(type_e_mismatch);
  883. end;
  884. convdone:=true;
  885. end
  886. else
  887. { allows comperasion with nil pointer }
  888. if (rd^.deftype=objectdef) and
  889. pobjectdef(rd)^.is_class then
  890. begin
  891. p^.location.loc:=LOC_REGISTER;
  892. p^.left:=gentypeconvnode(p^.left,rd);
  893. firstpass(p^.left);
  894. calcregisters(p,1,0,0);
  895. case p^.treetype of
  896. equaln,unequaln : ;
  897. else CGMessage(type_e_mismatch);
  898. end;
  899. convdone:=true;
  900. end
  901. else
  902. if (ld^.deftype=objectdef) and
  903. pobjectdef(ld)^.is_class then
  904. begin
  905. p^.location.loc:=LOC_REGISTER;
  906. p^.right:=gentypeconvnode(p^.right,ld);
  907. firstpass(p^.right);
  908. calcregisters(p,1,0,0);
  909. case p^.treetype of
  910. equaln,unequaln : ;
  911. else CGMessage(type_e_mismatch);
  912. end;
  913. convdone:=true;
  914. end
  915. else
  916. if (rd^.deftype=classrefdef) then
  917. begin
  918. p^.left:=gentypeconvnode(p^.left,rd);
  919. firstpass(p^.left);
  920. calcregisters(p,1,0,0);
  921. case p^.treetype of
  922. equaln,unequaln : ;
  923. else CGMessage(type_e_mismatch);
  924. end;
  925. convdone:=true;
  926. end
  927. else
  928. if (ld^.deftype=classrefdef) then
  929. begin
  930. p^.right:=gentypeconvnode(p^.right,ld);
  931. firstpass(p^.right);
  932. calcregisters(p,1,0,0);
  933. case p^.treetype of
  934. equaln,unequaln : ;
  935. else
  936. CGMessage(type_e_mismatch);
  937. end;
  938. convdone:=true;
  939. end
  940. else
  941. { support procvar=nil,procvar<>nil }
  942. if ((ld^.deftype=procvardef) and (rt=niln)) or
  943. ((rd^.deftype=procvardef) and (lt=niln)) then
  944. begin
  945. calcregisters(p,1,0,0);
  946. p^.location.loc:=LOC_REGISTER;
  947. case p^.treetype of
  948. equaln,unequaln : ;
  949. else
  950. CGMessage(type_e_mismatch);
  951. end;
  952. convdone:=true;
  953. end
  954. else
  955. if (rd^.deftype=pointerdef) or
  956. is_zero_based_array(rd) then
  957. begin
  958. if is_zero_based_array(rd) then
  959. begin
  960. p^.resulttype:=new(ppointerdef,init(parraydef(rd)^.elementtype));
  961. p^.right:=gentypeconvnode(p^.right,p^.resulttype);
  962. firstpass(p^.right);
  963. end;
  964. p^.location.loc:=LOC_REGISTER;
  965. p^.left:=gentypeconvnode(p^.left,s32bitdef);
  966. firstpass(p^.left);
  967. calcregisters(p,1,0,0);
  968. if p^.treetype=addn then
  969. begin
  970. if not(cs_extsyntax in aktmoduleswitches) or
  971. (not(is_pchar(ld)) and not(m_add_pointer in aktmodeswitches)) then
  972. CGMessage(type_e_mismatch);
  973. { Dirty hack, to support multiple firstpasses (PFV) }
  974. if (p^.resulttype=nil) and
  975. (rd^.deftype=pointerdef) and
  976. (ppointerdef(rd)^.pointertype.def^.size>1) then
  977. begin
  978. p^.left:=gennode(muln,p^.left,genordinalconstnode(ppointerdef(rd)^.pointertype.def^.size,s32bitdef));
  979. firstpass(p^.left);
  980. end;
  981. end
  982. else
  983. CGMessage(type_e_mismatch);
  984. convdone:=true;
  985. end
  986. else
  987. if (ld^.deftype=pointerdef) or
  988. is_zero_based_array(ld) then
  989. begin
  990. if is_zero_based_array(ld) then
  991. begin
  992. p^.resulttype:=new(ppointerdef,init(parraydef(ld)^.elementtype));
  993. p^.left:=gentypeconvnode(p^.left,p^.resulttype);
  994. firstpass(p^.left);
  995. end;
  996. p^.location.loc:=LOC_REGISTER;
  997. p^.right:=gentypeconvnode(p^.right,s32bitdef);
  998. firstpass(p^.right);
  999. calcregisters(p,1,0,0);
  1000. case p^.treetype of
  1001. addn,subn : begin
  1002. if not(cs_extsyntax in aktmoduleswitches) or
  1003. (not(is_pchar(ld)) and not(m_add_pointer in aktmodeswitches)) then
  1004. CGMessage(type_e_mismatch);
  1005. { Dirty hack, to support multiple firstpasses (PFV) }
  1006. if (p^.resulttype=nil) and
  1007. (ld^.deftype=pointerdef) and
  1008. (ppointerdef(ld)^.pointertype.def^.size>1) then
  1009. begin
  1010. p^.right:=gennode(muln,p^.right,
  1011. genordinalconstnode(ppointerdef(ld)^.pointertype.def^.size,s32bitdef));
  1012. firstpass(p^.right);
  1013. end;
  1014. end;
  1015. else
  1016. CGMessage(type_e_mismatch);
  1017. end;
  1018. convdone:=true;
  1019. end
  1020. else
  1021. if (rd^.deftype=procvardef) and (ld^.deftype=procvardef) and is_equal(rd,ld) then
  1022. begin
  1023. calcregisters(p,1,0,0);
  1024. p^.location.loc:=LOC_REGISTER;
  1025. case p^.treetype of
  1026. equaln,unequaln : ;
  1027. else
  1028. CGMessage(type_e_mismatch);
  1029. end;
  1030. convdone:=true;
  1031. end
  1032. else
  1033. {$ifdef SUPPORT_MMX}
  1034. if (cs_mmx in aktlocalswitches) and is_mmx_able_array(ld) and
  1035. is_mmx_able_array(rd) and is_equal(ld,rd) then
  1036. begin
  1037. firstpass(p^.right);
  1038. firstpass(p^.left);
  1039. case p^.treetype of
  1040. addn,subn,xorn,orn,andn:
  1041. ;
  1042. { mul is a little bit restricted }
  1043. muln:
  1044. if not(mmx_type(p^.left^.resulttype) in
  1045. [mmxu16bit,mmxs16bit,mmxfixed16]) then
  1046. CGMessage(type_e_mismatch);
  1047. else
  1048. CGMessage(type_e_mismatch);
  1049. end;
  1050. p^.location.loc:=LOC_MMXREGISTER;
  1051. calcregisters(p,0,0,1);
  1052. convdone:=true;
  1053. end
  1054. else
  1055. {$endif SUPPORT_MMX}
  1056. if (ld^.deftype=enumdef) and (rd^.deftype=enumdef) and (is_equal(ld,rd)) then
  1057. begin
  1058. calcregisters(p,1,0,0);
  1059. case p^.treetype of
  1060. equaln,unequaln,
  1061. ltn,lten,gtn,gten : ;
  1062. else CGMessage(type_e_mismatch);
  1063. end;
  1064. convdone:=true;
  1065. end;
  1066. { the general solution is to convert to 32 bit int }
  1067. if not convdone then
  1068. begin
  1069. { but an int/int gives real/real! }
  1070. if p^.treetype=slashn then
  1071. begin
  1072. CGMessage(type_h_use_div_for_int);
  1073. p^.right:=gentypeconvnode(p^.right,bestrealdef^);
  1074. p^.left:=gentypeconvnode(p^.left,bestrealdef^);
  1075. firstpass(p^.left);
  1076. firstpass(p^.right);
  1077. { maybe we need an integer register to save }
  1078. { a reference }
  1079. if ((p^.left^.location.loc<>LOC_FPU) or
  1080. (p^.right^.location.loc<>LOC_FPU)) and
  1081. (p^.left^.registers32=p^.right^.registers32) then
  1082. calcregisters(p,1,1,0)
  1083. else
  1084. calcregisters(p,0,1,0);
  1085. p^.location.loc:=LOC_FPU;
  1086. end
  1087. else
  1088. begin
  1089. p^.right:=gentypeconvnode(p^.right,s32bitdef);
  1090. p^.left:=gentypeconvnode(p^.left,s32bitdef);
  1091. firstpass(p^.left);
  1092. firstpass(p^.right);
  1093. calcregisters(p,1,0,0);
  1094. p^.location.loc:=LOC_REGISTER;
  1095. end;
  1096. end;
  1097. if codegenerror then
  1098. exit;
  1099. { determines result type for comparions }
  1100. { here the is a problem with multiple passes }
  1101. { example length(s)+1 gets internal 'longint' type first }
  1102. { if it is a arg it is converted to 'LONGINT' }
  1103. { but a second first pass will reset this to 'longint' }
  1104. case p^.treetype of
  1105. ltn,lten,gtn,gten,equaln,unequaln:
  1106. begin
  1107. if (not assigned(p^.resulttype)) or
  1108. (p^.resulttype^.deftype=stringdef) then
  1109. p^.resulttype:=booldef;
  1110. if is_64bitint(p^.left^.resulttype) then
  1111. p^.location.loc:=LOC_JUMP
  1112. else
  1113. p^.location.loc:=LOC_FLAGS;
  1114. end;
  1115. xorn:
  1116. begin
  1117. if not assigned(p^.resulttype) then
  1118. p^.resulttype:=p^.left^.resulttype;
  1119. p^.location.loc:=LOC_REGISTER;
  1120. end;
  1121. addn:
  1122. begin
  1123. if not assigned(p^.resulttype) then
  1124. begin
  1125. { for strings, return is always a 255 char string }
  1126. if is_shortstring(p^.left^.resulttype) then
  1127. p^.resulttype:=cshortstringdef
  1128. else
  1129. p^.resulttype:=p^.left^.resulttype;
  1130. end;
  1131. end;
  1132. else
  1133. p^.resulttype:=p^.left^.resulttype;
  1134. end;
  1135. end;
  1136. end.
  1137. {
  1138. $Log$
  1139. Revision 1.60 1999-12-09 23:18:04 pierre
  1140. * no_fast_exit if procedure contains implicit termination code
  1141. Revision 1.59 1999/12/01 12:42:33 peter
  1142. * fixed bug 698
  1143. * removed some notes about unused vars
  1144. Revision 1.58 1999/11/30 10:40:56 peter
  1145. + ttype, tsymlist
  1146. Revision 1.57 1999/11/26 13:51:29 pierre
  1147. * fix for overloading of shr shl mod and div
  1148. Revision 1.56 1999/11/18 15:34:48 pierre
  1149. * Notes/Hints for local syms changed to
  1150. Set_varstate function
  1151. Revision 1.55 1999/11/17 17:05:06 pierre
  1152. * Notes/hints changes
  1153. Revision 1.54 1999/11/16 23:45:28 pierre
  1154. * global var token was changed by overload code (form bug 707)
  1155. Revision 1.53 1999/11/15 21:53:42 peter
  1156. * fixed constant eval for bool xor/or/and bool
  1157. Revision 1.52 1999/11/15 17:53:00 pierre
  1158. + one field added for ttoken record for operator
  1159. linking the id to the corresponding operator token that
  1160. can now now all be overloaded
  1161. * overloaded operators are resetted to nil in InitSymtable
  1162. (bug when trying to compile a uint that overloads operators twice)
  1163. Revision 1.51 1999/11/06 14:34:29 peter
  1164. * truncated log to 20 revs
  1165. Revision 1.50 1999/09/27 23:45:00 peter
  1166. * procinfo is now a pointer
  1167. * support for result setting in sub procedure
  1168. Revision 1.49 1999/09/16 13:39:14 peter
  1169. * arrayconstructor 2 set conversion is now called always in the
  1170. beginning of firstadd
  1171. Revision 1.48 1999/09/15 20:35:45 florian
  1172. * small fix to operator overloading when in MMX mode
  1173. + the compiler uses now fldz and fld1 if possible
  1174. + some fixes to floating point registers
  1175. + some math. functions (arctan, ln, sin, cos, sqrt, sqr, pi) are now inlined
  1176. * .... ???
  1177. Revision 1.47 1999/09/13 16:28:05 peter
  1178. * typo in previous commit open_array -> chararray :(
  1179. Revision 1.46 1999/09/10 15:40:46 peter
  1180. * fixed array check for operators, becuase array can also be a set
  1181. Revision 1.45 1999/09/08 16:05:29 peter
  1182. * pointer add/sub is now as expected and the same results as inc/dec
  1183. Revision 1.44 1999/09/07 07:52:19 peter
  1184. * > < >= <= support for boolean
  1185. * boolean constants are now calculated like integer constants
  1186. Revision 1.43 1999/08/23 23:44:05 pierre
  1187. * setelementn registers32 corrected
  1188. Revision 1.42 1999/08/07 11:29:27 peter
  1189. * better fix for muln register allocation
  1190. Revision 1.41 1999/08/05 21:58:57 peter
  1191. * fixed register count ord*ord
  1192. Revision 1.40 1999/08/04 13:03:13 jonas
  1193. * all tokens now start with an underscore
  1194. * PowerPC compiles!!
  1195. Revision 1.39 1999/08/04 00:23:33 florian
  1196. * renamed i386asm and i386base to cpuasm and cpubase
  1197. Revision 1.38 1999/08/03 22:03:24 peter
  1198. * moved bitmask constants to sets
  1199. * some other type/const renamings
  1200. Revision 1.37 1999/07/16 10:04:37 peter
  1201. * merged
  1202. Revision 1.36 1999/06/17 15:32:48 pierre
  1203. * merged from 0-99-12 branch
  1204. Revision 1.34.2.3 1999/07/16 09:54:58 peter
  1205. * @procvar support in tp7 mode works again
  1206. Revision 1.34.2.2 1999/06/17 15:25:07 pierre
  1207. * for arrays of char operators can not be overloaded
  1208. Revision 1.35 1999/06/17 13:19:57 pierre
  1209. * merged from 0_99_12 branch
  1210. Revision 1.34.2.1 1999/06/17 12:35:23 pierre
  1211. * allow array binary operator overloading if not with orddef
  1212. Revision 1.34 1999/06/02 10:11:52 florian
  1213. * make cycle fixed i.e. compilation with 0.99.10
  1214. * some fixes for qword
  1215. * start of register calling conventions
  1216. }