tcinl.pas 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl
  4. Type checking and register allocation for inline 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 tcinl;
  19. interface
  20. uses
  21. tree;
  22. procedure firstinline(var p : ptree);
  23. implementation
  24. uses
  25. cobjects,verbose,globals,systems,
  26. globtype,
  27. symconst,symtable,aasm,types,
  28. hcodegen,htypechk,pass_1,
  29. tccal,cpubase
  30. {$ifdef i386}
  31. ,tgeni386
  32. {$endif}
  33. ;
  34. {*****************************************************************************
  35. FirstInLine
  36. *****************************************************************************}
  37. {$ifdef fpc}
  38. {$maxfpuregisters 0}
  39. {$endif fpc}
  40. procedure firstinline(var p : ptree);
  41. var
  42. vl,vl2 : longint;
  43. vr : bestreal;
  44. p1,hp,hpp : ptree;
  45. {$ifndef NOCOLONCHECK}
  46. frac_para,length_para : ptree;
  47. {$endif ndef NOCOLONCHECK}
  48. extra_register,
  49. isreal,
  50. dowrite,
  51. file_is_typed : boolean;
  52. procedure do_lowhigh(adef : pdef);
  53. var
  54. v : longint;
  55. enum : penumsym;
  56. begin
  57. case Adef^.deftype of
  58. orddef:
  59. begin
  60. if p^.inlinenumber=in_low_x then
  61. v:=porddef(Adef)^.low
  62. else
  63. v:=porddef(Adef)^.high;
  64. hp:=genordinalconstnode(v,adef);
  65. firstpass(hp);
  66. disposetree(p);
  67. p:=hp;
  68. end;
  69. enumdef:
  70. begin
  71. enum:=Penumdef(Adef)^.firstenum;
  72. if p^.inlinenumber=in_high_x then
  73. while enum^.nextenum<>nil do
  74. enum:=enum^.nextenum;
  75. hp:=genenumnode(enum);
  76. disposetree(p);
  77. p:=hp;
  78. end;
  79. else
  80. internalerror(87);
  81. end;
  82. end;
  83. function getconstrealvalue : bestreal;
  84. begin
  85. case p^.left^.treetype of
  86. ordconstn:
  87. getconstrealvalue:=p^.left^.value;
  88. realconstn:
  89. getconstrealvalue:=p^.left^.value_real;
  90. else
  91. internalerror(309992);
  92. end;
  93. end;
  94. procedure setconstrealvalue(r : bestreal);
  95. var
  96. hp : ptree;
  97. begin
  98. hp:=genrealconstnode(r,bestrealdef^);
  99. disposetree(p);
  100. p:=hp;
  101. firstpass(p);
  102. end;
  103. procedure handleextendedfunction;
  104. begin
  105. p^.location.loc:=LOC_FPU;
  106. p^.resulttype:=s80floatdef;
  107. { redo firstpass for varstate status PM }
  108. set_varstate(p^.left,true);
  109. if (p^.left^.resulttype^.deftype<>floatdef) or
  110. (pfloatdef(p^.left^.resulttype)^.typ<>s80real) then
  111. begin
  112. p^.left:=gentypeconvnode(p^.left,s80floatdef);
  113. firstpass(p^.left);
  114. end;
  115. p^.registers32:=p^.left^.registers32;
  116. p^.registersfpu:=p^.left^.registersfpu;
  117. {$ifdef SUPPORT_MMX}
  118. p^.registersmmx:=p^.left^.registersmmx;
  119. {$endif SUPPORT_MMX}
  120. end;
  121. begin
  122. { if we handle writeln; p^.left contains no valid address }
  123. if assigned(p^.left) then
  124. begin
  125. if p^.left^.treetype=callparan then
  126. firstcallparan(p^.left,nil,false)
  127. else
  128. firstpass(p^.left);
  129. left_right_max(p);
  130. set_location(p^.location,p^.left^.location);
  131. end;
  132. inc(parsing_para_level);
  133. { handle intern constant functions in separate case }
  134. if p^.inlineconst then
  135. begin
  136. hp:=nil;
  137. { no parameters? }
  138. if not assigned(p^.left) then
  139. begin
  140. case p^.inlinenumber of
  141. in_const_pi :
  142. hp:=genrealconstnode(pi,bestrealdef^);
  143. else
  144. internalerror(89);
  145. end;
  146. end
  147. else
  148. { process constant expression with parameter }
  149. begin
  150. vl:=0;
  151. vl2:=0; { second parameter Ex: ptr(vl,vl2) }
  152. vr:=0;
  153. isreal:=false;
  154. case p^.left^.treetype of
  155. realconstn :
  156. begin
  157. isreal:=true;
  158. vr:=p^.left^.value_real;
  159. end;
  160. ordconstn :
  161. vl:=p^.left^.value;
  162. callparan :
  163. begin
  164. { both exists, else it was not generated }
  165. vl:=p^.left^.left^.value;
  166. vl2:=p^.left^.right^.left^.value;
  167. end;
  168. else
  169. CGMessage(cg_e_illegal_expression);
  170. end;
  171. case p^.inlinenumber of
  172. in_const_trunc :
  173. begin
  174. if isreal then
  175. begin
  176. if (vr>=2147483648.0) or (vr<=-2147483649.0) then
  177. begin
  178. CGMessage(parser_e_range_check_error);
  179. hp:=genordinalconstnode(1,s32bitdef)
  180. end
  181. else
  182. hp:=genordinalconstnode(trunc(vr),s32bitdef)
  183. end
  184. else
  185. hp:=genordinalconstnode(trunc(vl),s32bitdef);
  186. end;
  187. in_const_round :
  188. begin
  189. if isreal then
  190. begin
  191. if (vr>=2147483647.5) or (vr<=-2147483648.5) then
  192. begin
  193. CGMessage(parser_e_range_check_error);
  194. hp:=genordinalconstnode(1,s32bitdef)
  195. end
  196. else
  197. hp:=genordinalconstnode(round(vr),s32bitdef)
  198. end
  199. else
  200. hp:=genordinalconstnode(round(vl),s32bitdef);
  201. end;
  202. in_const_frac :
  203. begin
  204. if isreal then
  205. hp:=genrealconstnode(frac(vr),bestrealdef^)
  206. else
  207. hp:=genrealconstnode(frac(vl),bestrealdef^);
  208. end;
  209. in_const_int :
  210. begin
  211. if isreal then
  212. hp:=genrealconstnode(int(vr),bestrealdef^)
  213. else
  214. hp:=genrealconstnode(int(vl),bestrealdef^);
  215. end;
  216. in_const_abs :
  217. begin
  218. if isreal then
  219. hp:=genrealconstnode(abs(vr),bestrealdef^)
  220. else
  221. hp:=genordinalconstnode(abs(vl),p^.left^.resulttype);
  222. end;
  223. in_const_sqr :
  224. begin
  225. if isreal then
  226. hp:=genrealconstnode(sqr(vr),bestrealdef^)
  227. else
  228. hp:=genordinalconstnode(sqr(vl),p^.left^.resulttype);
  229. end;
  230. in_const_odd :
  231. begin
  232. if isreal then
  233. CGMessage1(type_e_integer_expr_expected,p^.left^.resulttype^.typename)
  234. else
  235. hp:=genordinalconstnode(byte(odd(vl)),booldef);
  236. end;
  237. in_const_swap_word :
  238. begin
  239. if isreal then
  240. CGMessage1(type_e_integer_expr_expected,p^.left^.resulttype^.typename)
  241. else
  242. hp:=genordinalconstnode((vl and $ff) shl 8+(vl shr 8),p^.left^.resulttype);
  243. end;
  244. in_const_swap_long :
  245. begin
  246. if isreal then
  247. CGMessage(type_e_mismatch)
  248. else
  249. hp:=genordinalconstnode((vl and $ffff) shl 16+(vl shr 16),p^.left^.resulttype);
  250. end;
  251. in_const_ptr :
  252. begin
  253. if isreal then
  254. CGMessage(type_e_mismatch)
  255. else
  256. hp:=genordinalconstnode((vl2 shl 16) or vl,voidpointerdef);
  257. end;
  258. in_const_sqrt :
  259. begin
  260. if isreal then
  261. begin
  262. if vr<0.0 then
  263. CGMessage(type_e_wrong_math_argument)
  264. else
  265. hp:=genrealconstnode(sqrt(vr),bestrealdef^)
  266. end
  267. else
  268. begin
  269. if vl<0 then
  270. CGMessage(type_e_wrong_math_argument)
  271. else
  272. hp:=genrealconstnode(sqrt(vl),bestrealdef^);
  273. end;
  274. end;
  275. in_const_arctan :
  276. begin
  277. if isreal then
  278. hp:=genrealconstnode(arctan(vr),bestrealdef^)
  279. else
  280. hp:=genrealconstnode(arctan(vl),bestrealdef^);
  281. end;
  282. in_const_cos :
  283. begin
  284. if isreal then
  285. hp:=genrealconstnode(cos(vr),bestrealdef^)
  286. else
  287. hp:=genrealconstnode(cos(vl),bestrealdef^);
  288. end;
  289. in_const_sin :
  290. begin
  291. if isreal then
  292. hp:=genrealconstnode(sin(vr),bestrealdef^)
  293. else
  294. hp:=genrealconstnode(sin(vl),bestrealdef^);
  295. end;
  296. in_const_exp :
  297. begin
  298. if isreal then
  299. hp:=genrealconstnode(exp(vr),bestrealdef^)
  300. else
  301. hp:=genrealconstnode(exp(vl),bestrealdef^);
  302. end;
  303. in_const_ln :
  304. begin
  305. if isreal then
  306. begin
  307. if vr<=0.0 then
  308. CGMessage(type_e_wrong_math_argument)
  309. else
  310. hp:=genrealconstnode(ln(vr),bestrealdef^)
  311. end
  312. else
  313. begin
  314. if vl<=0 then
  315. CGMessage(type_e_wrong_math_argument)
  316. else
  317. hp:=genrealconstnode(ln(vl),bestrealdef^);
  318. end;
  319. end;
  320. else
  321. internalerror(88);
  322. end;
  323. end;
  324. disposetree(p);
  325. if hp=nil then
  326. hp:=genzeronode(errorn);
  327. firstpass(hp);
  328. p:=hp;
  329. end
  330. else
  331. begin
  332. case p^.inlinenumber of
  333. in_lo_qword,
  334. in_hi_qword,
  335. in_lo_long,
  336. in_hi_long,
  337. in_lo_word,
  338. in_hi_word:
  339. begin
  340. set_varstate(p^.left,true);
  341. if p^.registers32<1 then
  342. p^.registers32:=1;
  343. if p^.inlinenumber in [in_lo_word,in_hi_word] then
  344. p^.resulttype:=u8bitdef
  345. else if p^.inlinenumber in [in_lo_qword,in_hi_qword] then
  346. begin
  347. p^.resulttype:=u32bitdef;
  348. if (m_tp in aktmodeswitches) or
  349. (m_delphi in aktmodeswitches) then
  350. CGMessage(type_w_maybe_wrong_hi_lo);
  351. end
  352. else
  353. begin
  354. p^.resulttype:=u16bitdef;
  355. if (m_tp in aktmodeswitches) or
  356. (m_delphi in aktmodeswitches) then
  357. CGMessage(type_w_maybe_wrong_hi_lo);
  358. end;
  359. p^.location.loc:=LOC_REGISTER;
  360. if not is_integer(p^.left^.resulttype) then
  361. CGMessage(type_e_mismatch)
  362. else
  363. begin
  364. if p^.left^.treetype=ordconstn then
  365. begin
  366. case p^.inlinenumber of
  367. in_lo_word : hp:=genordinalconstnode(p^.left^.value and $ff,p^.left^.resulttype);
  368. in_hi_word : hp:=genordinalconstnode(p^.left^.value shr 8,p^.left^.resulttype);
  369. in_lo_long : hp:=genordinalconstnode(p^.left^.value and $ffff,p^.left^.resulttype);
  370. in_hi_long : hp:=genordinalconstnode(p^.left^.value shr 16,p^.left^.resulttype);
  371. in_lo_qword : hp:=genordinalconstnode(p^.left^.value and $ffffffff,p^.left^.resulttype);
  372. in_hi_qword : hp:=genordinalconstnode(p^.left^.value shr 32,p^.left^.resulttype);
  373. end;
  374. disposetree(p);
  375. firstpass(hp);
  376. p:=hp;
  377. end;
  378. end;
  379. end;
  380. in_sizeof_x:
  381. begin
  382. set_varstate(p^.left,false);
  383. if push_high_param(p^.left^.resulttype) then
  384. begin
  385. getsymonlyin(p^.left^.symtable,'high'+pvarsym(p^.left^.symtableentry)^.name);
  386. hp:=gennode(addn,genloadnode(pvarsym(srsym),p^.left^.symtable),
  387. genordinalconstnode(1,s32bitdef));
  388. if (p^.left^.resulttype^.deftype=arraydef) and
  389. (parraydef(p^.left^.resulttype)^.elesize<>1) then
  390. hp:=gennode(muln,hp,genordinalconstnode(parraydef(p^.left^.resulttype)^.elesize,s32bitdef));
  391. disposetree(p);
  392. p:=hp;
  393. firstpass(p);
  394. end;
  395. if p^.registers32<1 then
  396. p^.registers32:=1;
  397. p^.resulttype:=s32bitdef;
  398. p^.location.loc:=LOC_REGISTER;
  399. end;
  400. in_typeof_x:
  401. begin
  402. set_varstate(p^.left,false);
  403. if p^.registers32<1 then
  404. p^.registers32:=1;
  405. p^.location.loc:=LOC_REGISTER;
  406. p^.resulttype:=voidpointerdef;
  407. end;
  408. in_ord_x:
  409. begin
  410. set_varstate(p^.left,true);
  411. if (p^.left^.treetype=ordconstn) then
  412. begin
  413. hp:=genordinalconstnode(p^.left^.value,s32bitdef);
  414. disposetree(p);
  415. p:=hp;
  416. firstpass(p);
  417. end
  418. else
  419. begin
  420. if (p^.left^.resulttype^.deftype=orddef) then
  421. if (porddef(p^.left^.resulttype)^.typ in [uchar,bool8bit]) then
  422. begin
  423. if porddef(p^.left^.resulttype)^.typ=bool8bit then
  424. begin
  425. hp:=gentypeconvnode(p^.left,u8bitdef);
  426. putnode(p);
  427. p:=hp;
  428. p^.convtyp:=tc_bool_2_int;
  429. p^.explizit:=true;
  430. firstpass(p);
  431. end
  432. else
  433. begin
  434. hp:=gentypeconvnode(p^.left,u8bitdef);
  435. putnode(p);
  436. p:=hp;
  437. p^.explizit:=true;
  438. firstpass(p);
  439. end;
  440. end
  441. { can this happen ? }
  442. else if (porddef(p^.left^.resulttype)^.typ=uvoid) then
  443. CGMessage(type_e_mismatch)
  444. else
  445. { all other orddef need no transformation }
  446. begin
  447. hp:=p^.left;
  448. putnode(p);
  449. p:=hp;
  450. end
  451. else if (p^.left^.resulttype^.deftype=enumdef) then
  452. begin
  453. hp:=gentypeconvnode(p^.left,s32bitdef);
  454. putnode(p);
  455. p:=hp;
  456. p^.explizit:=true;
  457. firstpass(p);
  458. end
  459. else
  460. begin
  461. { can anything else be ord() ?}
  462. CGMessage(type_e_mismatch);
  463. end;
  464. end;
  465. end;
  466. in_chr_byte:
  467. begin
  468. set_varstate(p^.left,true);
  469. hp:=gentypeconvnode(p^.left,cchardef);
  470. putnode(p);
  471. p:=hp;
  472. p^.explizit:=true;
  473. firstpass(p);
  474. end;
  475. in_length_string:
  476. begin
  477. set_varstate(p^.left,true);
  478. if is_ansistring(p^.left^.resulttype) then
  479. p^.resulttype:=s32bitdef
  480. else
  481. p^.resulttype:=u8bitdef;
  482. { we don't need string conversations here }
  483. if (p^.left^.treetype=typeconvn) and
  484. (p^.left^.left^.resulttype^.deftype=stringdef) then
  485. begin
  486. hp:=p^.left^.left;
  487. putnode(p^.left);
  488. p^.left:=hp;
  489. end;
  490. { check the type, must be string or char }
  491. if (p^.left^.resulttype^.deftype<>stringdef) and
  492. (not is_char(p^.left^.resulttype)) then
  493. CGMessage(type_e_mismatch);
  494. { evaluates length of constant strings direct }
  495. if (p^.left^.treetype=stringconstn) then
  496. begin
  497. hp:=genordinalconstnode(p^.left^.length,s32bitdef);
  498. disposetree(p);
  499. firstpass(hp);
  500. p:=hp;
  501. end
  502. { length of char is one allways }
  503. else if is_constcharnode(p^.left) then
  504. begin
  505. hp:=genordinalconstnode(1,s32bitdef);
  506. disposetree(p);
  507. firstpass(hp);
  508. p:=hp;
  509. end;
  510. end;
  511. in_assigned_x:
  512. begin
  513. set_varstate(p^.left,true);
  514. p^.resulttype:=booldef;
  515. p^.location.loc:=LOC_FLAGS;
  516. end;
  517. in_ofs_x,
  518. in_seg_x :
  519. set_varstate(p^.left,false);
  520. in_pred_x,
  521. in_succ_x:
  522. begin
  523. p^.resulttype:=p^.left^.resulttype;
  524. if is_64bitint(p^.resulttype) then
  525. begin
  526. if (p^.registers32<2) then
  527. p^.registers32:=2
  528. end
  529. else
  530. begin
  531. if (p^.registers32<1) then
  532. p^.registers32:=1;
  533. end;
  534. p^.location.loc:=LOC_REGISTER;
  535. set_varstate(p^.left,true);
  536. if not is_ordinal(p^.resulttype) then
  537. CGMessage(type_e_ordinal_expr_expected)
  538. else
  539. begin
  540. if (p^.resulttype^.deftype=enumdef) and
  541. (penumdef(p^.resulttype)^.has_jumps) then
  542. CGMessage(type_e_succ_and_pred_enums_with_assign_not_possible)
  543. else
  544. if p^.left^.treetype=ordconstn then
  545. begin
  546. if p^.inlinenumber=in_succ_x then
  547. hp:=genordinalconstnode(p^.left^.value+1,p^.left^.resulttype)
  548. else
  549. hp:=genordinalconstnode(p^.left^.value-1,p^.left^.resulttype);
  550. disposetree(p);
  551. firstpass(hp);
  552. p:=hp;
  553. end;
  554. end;
  555. end;
  556. in_inc_x,
  557. in_dec_x:
  558. begin
  559. p^.resulttype:=voiddef;
  560. if assigned(p^.left) then
  561. begin
  562. firstcallparan(p^.left,nil,true);
  563. set_varstate(p^.left,true);
  564. if codegenerror then
  565. exit;
  566. { first param must be var }
  567. valid_for_assign(p^.left^.left,false);
  568. { check type }
  569. if (p^.left^.resulttype^.deftype in [enumdef,pointerdef]) or
  570. is_ordinal(p^.left^.resulttype) then
  571. begin
  572. { two paras ? }
  573. if assigned(p^.left^.right) then
  574. begin
  575. { insert a type conversion }
  576. { the second param is always longint }
  577. p^.left^.right^.left:=gentypeconvnode(p^.left^.right^.left,s32bitdef);
  578. { check the type conversion }
  579. firstpass(p^.left^.right^.left);
  580. { need we an additional register ? }
  581. if not(is_constintnode(p^.left^.right^.left)) and
  582. (p^.left^.right^.left^.location.loc in [LOC_MEM,LOC_REFERENCE]) and
  583. (p^.left^.right^.left^.registers32<=1) then
  584. inc(p^.registers32);
  585. { do we need an additional register to restore the first parameter? }
  586. if p^.left^.right^.left^.registers32>=p^.registers32 then
  587. inc(p^.registers32);
  588. if assigned(p^.left^.right^.right) then
  589. CGMessage(cg_e_illegal_expression);
  590. end;
  591. end
  592. else
  593. CGMessage(type_e_ordinal_expr_expected);
  594. end
  595. else
  596. CGMessage(type_e_mismatch);
  597. end;
  598. in_read_x,
  599. in_readln_x,
  600. in_write_x,
  601. in_writeln_x :
  602. begin
  603. { needs a call }
  604. procinfo^.flags:=procinfo^.flags or pi_do_call;
  605. p^.resulttype:=voiddef;
  606. { true, if readln needs an extra register }
  607. extra_register:=false;
  608. { we must know if it is a typed file or not }
  609. { but we must first do the firstpass for it }
  610. file_is_typed:=false;
  611. if assigned(p^.left) then
  612. begin
  613. dowrite:=(p^.inlinenumber in [in_write_x,in_writeln_x]);
  614. firstcallparan(p^.left,nil,true);
  615. set_varstate(p^.left,dowrite);
  616. { now we can check }
  617. hp:=p^.left;
  618. while assigned(hp^.right) do
  619. hp:=hp^.right;
  620. { if resulttype is not assigned, then automatically }
  621. { file is not typed. }
  622. if assigned(hp) and assigned(hp^.resulttype) then
  623. Begin
  624. if (hp^.resulttype^.deftype=filedef) and
  625. (pfiledef(hp^.resulttype)^.filetyp=ft_typed) then
  626. begin
  627. file_is_typed:=true;
  628. { test the type }
  629. hpp:=p^.left;
  630. while (hpp<>hp) do
  631. begin
  632. if (hpp^.left^.treetype=typen) then
  633. CGMessage(type_e_cant_read_write_type);
  634. if not is_equal(hpp^.resulttype,pfiledef(hp^.resulttype)^.typedfiletype.def) then
  635. CGMessage(type_e_mismatch);
  636. { generate the high() value for the shortstring }
  637. if ((not dowrite) and is_shortstring(hpp^.left^.resulttype)) or
  638. (is_chararray(hpp^.left^.resulttype)) then
  639. gen_high_tree(hpp,true);
  640. hpp:=hpp^.right;
  641. end;
  642. end;
  643. end; { endif assigned(hp) }
  644. { insert type conversions for write(ln) }
  645. if (not file_is_typed) then
  646. begin
  647. hp:=p^.left;
  648. while assigned(hp) do
  649. begin
  650. if (hp^.left^.treetype=typen) then
  651. CGMessage(type_e_cant_read_write_type);
  652. if assigned(hp^.left^.resulttype) then
  653. begin
  654. isreal:=false;
  655. { support writeln(procvar) }
  656. if (hp^.left^.resulttype^.deftype=procvardef) then
  657. begin
  658. p1:=gencallnode(nil,nil);
  659. p1^.right:=hp^.left;
  660. p1^.resulttype:=pprocvardef(hp^.left^.resulttype)^.rettype.def;
  661. firstpass(p1);
  662. hp^.left:=p1;
  663. end;
  664. case hp^.left^.resulttype^.deftype of
  665. filedef :
  666. begin
  667. { only allowed as first parameter }
  668. if assigned(hp^.right) then
  669. CGMessage(type_e_cant_read_write_type);
  670. end;
  671. stringdef :
  672. begin
  673. { generate the high() value for the shortstring }
  674. if (not dowrite) and
  675. is_shortstring(hp^.left^.resulttype) then
  676. gen_high_tree(hp,true);
  677. end;
  678. pointerdef :
  679. begin
  680. if not is_pchar(hp^.left^.resulttype) then
  681. CGMessage(type_e_cant_read_write_type);
  682. end;
  683. floatdef :
  684. begin
  685. isreal:=true;
  686. end;
  687. orddef :
  688. begin
  689. case porddef(hp^.left^.resulttype)^.typ of
  690. uchar,
  691. u32bit,s32bit,
  692. u64bit,s64bit:
  693. ;
  694. u8bit,s8bit,
  695. u16bit,s16bit :
  696. if dowrite then
  697. hp^.left:=gentypeconvnode(hp^.left,s32bitdef);
  698. bool8bit,
  699. bool16bit,
  700. bool32bit :
  701. if dowrite then
  702. hp^.left:=gentypeconvnode(hp^.left,booldef)
  703. else
  704. CGMessage(type_e_cant_read_write_type);
  705. else
  706. CGMessage(type_e_cant_read_write_type);
  707. end;
  708. if not(dowrite) and
  709. not(is_64bitint(hp^.left^.resulttype)) then
  710. extra_register:=true;
  711. end;
  712. arraydef :
  713. begin
  714. if is_chararray(hp^.left^.resulttype) then
  715. gen_high_tree(hp,true)
  716. else
  717. CGMessage(type_e_cant_read_write_type);
  718. end;
  719. else
  720. CGMessage(type_e_cant_read_write_type);
  721. end;
  722. { some format options ? }
  723. if hp^.is_colon_para then
  724. begin
  725. if hp^.right^.is_colon_para then
  726. begin
  727. frac_para:=hp;
  728. length_para:=hp^.right;
  729. hp:=hp^.right;
  730. hpp:=hp^.right;
  731. end
  732. else
  733. begin
  734. length_para:=hp;
  735. frac_para:=nil;
  736. hpp:=hp^.right;
  737. end;
  738. isreal:=(hpp^.left^.resulttype^.deftype=floatdef);
  739. if (not is_integer(length_para^.left^.resulttype)) then
  740. CGMessage1(type_e_integer_expr_expected,length_para^.left^.resulttype^.typename)
  741. else
  742. length_para^.left:=gentypeconvnode(length_para^.left,s32bitdef);
  743. if assigned(frac_para) then
  744. begin
  745. if isreal then
  746. begin
  747. if (not is_integer(frac_para^.left^.resulttype)) then
  748. CGMessage1(type_e_integer_expr_expected,frac_para^.left^.resulttype^.typename)
  749. else
  750. frac_para^.left:=gentypeconvnode(frac_para^.left,s32bitdef);
  751. end
  752. else
  753. CGMessage(parser_e_illegal_colon_qualifier);
  754. end;
  755. { do the checking for the colon'd arg }
  756. hp:=length_para;
  757. end;
  758. end;
  759. hp:=hp^.right;
  760. end;
  761. end;
  762. { pass all parameters again for the typeconversions }
  763. if codegenerror then
  764. exit;
  765. firstcallparan(p^.left,nil,true);
  766. set_varstate(p^.left,true);
  767. { calc registers }
  768. left_right_max(p);
  769. if extra_register then
  770. inc(p^.registers32);
  771. end;
  772. end;
  773. in_settextbuf_file_x :
  774. begin
  775. { warning here p^.left is the callparannode
  776. not the argument directly }
  777. { p^.left^.left is text var }
  778. { p^.left^.right^.left is the buffer var }
  779. { firstcallparan(p^.left,nil);
  780. already done in firstcalln }
  781. { now we know the type of buffer }
  782. getsymonlyin(systemunit,'SETTEXTBUF');
  783. hp:=gencallnode(pprocsym(srsym),systemunit);
  784. hp^.left:=gencallparanode(
  785. genordinalconstnode(p^.left^.left^.resulttype^.size,s32bitdef),p^.left);
  786. putnode(p);
  787. p:=hp;
  788. firstpass(p);
  789. end;
  790. { the firstpass of the arg has been done in firstcalln ? }
  791. in_reset_typedfile,
  792. in_rewrite_typedfile :
  793. begin
  794. procinfo^.flags:=procinfo^.flags or pi_do_call;
  795. firstpass(p^.left);
  796. set_varstate(p^.left,true);
  797. p^.resulttype:=voiddef;
  798. end;
  799. in_str_x_string :
  800. begin
  801. procinfo^.flags:=procinfo^.flags or pi_do_call;
  802. p^.resulttype:=voiddef;
  803. { check the amount of parameters }
  804. if not(assigned(p^.left)) or
  805. not(assigned(p^.left^.right)) then
  806. begin
  807. CGMessage(parser_e_wrong_parameter_size);
  808. exit;
  809. end;
  810. { first pass just the string for first local use }
  811. hp:=p^.left^.right;
  812. p^.left^.right:=nil;
  813. firstcallparan(p^.left,nil,true);
  814. set_varstate(p^.left,false);
  815. { remove warning when result is passed }
  816. set_funcret_is_valid(p^.left^.left);
  817. p^.left^.right:=hp;
  818. firstcallparan(p^.left^.right,nil,true);
  819. set_varstate(p^.left^.right,true);
  820. hp:=p^.left;
  821. { valid string ? }
  822. if not assigned(hp) or
  823. (hp^.left^.resulttype^.deftype<>stringdef) or
  824. (hp^.right=nil) then
  825. CGMessage(cg_e_illegal_expression);
  826. { we need a var parameter }
  827. valid_for_assign(hp^.left,false);
  828. { generate the high() value for the shortstring }
  829. if is_shortstring(hp^.left^.resulttype) then
  830. gen_high_tree(hp,true);
  831. { !!!! check length of string }
  832. while assigned(hp^.right) do
  833. hp:=hp^.right;
  834. { check and convert the first param }
  835. if hp^.is_colon_para then
  836. CGMessage(cg_e_illegal_expression);
  837. isreal:=false;
  838. case hp^.resulttype^.deftype of
  839. orddef :
  840. begin
  841. case porddef(hp^.left^.resulttype)^.typ of
  842. u32bit,s32bit,
  843. s64bit,u64bit:
  844. ;
  845. u8bit,s8bit,
  846. u16bit,s16bit:
  847. hp^.left:=gentypeconvnode(hp^.left,s32bitdef);
  848. else
  849. CGMessage(type_e_integer_or_real_expr_expected);
  850. end;
  851. end;
  852. floatdef :
  853. begin
  854. isreal:=true;
  855. end;
  856. else
  857. CGMessage(type_e_integer_or_real_expr_expected);
  858. end;
  859. { some format options ? }
  860. hpp:=p^.left^.right;
  861. if assigned(hpp) and hpp^.is_colon_para then
  862. begin
  863. firstpass(hpp^.left);
  864. set_varstate(hpp^.left,true);
  865. if (not is_integer(hpp^.left^.resulttype)) then
  866. CGMessage1(type_e_integer_expr_expected,hpp^.left^.resulttype^.typename)
  867. else
  868. hpp^.left:=gentypeconvnode(hpp^.left,s32bitdef);
  869. hpp:=hpp^.right;
  870. if assigned(hpp) and hpp^.is_colon_para then
  871. begin
  872. if isreal then
  873. begin
  874. if (not is_integer(hpp^.left^.resulttype)) then
  875. CGMessage1(type_e_integer_expr_expected,hpp^.left^.resulttype^.typename)
  876. else
  877. begin
  878. firstpass(hpp^.left);
  879. set_varstate(hpp^.left,true);
  880. hpp^.left:=gentypeconvnode(hpp^.left,s32bitdef);
  881. end;
  882. end
  883. else
  884. CGMessage(parser_e_illegal_colon_qualifier);
  885. end;
  886. end;
  887. { pass all parameters again for the typeconversions }
  888. if codegenerror then
  889. exit;
  890. firstcallparan(p^.left,nil,true);
  891. { calc registers }
  892. left_right_max(p);
  893. end;
  894. in_val_x :
  895. begin
  896. procinfo^.flags:=procinfo^.flags or pi_do_call;
  897. p^.resulttype:=voiddef;
  898. { check the amount of parameters }
  899. if not(assigned(p^.left)) or
  900. not(assigned(p^.left^.right)) then
  901. begin
  902. CGMessage(parser_e_wrong_parameter_size);
  903. exit;
  904. end;
  905. If Assigned(p^.left^.right^.right) Then
  906. {there is a "code" parameter}
  907. Begin
  908. { first pass just the code parameter for first local use}
  909. hp := p^.left^.right;
  910. p^.left^.right := nil;
  911. make_not_regable(p^.left^.left);
  912. firstcallparan(p^.left, nil,true);
  913. set_varstate(p^.left,false);
  914. if codegenerror then exit;
  915. p^.left^.right := hp;
  916. {code has to be a var parameter}
  917. if valid_for_assign(p^.left^.left,false) then
  918. begin
  919. if (p^.left^.left^.resulttype^.deftype <> orddef) or
  920. not(porddef(p^.left^.left^.resulttype)^.typ in
  921. [u16bit,s16bit,u32bit,s32bit]) then
  922. CGMessage(type_e_mismatch);
  923. end;
  924. hpp := p^.left^.right
  925. End
  926. Else hpp := p^.left;
  927. {now hpp = the destination value tree}
  928. { first pass just the destination parameter for first local use}
  929. hp:=hpp^.right;
  930. hpp^.right:=nil;
  931. {hpp = destination}
  932. make_not_regable(hpp^.left);
  933. firstcallparan(hpp,nil,true);
  934. set_varstate(hpp,false);
  935. if codegenerror then
  936. exit;
  937. { remove warning when result is passed }
  938. set_funcret_is_valid(hpp^.left);
  939. hpp^.right := hp;
  940. if valid_for_assign(hpp^.left,false) then
  941. begin
  942. If Not((hpp^.left^.resulttype^.deftype = floatdef) or
  943. ((hpp^.left^.resulttype^.deftype = orddef) And
  944. (POrdDef(hpp^.left^.resulttype)^.typ in
  945. [u32bit,s32bit,
  946. u8bit,s8bit,u16bit,s16bit,s64bit,u64bit]))) Then
  947. CGMessage(type_e_mismatch);
  948. end;
  949. {hp = source (String)}
  950. { count_ref := false; WHY ?? }
  951. firstcallparan(hp,nil,true);
  952. set_varstate(hp,true);
  953. if codegenerror then
  954. exit;
  955. { if not a stringdef then insert a type conv which
  956. does the other type checking }
  957. If (hp^.left^.resulttype^.deftype<>stringdef) then
  958. begin
  959. hp^.left:=gentypeconvnode(hp^.left,cshortstringdef);
  960. firstpass(hp);
  961. end;
  962. { calc registers }
  963. left_right_max(p);
  964. { val doesn't calculate the registers really }
  965. { correct, we need one register extra (FK) }
  966. if is_64bitint(hpp^.left^.resulttype) then
  967. inc(p^.registers32,2)
  968. else
  969. inc(p^.registers32,1);
  970. end;
  971. in_include_x_y,
  972. in_exclude_x_y:
  973. begin
  974. p^.resulttype:=voiddef;
  975. if assigned(p^.left) then
  976. begin
  977. firstcallparan(p^.left,nil,true);
  978. set_varstate(p^.left,true);
  979. p^.registers32:=p^.left^.registers32;
  980. p^.registersfpu:=p^.left^.registersfpu;
  981. {$ifdef SUPPORT_MMX}
  982. p^.registersmmx:=p^.left^.registersmmx;
  983. {$endif SUPPORT_MMX}
  984. { remove warning when result is passed }
  985. set_funcret_is_valid(p^.left^.left);
  986. { first param must be var }
  987. valid_for_assign(p^.left^.left,false);
  988. { check type }
  989. if (p^.left^.resulttype^.deftype=setdef) then
  990. begin
  991. { two paras ? }
  992. if assigned(p^.left^.right) then
  993. begin
  994. { insert a type conversion }
  995. { to the type of the set elements }
  996. p^.left^.right^.left:=gentypeconvnode(
  997. p^.left^.right^.left,
  998. psetdef(p^.left^.resulttype)^.elementtype.def);
  999. { check the type conversion }
  1000. firstpass(p^.left^.right^.left);
  1001. { only three parameters are allowed }
  1002. if assigned(p^.left^.right^.right) then
  1003. CGMessage(cg_e_illegal_expression);
  1004. end;
  1005. end
  1006. else
  1007. CGMessage(type_e_mismatch);
  1008. end
  1009. else
  1010. CGMessage(type_e_mismatch);
  1011. end;
  1012. in_low_x,
  1013. in_high_x:
  1014. begin
  1015. set_varstate(p^.left,false);
  1016. if p^.left^.treetype in [typen,loadn,subscriptn] then
  1017. begin
  1018. case p^.left^.resulttype^.deftype of
  1019. orddef,enumdef:
  1020. begin
  1021. do_lowhigh(p^.left^.resulttype);
  1022. firstpass(p);
  1023. end;
  1024. setdef:
  1025. begin
  1026. do_lowhigh(Psetdef(p^.left^.resulttype)^.elementtype.def);
  1027. firstpass(p);
  1028. end;
  1029. arraydef:
  1030. begin
  1031. if p^.inlinenumber=in_low_x then
  1032. begin
  1033. hp:=genordinalconstnode(Parraydef(p^.left^.resulttype)^.lowrange,
  1034. Parraydef(p^.left^.resulttype)^.rangetype.def);
  1035. disposetree(p);
  1036. p:=hp;
  1037. firstpass(p);
  1038. end
  1039. else
  1040. begin
  1041. if is_open_array(p^.left^.resulttype) or
  1042. is_array_of_const(p^.left^.resulttype) then
  1043. begin
  1044. getsymonlyin(p^.left^.symtable,'high'+pvarsym(p^.left^.symtableentry)^.name);
  1045. hp:=genloadnode(pvarsym(srsym),p^.left^.symtable);
  1046. disposetree(p);
  1047. p:=hp;
  1048. firstpass(p);
  1049. end
  1050. else
  1051. begin
  1052. hp:=genordinalconstnode(Parraydef(p^.left^.resulttype)^.highrange,
  1053. Parraydef(p^.left^.resulttype)^.rangetype.def);
  1054. disposetree(p);
  1055. p:=hp;
  1056. firstpass(p);
  1057. end;
  1058. end;
  1059. end;
  1060. stringdef:
  1061. begin
  1062. if p^.inlinenumber=in_low_x then
  1063. begin
  1064. hp:=genordinalconstnode(0,u8bitdef);
  1065. disposetree(p);
  1066. p:=hp;
  1067. firstpass(p);
  1068. end
  1069. else
  1070. begin
  1071. if is_open_string(p^.left^.resulttype) then
  1072. begin
  1073. getsymonlyin(p^.left^.symtable,'high'+pvarsym(p^.left^.symtableentry)^.name);
  1074. hp:=genloadnode(pvarsym(srsym),p^.left^.symtable);
  1075. disposetree(p);
  1076. p:=hp;
  1077. firstpass(p);
  1078. end
  1079. else
  1080. begin
  1081. hp:=genordinalconstnode(Pstringdef(p^.left^.resulttype)^.len,u8bitdef);
  1082. disposetree(p);
  1083. p:=hp;
  1084. firstpass(p);
  1085. end;
  1086. end;
  1087. end;
  1088. else
  1089. CGMessage(type_e_mismatch);
  1090. end;
  1091. end
  1092. else
  1093. CGMessage(type_e_varid_or_typeid_expected);
  1094. end;
  1095. in_cos_extended:
  1096. begin
  1097. if p^.left^.treetype in [ordconstn,realconstn] then
  1098. setconstrealvalue(cos(getconstrealvalue))
  1099. else
  1100. handleextendedfunction;
  1101. end;
  1102. in_sin_extended:
  1103. begin
  1104. if p^.left^.treetype in [ordconstn,realconstn] then
  1105. setconstrealvalue(sin(getconstrealvalue))
  1106. else
  1107. handleextendedfunction;
  1108. end;
  1109. in_arctan_extended:
  1110. begin
  1111. if p^.left^.treetype in [ordconstn,realconstn] then
  1112. setconstrealvalue(arctan(getconstrealvalue))
  1113. else
  1114. handleextendedfunction;
  1115. end;
  1116. in_pi:
  1117. if block_type=bt_const then
  1118. setconstrealvalue(pi)
  1119. else
  1120. begin
  1121. p^.location.loc:=LOC_FPU;
  1122. p^.resulttype:=s80floatdef;
  1123. end;
  1124. in_abs_extended:
  1125. begin
  1126. if p^.left^.treetype in [ordconstn,realconstn] then
  1127. setconstrealvalue(abs(getconstrealvalue))
  1128. else
  1129. handleextendedfunction;
  1130. end;
  1131. in_sqr_extended:
  1132. begin
  1133. if p^.left^.treetype in [ordconstn,realconstn] then
  1134. setconstrealvalue(sqr(getconstrealvalue))
  1135. else
  1136. handleextendedfunction;
  1137. end;
  1138. in_sqrt_extended:
  1139. begin
  1140. if p^.left^.treetype in [ordconstn,realconstn] then
  1141. begin
  1142. vr:=getconstrealvalue;
  1143. if vr<0.0 then
  1144. begin
  1145. CGMessage(type_e_wrong_math_argument);
  1146. setconstrealvalue(0);
  1147. end
  1148. else
  1149. setconstrealvalue(sqrt(vr));
  1150. end
  1151. else
  1152. handleextendedfunction;
  1153. end;
  1154. in_ln_extended:
  1155. begin
  1156. if p^.left^.treetype in [ordconstn,realconstn] then
  1157. begin
  1158. vr:=getconstrealvalue;
  1159. if vr<=0.0 then
  1160. begin
  1161. CGMessage(type_e_wrong_math_argument);
  1162. setconstrealvalue(0);
  1163. end
  1164. else
  1165. setconstrealvalue(ln(vr));
  1166. end
  1167. else
  1168. handleextendedfunction;
  1169. end;
  1170. {$ifdef SUPPORT_MMX}
  1171. in_mmx_pcmpeqb..in_mmx_pcmpgtw:
  1172. begin
  1173. end;
  1174. {$endif SUPPORT_MMX}
  1175. in_assert_x_y :
  1176. begin
  1177. p^.resulttype:=voiddef;
  1178. if assigned(p^.left) then
  1179. begin
  1180. firstcallparan(p^.left,nil,true);
  1181. set_varstate(p^.left,true);
  1182. p^.registers32:=p^.left^.registers32;
  1183. p^.registersfpu:=p^.left^.registersfpu;
  1184. {$ifdef SUPPORT_MMX}
  1185. p^.registersmmx:=p^.left^.registersmmx;
  1186. {$endif SUPPORT_MMX}
  1187. { check type }
  1188. if is_boolean(p^.left^.resulttype) then
  1189. begin
  1190. { must always be a string }
  1191. p^.left^.right^.left:=gentypeconvnode(p^.left^.right^.left,cshortstringdef);
  1192. firstpass(p^.left^.right^.left);
  1193. end
  1194. else
  1195. CGMessage(type_e_mismatch);
  1196. end
  1197. else
  1198. CGMessage(type_e_mismatch);
  1199. { We've checked the whole statement for correctness, now we
  1200. can remove it if assertions are off }
  1201. if not(cs_do_assertion in aktlocalswitches) then
  1202. begin
  1203. disposetree(p^.left);
  1204. putnode(p);
  1205. { we need a valid node, so insert a nothingn }
  1206. p:=genzeronode(nothingn);
  1207. end;
  1208. end;
  1209. else
  1210. internalerror(8);
  1211. end;
  1212. end;
  1213. { generate an error if no resulttype is set }
  1214. if not assigned(p^.resulttype) then
  1215. p^.resulttype:=generrordef;
  1216. dec(parsing_para_level);
  1217. end;
  1218. {$ifdef fpc}
  1219. {$maxfpuregisters default}
  1220. {$endif fpc}
  1221. end.
  1222. {
  1223. $Log$
  1224. Revision 1.66 2000-02-13 14:21:51 jonas
  1225. * modifications to make the compiler functional when compiled with
  1226. -Or
  1227. Revision 1.65 2000/02/09 13:23:07 peter
  1228. * log truncated
  1229. Revision 1.64 2000/01/07 01:14:45 peter
  1230. * updated copyright to 2000
  1231. Revision 1.63 1999/12/30 15:02:10 peter
  1232. * fixed crash with undefined variable
  1233. Revision 1.62 1999/12/02 12:38:45 florian
  1234. + added support for succ/pred(<qword/int64>)
  1235. Revision 1.61 1999/11/30 10:40:58 peter
  1236. + ttype, tsymlist
  1237. Revision 1.60 1999/11/18 15:34:49 pierre
  1238. * Notes/Hints for local syms changed to
  1239. Set_varstate function
  1240. Revision 1.59 1999/11/17 17:05:07 pierre
  1241. * Notes/hints changes
  1242. Revision 1.58 1999/11/06 14:34:30 peter
  1243. * truncated log to 20 revs
  1244. Revision 1.57 1999/10/29 15:28:51 peter
  1245. * fixed assert, the tree is now disposed in firstpass if assertions
  1246. are off.
  1247. Revision 1.56 1999/10/26 12:30:46 peter
  1248. * const parameter is now checked
  1249. * better and generic check if a node can be used for assigning
  1250. * export fixes
  1251. * procvar equal works now (it never had worked at least from 0.99.8)
  1252. * defcoll changed to linkedlist with pparaitem so it can easily be
  1253. walked both directions
  1254. Revision 1.55 1999/10/22 14:37:31 peter
  1255. * error when properties are passed to var parameters
  1256. Revision 1.54 1999/10/21 16:41:41 florian
  1257. * problems with readln fixed: esi wasn't restored correctly when
  1258. reading ordinal fields of objects futher the register allocation
  1259. didn't take care of the extra register when reading ordinal values
  1260. * enumerations can now be used in constant indexes of properties
  1261. Revision 1.53 1999/09/28 20:48:27 florian
  1262. * fixed bug 610
  1263. + added $D- for TP in symtable.pas else it can't be compiled anymore
  1264. (too much symbols :()
  1265. Revision 1.52 1999/09/27 23:45:01 peter
  1266. * procinfo is now a pointer
  1267. * support for result setting in sub procedure
  1268. Revision 1.51 1999/09/15 20:35:46 florian
  1269. * small fix to operator overloading when in MMX mode
  1270. + the compiler uses now fldz and fld1 if possible
  1271. + some fixes to floating point registers
  1272. + some math. functions (arctan, ln, sin, cos, sqrt, sqr, pi) are now inlined
  1273. * .... ???
  1274. Revision 1.50 1999/09/07 14:05:11 pierre
  1275. * halt removed in do_lowhigh
  1276. Revision 1.49 1999/08/28 15:34:21 florian
  1277. * bug 519 fixed
  1278. Revision 1.48 1999/08/23 23:41:04 pierre
  1279. * in_inc_x register allocation corrected
  1280. Revision 1.47 1999/08/06 12:43:13 jonas
  1281. * fix for regvars with the val code
  1282. Revision 1.46 1999/08/05 16:53:23 peter
  1283. * V_Fatal=1, all other V_ are also increased
  1284. * Check for local procedure when assigning procvar
  1285. * fixed comment parsing because directives
  1286. * oldtp mode directives better supported
  1287. * added some messages to errore.msg
  1288. Revision 1.45 1999/08/04 00:23:40 florian
  1289. * renamed i386asm and i386base to cpuasm and cpubase
  1290. }