n386util.pas 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Florian Klaempfl
  4. Helper routines for the i386 code generator
  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 n386util;
  19. {$i defines.inc}
  20. interface
  21. uses
  22. symtype,node,cpubase,cginfo;
  23. function maybe_push(needed : byte;p : tnode;isint64 : boolean) : boolean;
  24. function maybe_pushfpu(needed : byte;p : tnode) : boolean;
  25. {$ifdef TEMPS_NOT_PUSH}
  26. function maybe_savetotemp(needed : byte;p : tnode;isint64 : boolean) : boolean;
  27. {$endif TEMPS_NOT_PUSH}
  28. procedure restore(p : tnode;isint64 : boolean);
  29. {$ifdef TEMPS_NOT_PUSH}
  30. procedure restorefromtemp(p : tnode;isint64 : boolean);
  31. {$endif TEMPS_NOT_PUSH}
  32. procedure push_value_para(p:tnode;inlined,is_cdecl:boolean;
  33. para_offset:longint;alignment : longint);
  34. procedure emitoverflowcheck(p:tnode);
  35. procedure firstcomplex(p : tbinarynode);
  36. implementation
  37. uses
  38. globtype,globals,systems,verbose,
  39. cutils,
  40. aasm,cpuasm,
  41. symconst,symdef,symsym,symtable,
  42. {$ifdef GDB}
  43. gdb,
  44. {$endif GDB}
  45. types,
  46. ncgutil,ncon,nld,
  47. pass_1,pass_2,
  48. cgbase,tgobj,
  49. cga,regvars,cgobj,cg64f32,rgobj,rgcpu,cgcpu;
  50. {*****************************************************************************
  51. Emit Push Functions
  52. *****************************************************************************}
  53. function maybe_push(needed : byte;p : tnode;isint64 : boolean) : boolean;
  54. var
  55. pushed : boolean;
  56. {hregister : tregister; }
  57. {$ifdef TEMPS_NOT_PUSH}
  58. href : treference;
  59. {$endif TEMPS_NOT_PUSH}
  60. begin
  61. if p.location.loc = LOC_CREGISTER then
  62. begin
  63. maybe_push := true;
  64. exit;
  65. end;
  66. if needed>rg.countunusedregsint then
  67. begin
  68. if (p.location.loc=LOC_REGISTER) then
  69. begin
  70. if isint64 then
  71. begin
  72. {$ifdef TEMPS_NOT_PUSH}
  73. tg.gettempofsizereference(exprasmlist,href,8);
  74. p.temp_offset:=href.offset;
  75. href.offset:=href.offset+4;
  76. exprasmList.concat(Taicpu.Op_reg(A_MOV,S_L,p.location.registerhigh,href));
  77. href.offset:=href.offset-4;
  78. {$else TEMPS_NOT_PUSH}
  79. exprasmList.concat(Taicpu.Op_reg(A_PUSH,S_L,p.location.registerhigh));
  80. {$endif TEMPS_NOT_PUSH}
  81. rg.ungetregisterint(exprasmlist,p.location.registerhigh);
  82. end
  83. {$ifdef TEMPS_NOT_PUSH}
  84. else
  85. begin
  86. tg.gettempofsizereference(exprasmlist,href,4);
  87. p.temp_offset:=href.offset;
  88. end
  89. {$endif TEMPS_NOT_PUSH}
  90. ;
  91. pushed:=true;
  92. {$ifdef TEMPS_NOT_PUSH}
  93. exprasmList.concat(Taicpu.Op_reg_ref(A_MOV,S_L,p.location.register,href));
  94. {$else TEMPS_NOT_PUSH}
  95. exprasmList.concat(Taicpu.Op_reg(A_PUSH,S_L,p.location.register));
  96. {$endif TEMPS_NOT_PUSH}
  97. rg.ungetregisterint(exprasmlist,p.location.register);
  98. end
  99. else if (p.location.loc in [LOC_CREFERENCE,LOC_REFERENCE]) and
  100. ((p.location.reference.base<>R_NO) or
  101. (p.location.reference.index<>R_NO)
  102. ) then
  103. begin
  104. reference_release(exprasmlist,p.location.reference);
  105. rg.getexplicitregisterint(exprasmlist,R_EDI);
  106. emit_ref_reg(A_LEA,S_L,p.location.reference,R_EDI);
  107. {$ifdef TEMPS_NOT_PUSH}
  108. tg.gettempofsizereference(exprasmlist,href,4);
  109. exprasmList.concat(Taicpu.Op_reg_ref(A_MOV,S_L,R_EDI,href));
  110. p.temp_offset:=href.offset;
  111. {$else TEMPS_NOT_PUSH}
  112. exprasmList.concat(Taicpu.Op_reg(A_PUSH,S_L,R_EDI));
  113. {$endif TEMPS_NOT_PUSH}
  114. rg.ungetregisterint(exprasmlist,R_EDI);
  115. pushed:=true;
  116. end
  117. else pushed:=false;
  118. end
  119. else pushed:=false;
  120. maybe_push:=pushed;
  121. end;
  122. function maybe_pushfpu(needed : byte;p : tnode) : boolean;
  123. begin
  124. if needed>=maxfpuregs then
  125. begin
  126. if p.location.loc = LOC_FPUREGISTER then
  127. begin
  128. location_force_mem(p.location);
  129. maybe_pushfpu:=true;
  130. end
  131. else
  132. maybe_pushfpu:=false;
  133. end
  134. else
  135. maybe_pushfpu:=false;
  136. end;
  137. {$ifdef TEMPS_NOT_PUSH}
  138. function maybe_savetotemp(needed : byte;p : tnode;isint64 : boolean) : boolean;
  139. var
  140. pushed : boolean;
  141. href : treference;
  142. begin
  143. if needed>rg.unusedregsint then
  144. begin
  145. if (p^.location.loc=LOC_REGISTER) then
  146. begin
  147. if isint64(p^.resulttype.def) then
  148. begin
  149. tg.gettempofsizereference(exprasmlist,href,8);
  150. p^.temp_offset:=href.offset;
  151. href.offset:=href.offset+4;
  152. exprasmList.concat(Taicpu.Op_reg(A_MOV,S_L,p^.location.registerhigh,href));
  153. href.offset:=href.offset-4;
  154. rg.ungetregisterint(exprasmlist,p^.location.registerhigh);
  155. end
  156. else
  157. begin
  158. tg.gettempofsizereference(exprasmlist,href,4);
  159. p^.temp_offset:=href.offset;
  160. end;
  161. pushed:=true;
  162. exprasmList.concat(Taicpu.Op_reg_ref(A_MOV,S_L,p^.location.register,href));
  163. rg.ungetregisterint(exprasmlist,p^.location.register);
  164. end
  165. else if (p^.location.loc in [LOC_MEM,LOC_REFERENCE]) and
  166. ((p^.location.reference.base<>R_NO) or
  167. (p^.location.reference.index<>R_NO)
  168. ) then
  169. begin
  170. reference_release(p^.location.reference);
  171. rg.getexplicitregisterint(exprasmlist,R_EDI);
  172. emit_ref_reg(A_LEA,S_L,reference_copy(p^.location.reference),
  173. R_EDI);
  174. tg.gettempofsizereference(exprasmlist,href,4);
  175. exprasmList.concat(Taicpu.Op_reg_ref(A_MOV,S_L,R_EDI,href));
  176. rg.ungetregisterint(exprasmlist,R_EDI);
  177. p^.temp_offset:=href.offset;
  178. pushed:=true;
  179. end
  180. else pushed:=false;
  181. end
  182. else pushed:=false;
  183. maybe_push:=pushed;
  184. end;
  185. {$endif TEMPS_NOT_PUSH}
  186. procedure restore(p : tnode;isint64 : boolean);
  187. var
  188. hregister : tregister;
  189. {$ifdef TEMPS_NOT_PUSH}
  190. href : treference;
  191. {$endif TEMPS_NOT_PUSH}
  192. begin
  193. if p.location.loc = LOC_CREGISTER then
  194. begin
  195. load_regvar_reg(exprasmlist,p.location.register);
  196. exit;
  197. end;
  198. hregister:=rg.getregisterint(exprasmlist);
  199. {$ifdef TEMPS_NOT_PUSH}
  200. reset_reference(href);
  201. href.base:=procinfo^.frame_pointer_reg;
  202. href.offset:=p.temp_offset;
  203. emit_ref_reg(A_MOV,S_L,href,hregister);
  204. {$else TEMPS_NOT_PUSH}
  205. exprasmList.concat(Taicpu.Op_reg(A_POP,S_L,hregister));
  206. {$endif TEMPS_NOT_PUSH}
  207. if (p.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
  208. begin
  209. p.location.register:=hregister;
  210. if isint64 then
  211. begin
  212. p.location.registerhigh:=rg.getregisterint(exprasmlist);
  213. {$ifdef TEMPS_NOT_PUSH}
  214. href.offset:=p.temp_offset+4;
  215. emit_ref_reg(A_MOV,S_L,p.location.registerhigh);
  216. { set correctly for release ! }
  217. href.offset:=p.temp_offset;
  218. {$else TEMPS_NOT_PUSH}
  219. exprasmList.concat(Taicpu.Op_reg(A_POP,S_L,p.location.registerhigh));
  220. {$endif TEMPS_NOT_PUSH}
  221. end;
  222. end
  223. else
  224. begin
  225. reference_reset(p.location.reference);
  226. { any reasons why this was moved into the index register ? }
  227. { normally usage of base register is much better (FK) }
  228. p.location.reference.base:=hregister;
  229. { Why is this done? We can never be sure about p.left
  230. because otherwise secondload fails !!!
  231. set_location(p.left^.location,p.location);}
  232. end;
  233. {$ifdef TEMPS_NOT_PUSH}
  234. tg.ungetiftemp(exprasmlist,href);
  235. {$endif TEMPS_NOT_PUSH}
  236. end;
  237. {$ifdef TEMPS_NOT_PUSH}
  238. procedure restorefromtemp(p : tnode;isint64 : boolean);
  239. var
  240. hregister : tregister;
  241. href : treference;
  242. begin
  243. hregister:=rg.getregisterint(exprasmlist);
  244. reset_reference(href);
  245. href.base:=procinfo^.frame_pointer_reg;
  246. href.offset:=p.temp_offset;
  247. emit_ref_reg(A_MOV,S_L,href,hregister);
  248. if (p.location.loc in [LOC_REGISTER,LOC_CREGISTER]) then
  249. begin
  250. p.location.register:=hregister;
  251. if isint64 then
  252. begin
  253. p.location.registerhigh:=rg.getregisterint(exprasmlist);
  254. href.offset:=p.temp_offset+4;
  255. emit_ref_reg(A_MOV,S_L,p.location.registerhigh);
  256. { set correctly for release ! }
  257. href.offset:=p.temp_offset;
  258. end;
  259. end
  260. else
  261. begin
  262. reset_reference(p.location.reference);
  263. p.location.reference.base:=hregister;
  264. { Why is this done? We can never be sure about p^.left
  265. because otherwise secondload fails PM
  266. set_location(p^.left^.location,p^.location);}
  267. end;
  268. tg.ungetiftemp(exprasmlist,href);
  269. end;
  270. {$endif TEMPS_NOT_PUSH}
  271. procedure push_value_para(p:tnode;inlined,is_cdecl:boolean;
  272. para_offset:longint;alignment : longint);
  273. var
  274. tempreference : treference;
  275. href : treference;
  276. hreg : tregister;
  277. sizetopush,
  278. size : longint;
  279. cgsize : tcgsize;
  280. begin
  281. { Move flags and jump in register to make it less complex }
  282. if p.location.loc in [LOC_FLAGS,LOC_JUMP] then
  283. location_force_reg(p.location,def_cgsize(p.resulttype.def),false);
  284. { Handle Floating point types differently }
  285. if p.resulttype.def.deftype=floatdef then
  286. begin
  287. case p.location.loc of
  288. LOC_FPUREGISTER,
  289. LOC_CFPUREGISTER:
  290. begin
  291. size:=align(tfloatdef(p.resulttype.def).size,alignment);
  292. inc(pushedparasize,size);
  293. if not inlined then
  294. emit_const_reg(A_SUB,S_L,size,R_ESP);
  295. {$ifdef GDB}
  296. if (cs_debuginfo in aktmoduleswitches) and
  297. (exprasmList.first=exprasmList.last) then
  298. exprasmList.concat(Tai_force_line.Create);
  299. {$endif GDB}
  300. { this is the easiest case for inlined !! }
  301. if inlined then
  302. reference_reset_base(href,procinfo^.framepointer,para_offset-pushedparasize)
  303. else
  304. reference_reset_base(href,R_ESP,0);
  305. cg.a_loadfpu_reg_ref(exprasmlist,
  306. def_cgsize(p.resulttype.def),p.location.register,href);
  307. end;
  308. LOC_REFERENCE,
  309. LOC_CREFERENCE :
  310. begin
  311. sizetopush:=align(p.resulttype.def.size,alignment);
  312. tempreference:=p.location.reference;
  313. inc(tempreference.offset,sizetopush);
  314. while (sizetopush>0) do
  315. begin
  316. if sizetopush>=4 then
  317. begin
  318. cgsize:=OS_32;
  319. inc(pushedparasize,4);
  320. dec(tempreference.offset,4);
  321. dec(sizetopush,4);
  322. end
  323. else
  324. begin
  325. cgsize:=OS_16;
  326. inc(pushedparasize,2);
  327. dec(tempreference.offset,2);
  328. dec(sizetopush,2);
  329. end;
  330. if inlined then
  331. begin
  332. reference_reset_base(href,procinfo^.framepointer,para_offset-pushedparasize);
  333. cg.a_load_ref_ref(exprasmlist,cgsize,tempreference,href);
  334. end
  335. else
  336. cg.a_param_ref(exprasmlist,cgsize,tempreference,-1);
  337. end;
  338. end;
  339. else
  340. internalerror(200204243);
  341. end;
  342. end
  343. else
  344. begin
  345. { call by value open array ? }
  346. if is_cdecl and
  347. push_addr_param(p.resulttype.def) then
  348. begin
  349. if not (p.location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
  350. internalerror(200204241);
  351. { push on stack }
  352. size:=align(p.resulttype.def.size,alignment);
  353. inc(pushedparasize,size);
  354. emit_const_reg(A_SUB,S_L,size,R_ESP);
  355. reference_reset_base(href,R_ESP,0);
  356. cg.g_concatcopy(exprasmlist,p.location.reference,href,size,false,false);
  357. end
  358. else
  359. begin
  360. case p.location.loc of
  361. LOC_CONSTANT,
  362. LOC_REGISTER,
  363. LOC_CREGISTER,
  364. LOC_REFERENCE,
  365. LOC_CREFERENCE :
  366. begin
  367. cgsize:=def_cgsize(p.resulttype.def);
  368. if cgsize in [OS_64,OS_S64] then
  369. begin
  370. inc(pushedparasize,8);
  371. if inlined then
  372. begin
  373. reference_reset_base(href,procinfo^.framepointer,para_offset-pushedparasize);
  374. tcg64f32(cg).a_load64_loc_ref(exprasmlist,p.location,href);
  375. end
  376. else
  377. tcg64f32(cg).a_param64_loc(exprasmlist,p.location,-1);
  378. end
  379. else
  380. begin
  381. case cgsize of
  382. OS_8,OS_S8 :
  383. begin
  384. if alignment=4 then
  385. cgsize:=OS_32
  386. else
  387. cgsize:=OS_16;
  388. end;
  389. OS_16,OS_S16 :
  390. begin
  391. if alignment=4 then
  392. cgsize:=OS_32;
  393. end;
  394. end;
  395. { update register to use to match alignment }
  396. if p.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
  397. begin
  398. hreg:=p.location.register;
  399. p.location.register:=rg.makeregsize(p.location.register,cgsize);
  400. end;
  401. inc(pushedparasize,alignment);
  402. if inlined then
  403. begin
  404. reference_reset_base(href,procinfo^.framepointer,para_offset-pushedparasize);
  405. cg.a_load_loc_ref(exprasmlist,p.location,href);
  406. end
  407. else
  408. cg.a_param_loc(exprasmlist,p.location,-1);
  409. { restore old register }
  410. if p.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
  411. p.location.register:=hreg;
  412. end;
  413. location_release(exprasmlist,p.location);
  414. end;
  415. {$ifdef SUPPORT_MMX}
  416. LOC_MMXREGISTER,
  417. LOC_CMMXREGISTER:
  418. begin
  419. inc(pushedparasize,8);
  420. if inlined then
  421. begin
  422. reference_reset_base(href,procinfo^.framepointer,para_offset-pushedparasize);
  423. cg.a_loadmm_reg_ref(exprasmlist,p.location.register,href);
  424. end
  425. else
  426. cg.a_parammm_reg(exprasmlist,p.location.register);
  427. end;
  428. {$endif SUPPORT_MMX}
  429. else
  430. internalerror(200204241);
  431. end;
  432. end;
  433. end;
  434. end;
  435. {*****************************************************************************
  436. Emit Functions
  437. *****************************************************************************}
  438. { produces if necessary overflowcode }
  439. procedure emitoverflowcheck(p:tnode);
  440. var
  441. hl : tasmlabel;
  442. begin
  443. if not(cs_check_overflow in aktlocalswitches) then
  444. exit;
  445. getlabel(hl);
  446. if not ((p.resulttype.def.deftype=pointerdef) or
  447. ((p.resulttype.def.deftype=orddef) and
  448. (torddef(p.resulttype.def).typ in [u64bit,u16bit,u32bit,u8bit,uchar,
  449. bool8bit,bool16bit,bool32bit]))) then
  450. emitjmp(C_NO,hl)
  451. else
  452. emitjmp(C_NB,hl);
  453. emitcall('FPC_OVERFLOW');
  454. emitlab(hl);
  455. end;
  456. { DO NOT RELY on the fact that the tnode is not yet swaped
  457. because of inlining code PM }
  458. procedure firstcomplex(p : tbinarynode);
  459. var
  460. hp : tnode;
  461. begin
  462. { always calculate boolean AND and OR from left to right }
  463. if (p.nodetype in [orn,andn]) and
  464. (p.left.resulttype.def.deftype=orddef) and
  465. (torddef(p.left.resulttype.def).typ in [bool8bit,bool16bit,bool32bit]) then
  466. begin
  467. { p.swaped:=false}
  468. if nf_swaped in p.flags then
  469. internalerror(234234);
  470. end
  471. else
  472. if (((p.location.loc=LOC_FPUREGISTER) and
  473. (p.right.registersfpu > p.left.registersfpu)) or
  474. ((((p.left.registersfpu = 0) and
  475. (p.right.registersfpu = 0)) or
  476. (p.location.loc<>LOC_FPUREGISTER)) and
  477. (p.left.registers32<p.right.registers32))) and
  478. { the following check is appropriate, because all }
  479. { 4 registers are rarely used and it is thereby }
  480. { achieved that the extra code is being dropped }
  481. { by exchanging not commutative operators }
  482. (p.right.registers32<=4) then
  483. begin
  484. hp:=p.left;
  485. p.left:=p.right;
  486. p.right:=hp;
  487. if nf_swaped in p.flags then
  488. exclude(p.flags,nf_swaped)
  489. else
  490. include(p.flags,nf_swaped);
  491. end;
  492. {else
  493. p.swaped:=false; do not modify }
  494. end;
  495. end.
  496. {
  497. $Log$
  498. Revision 1.35 2002-04-25 20:16:40 peter
  499. * moved more routines from cga/n386util
  500. Revision 1.34 2002/04/21 15:39:41 carl
  501. * changeregsize -> rg.makeregsize
  502. Revision 1.33 2002/04/20 21:37:07 carl
  503. + generic FPC_CHECKPOINTER
  504. + first parameter offset in stack now portable
  505. * rename some constants
  506. + move some cpu stuff to other units
  507. - remove unused constents
  508. * fix stacksize for some targets
  509. * fix generic size problems which depend now on EXTEND_SIZE constant
  510. * removing frame pointer in routines is only available for : i386,m68k and vis targets
  511. Revision 1.32 2002/04/19 15:39:35 peter
  512. * removed some more routines from cga
  513. * moved location_force_reg/mem to ncgutil
  514. * moved arrayconstructnode secondpass to ncgld
  515. Revision 1.31 2002/04/15 19:44:21 peter
  516. * fixed stackcheck that would be called recursively when a stack
  517. error was found
  518. * generic changeregsize(reg,size) for i386 register resizing
  519. * removed some more routines from cga unit
  520. * fixed returnvalue handling
  521. * fixed default stacksize of linux and go32v2, 8kb was a bit small :-)
  522. Revision 1.30 2002/04/04 19:06:12 peter
  523. * removed unused units
  524. * use tlocation.size in cg.a_*loc*() routines
  525. Revision 1.29 2002/04/04 07:56:15 michael
  526. * Patch from peter to fix go32v2 cycle
  527. Revision 1.28 2002/04/02 17:11:37 peter
  528. * tlocation,treference update
  529. * LOC_CONSTANT added for better constant handling
  530. * secondadd splitted in multiple routines
  531. * location_force_reg added for loading a location to a register
  532. of a specified size
  533. * secondassignment parses now first the right and then the left node
  534. (this is compatible with Kylix). This saves a lot of push/pop especially
  535. with string operations
  536. * adapted some routines to use the new cg methods
  537. Revision 1.27 2002/03/31 20:26:40 jonas
  538. + a_loadfpu_* and a_loadmm_* methods in tcg
  539. * register allocation is now handled by a class and is mostly processor
  540. independent (+rgobj.pas and i386/rgcpu.pas)
  541. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  542. * some small improvements and fixes to the optimizer
  543. * some register allocation fixes
  544. * some fpuvaroffset fixes in the unary minus node
  545. * push/popusedregisters is now called rg.save/restoreusedregisters and
  546. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  547. also better optimizable)
  548. * fixed and optimized register saving/restoring for new/dispose nodes
  549. * LOC_FPU locations now also require their "register" field to be set to
  550. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  551. - list field removed of the tnode class because it's not used currently
  552. and can cause hard-to-find bugs
  553. Revision 1.26 2002/03/04 19:10:14 peter
  554. * removed compiler warnings
  555. Revision 1.25 2001/12/30 17:24:47 jonas
  556. * range checking is now processor independent (part in cgobj,
  557. part in cg64f32) and should work correctly again (it needed
  558. some changes after the changes of the low and high of
  559. tordef's to int64)
  560. * maketojumpbool() is now processor independent (in ncgutil)
  561. * getregister32 is now called getregisterint
  562. Revision 1.24 2001/12/03 21:48:43 peter
  563. * freemem change to value parameter
  564. * torddef low/high range changed to int64
  565. Revision 1.23 2001/12/02 16:19:17 jonas
  566. * less unnecessary regvar loading with if-statements
  567. Revision 1.22 2001/10/12 13:51:52 jonas
  568. * fixed internalerror(10) due to previous fpu overflow fixes ("merged")
  569. * fixed bug in n386add (introduced after compilerproc changes for string
  570. operations) where calcregisters wasn't called for shortstring addnodes
  571. * NOTE: from now on, the location of a binary node must now always be set
  572. before you call calcregisters() for it
  573. Revision 1.21 2001/09/17 21:29:14 peter
  574. * merged netbsd, fpu-overflow from fixes branch
  575. Revision 1.20 2001/08/26 13:37:01 florian
  576. * some cg reorganisation
  577. * some PPC updates
  578. Revision 1.19 2001/08/24 12:22:14 jonas
  579. * fixed memory leak with coping of array-of-consts as valuepara
  580. Revision 1.18 2001/07/08 21:00:18 peter
  581. * various widestring updates, it works now mostly without charset
  582. mapping supported
  583. Revision 1.17 2001/07/01 20:16:20 peter
  584. * alignmentinfo record added
  585. * -Oa argument supports more alignment settings that can be specified
  586. per type: PROC,LOOP,VARMIN,VARMAX,CONSTMIN,CONSTMAX,RECORDMIN
  587. RECORDMAX,LOCALMIN,LOCALMAX. It is possible to set the mimimum
  588. required alignment and the maximum usefull alignment. The final
  589. alignment will be choosen per variable size dependent on these
  590. settings
  591. Revision 1.16 2001/04/18 22:02:03 peter
  592. * registration of targets and assemblers
  593. Revision 1.15 2001/04/13 01:22:19 peter
  594. * symtable change to classes
  595. * range check generation and errors fixed, make cycle DEBUG=1 works
  596. * memory leaks fixed
  597. Revision 1.14 2001/04/02 21:20:39 peter
  598. * resulttype rewrite
  599. Revision 1.13 2001/03/11 22:58:52 peter
  600. * getsym redesign, removed the globals srsym,srsymtable
  601. Revision 1.12 2001/03/04 10:26:56 jonas
  602. * new rangecheck code now handles conversion between signed and cardinal types correctly
  603. Revision 1.11 2001/03/03 12:41:22 jonas
  604. * simplified and optimized range checking code, FPC_BOUNDCHECK is no longer necessary
  605. Revision 1.10 2000/12/31 11:02:12 jonas
  606. * optimized loadshortstring a bit
  607. Revision 1.9 2000/12/25 00:07:33 peter
  608. + new tlinkedlist class (merge of old tstringqueue,tcontainer and
  609. tlinkedlist objects)
  610. Revision 1.8 2000/12/11 19:10:19 jonas
  611. * fixed web bug 1144
  612. + implemented range checking for 64bit types
  613. Revision 1.7 2000/12/07 17:19:46 jonas
  614. * new constant handling: from now on, hex constants >$7fffffff are
  615. parsed as unsigned constants (otherwise, $80000000 got sign extended
  616. and became $ffffffff80000000), all constants in the longint range
  617. become longints, all constants >$7fffffff and <=cardinal($ffffffff)
  618. are cardinals and the rest are int64's.
  619. * added lots of longint typecast to prevent range check errors in the
  620. compiler and rtl
  621. * type casts of symbolic ordinal constants are now preserved
  622. * fixed bug where the original resulttype.def wasn't restored correctly
  623. after doing a 64bit rangecheck
  624. Revision 1.6 2000/12/05 11:44:34 jonas
  625. + new integer regvar handling, should be much more efficient
  626. Revision 1.5 2000/11/29 00:30:49 florian
  627. * unused units removed from uses clause
  628. * some changes for widestrings
  629. Revision 1.4 2000/11/13 14:47:46 jonas
  630. * support for range checking when converting from 64bit to something
  631. smaller (32bit, 16bit, 8bit)
  632. * fixed range checking between longint/cardinal and for array indexing
  633. with cardinal (values > $7fffffff were considered negative)
  634. Revision 1.3 2000/11/04 14:25:25 florian
  635. + merged Attila's changes for interfaces, not tested yet
  636. Revision 1.2 2000/10/31 22:02:57 peter
  637. * symtable splitted, no real code changes
  638. Revision 1.1 2000/10/15 09:33:32 peter
  639. * moved n386*.pas to i386/ cpu_target dir
  640. Revision 1.3 2000/10/14 21:52:54 peter
  641. * fixed memory leaks
  642. Revision 1.2 2000/10/14 10:14:50 peter
  643. * moehrendorf oct 2000 rewrite
  644. Revision 1.1 2000/10/01 19:58:40 peter
  645. * new file
  646. }