cg64f32.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl
  4. Member of the Free Pascal development team
  5. This unit implements the code generation for 64 bit int
  6. arithmethics on 32 bit processors
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or
  10. (at your option) any later version.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. ****************************************************************************
  19. }
  20. {# This unit implements the code generation for 64 bit int arithmethics on
  21. 32 bit processors.
  22. }
  23. unit cg64f32;
  24. {$i fpcdefs.inc}
  25. interface
  26. uses
  27. aasmbase,aasmtai,aasmcpu,
  28. cpuinfo, cpubase,
  29. cginfo, cgobj,
  30. node,symtype;
  31. type
  32. {# Defines all the methods required on 32-bit processors
  33. to handle 64-bit integers.
  34. }
  35. tcg64f32 = class(tcg64)
  36. procedure a_load64_const_ref(list : taasmoutput;value : qword;const ref : treference);override;
  37. procedure a_load64_reg_ref(list : taasmoutput;reg : tregister64;const ref : treference);override;
  38. procedure a_load64_ref_reg(list : taasmoutput;const ref : treference;reg : tregister64);override;
  39. procedure a_load64_reg_reg(list : taasmoutput;regsrc,regdst : tregister64);override;
  40. procedure a_load64_const_reg(list : taasmoutput;value: qword;reg : tregister64);override;
  41. procedure a_load64_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister64);override;
  42. procedure a_load64_loc_ref(list : taasmoutput;const l : tlocation;const ref : treference);override;
  43. procedure a_load64_const_loc(list : taasmoutput;value : qword;const l : tlocation);override;
  44. procedure a_load64_reg_loc(list : taasmoutput;reg : tregister64;const l : tlocation);override;
  45. procedure a_load64high_reg_ref(list : taasmoutput;reg : tregister;const ref : treference);override;
  46. procedure a_load64low_reg_ref(list : taasmoutput;reg : tregister;const ref : treference);override;
  47. procedure a_load64high_ref_reg(list : taasmoutput;const ref : treference;reg : tregister);override;
  48. procedure a_load64low_ref_reg(list : taasmoutput;const ref : treference;reg : tregister);override;
  49. procedure a_load64high_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);override;
  50. procedure a_load64low_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);override;
  51. procedure a_op64_const_loc(list : taasmoutput;op:TOpCG;value : qword;const l: tlocation);override;
  52. procedure a_op64_reg_loc(list : taasmoutput;op:TOpCG;reg : tregister64;const l : tlocation);override;
  53. procedure a_op64_loc_reg(list : taasmoutput;op:TOpCG;const l : tlocation;reg : tregister64);override;
  54. procedure a_param64_reg(list : taasmoutput;reg : tregister64;nr : longint);override;
  55. procedure a_param64_const(list : taasmoutput;value : qword;nr : longint);override;
  56. procedure a_param64_ref(list : taasmoutput;const r : treference;nr : longint);override;
  57. procedure a_param64_loc(list : taasmoutput;const l : tlocation;nr : longint);override;
  58. procedure g_rangecheck64(list: taasmoutput; const p: tnode;
  59. const todef: tdef); override;
  60. end;
  61. {# Creates a tregister64 record from 2 32 Bit registers. }
  62. function joinreg64(reglo,reghi : tregister) : tregister64;
  63. implementation
  64. uses
  65. globtype,globals,systems,
  66. cgbase,
  67. verbose,
  68. symbase,symconst,symdef,types;
  69. function joinreg64(reglo,reghi : tregister) : tregister64;
  70. begin
  71. result.reglo:=reglo;
  72. result.reghi:=reghi;
  73. end;
  74. procedure tcg64f32.a_load64_reg_ref(list : taasmoutput;reg : tregister64;const ref : treference);
  75. var
  76. tmpreg: tregister;
  77. tmpref: treference;
  78. begin
  79. if target_info.endian=endian_big then
  80. begin
  81. tmpreg:=reg.reglo;
  82. reg.reglo:=reg.reghi;
  83. reg.reghi:=tmpreg;
  84. end;
  85. cg.a_load_reg_ref(list,OS_32,reg.reglo,ref);
  86. tmpref := ref;
  87. inc(tmpref.offset,4);
  88. cg.a_load_reg_ref(list,OS_32,reg.reghi,tmpref);
  89. end;
  90. procedure tcg64f32.a_load64_const_ref(list : taasmoutput;value : qword;const ref : treference);
  91. var
  92. tmpvalue : DWord;
  93. tmpref: treference;
  94. begin
  95. if target_info.endian<>source_info.endian then
  96. swap_qword(value);
  97. cg.a_load_const_ref(list,OS_32,lo(value),ref);
  98. tmpref := ref;
  99. inc(tmpref.offset,4);
  100. cg.a_load_const_ref(list,OS_32,hi(value),tmpref);
  101. end;
  102. procedure tcg64f32.a_load64_ref_reg(list : taasmoutput;const ref : treference;reg : tregister64);
  103. var
  104. tmpreg: tregister;
  105. tmpref: treference;
  106. got_scratch: boolean;
  107. begin
  108. if target_info.endian = endian_big then
  109. begin
  110. tmpreg := reg.reglo;
  111. reg.reglo := reg.reghi;
  112. reg.reghi := tmpreg;
  113. end;
  114. got_scratch:=false;
  115. tmpref := ref;
  116. if (tmpref.base=reg.reglo) then
  117. begin
  118. tmpreg := cg.get_scratch_reg_int(list);
  119. got_scratch:=true;
  120. cg.a_load_reg_reg(list,OS_ADDR,tmpref.base,tmpreg);
  121. tmpref.base:=tmpreg;
  122. end
  123. else
  124. { this works only for the i386, thus the i386 needs to override }
  125. { this method and this method must be replaced by a more generic }
  126. { implementation FK }
  127. if (tmpref.index=reg.reglo) then
  128. begin
  129. tmpreg:=cg.get_scratch_reg_int(list);
  130. got_scratch:=true;
  131. cg.a_load_reg_reg(list,OS_ADDR,tmpref.index,tmpreg);
  132. tmpref.index:=tmpreg;
  133. end;
  134. cg.a_load_ref_reg(list,OS_32,tmpref,reg.reglo);
  135. inc(tmpref.offset,4);
  136. cg.a_load_ref_reg(list,OS_32,tmpref,reg.reghi);
  137. if got_scratch then
  138. cg.free_scratch_reg(list,tmpreg);
  139. end;
  140. procedure tcg64f32.a_load64_reg_reg(list : taasmoutput;regsrc,regdst : tregister64);
  141. begin
  142. cg.a_load_reg_reg(list,OS_32,regsrc.reglo,regdst.reglo);
  143. cg.a_load_reg_reg(list,OS_32,regsrc.reghi,regdst.reghi);
  144. end;
  145. procedure tcg64f32.a_load64_const_reg(list : taasmoutput;value : qword;reg : tregister64);
  146. begin
  147. if target_info.endian<>source_info.endian then
  148. swap_qword(value);
  149. cg.a_load_const_reg(list,OS_32,lo(value),reg.reglo);
  150. cg.a_load_const_reg(list,OS_32,hi(value),reg.reghi);
  151. end;
  152. procedure tcg64f32.a_load64_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister64);
  153. begin
  154. case l.loc of
  155. LOC_REFERENCE, LOC_CREFERENCE:
  156. a_load64_ref_reg(list,l.reference,reg);
  157. LOC_REGISTER,LOC_CREGISTER:
  158. a_load64_reg_reg(list,l.register64,reg);
  159. LOC_CONSTANT :
  160. a_load64_const_reg(list,l.valueqword,reg);
  161. else
  162. internalerror(200112292);
  163. end;
  164. end;
  165. procedure tcg64f32.a_load64_loc_ref(list : taasmoutput;const l : tlocation;const ref : treference);
  166. begin
  167. case l.loc of
  168. LOC_REGISTER,LOC_CREGISTER:
  169. a_load64_reg_ref(list,l.reg64,ref);
  170. LOC_CONSTANT :
  171. a_load64_const_ref(list,l.valueqword,ref);
  172. else
  173. internalerror(200203288);
  174. end;
  175. end;
  176. procedure tcg64f32.a_load64_const_loc(list : taasmoutput;value : qword;const l : tlocation);
  177. begin
  178. case l.loc of
  179. LOC_REFERENCE, LOC_CREFERENCE:
  180. a_load64_const_ref(list,value,l.reference);
  181. LOC_REGISTER,LOC_CREGISTER:
  182. a_load64_const_reg(list,value,l.reg64);
  183. else
  184. internalerror(200112293);
  185. end;
  186. end;
  187. procedure tcg64f32.a_load64_reg_loc(list : taasmoutput;reg : tregister64;const l : tlocation);
  188. begin
  189. case l.loc of
  190. LOC_REFERENCE, LOC_CREFERENCE:
  191. a_load64_reg_ref(list,reg,l.reference);
  192. LOC_REGISTER,LOC_CREGISTER:
  193. a_load64_reg_reg(list,reg,l.register64);
  194. else
  195. internalerror(200112293);
  196. end;
  197. end;
  198. procedure tcg64f32.a_load64high_reg_ref(list : taasmoutput;reg : tregister;const ref : treference);
  199. var
  200. tmpref: treference;
  201. begin
  202. if target_info.endian = endian_big then
  203. cg.a_load_reg_ref(list,OS_32,reg,ref)
  204. else
  205. begin
  206. tmpref := ref;
  207. inc(tmpref.offset,4);
  208. cg.a_load_reg_ref(list,OS_32,reg,tmpref)
  209. end;
  210. end;
  211. procedure tcg64f32.a_load64low_reg_ref(list : taasmoutput;reg : tregister;const ref : treference);
  212. var
  213. tmpref: treference;
  214. begin
  215. if target_info.endian = endian_little then
  216. cg.a_load_reg_ref(list,OS_32,reg,ref)
  217. else
  218. begin
  219. tmpref := ref;
  220. inc(tmpref.offset,4);
  221. cg.a_load_reg_ref(list,OS_32,reg,tmpref)
  222. end;
  223. end;
  224. procedure tcg64f32.a_load64high_ref_reg(list : taasmoutput;const ref : treference;reg : tregister);
  225. var
  226. tmpref: treference;
  227. begin
  228. if target_info.endian = endian_big then
  229. cg.a_load_ref_reg(list,OS_32,ref,reg)
  230. else
  231. begin
  232. tmpref := ref;
  233. inc(tmpref.offset,4);
  234. cg.a_load_ref_reg(list,OS_32,tmpref,reg)
  235. end;
  236. end;
  237. procedure tcg64f32.a_load64low_ref_reg(list : taasmoutput;const ref : treference;reg : tregister);
  238. var
  239. tmpref: treference;
  240. begin
  241. if target_info.endian = endian_little then
  242. cg.a_load_ref_reg(list,OS_32,ref,reg)
  243. else
  244. begin
  245. tmpref := ref;
  246. inc(tmpref.offset,4);
  247. cg.a_load_ref_reg(list,OS_32,tmpref,reg)
  248. end;
  249. end;
  250. procedure tcg64f32.a_load64low_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);
  251. begin
  252. case l.loc of
  253. LOC_REFERENCE,
  254. LOC_CREFERENCE :
  255. a_load64low_ref_reg(list,l.reference,reg);
  256. LOC_REGISTER :
  257. cg.a_load_reg_reg(list,OS_32,l.registerlow,reg);
  258. LOC_CONSTANT :
  259. cg.a_load_const_reg(list,OS_32,l.valuelow,reg);
  260. else
  261. internalerror(200203244);
  262. end;
  263. end;
  264. procedure tcg64f32.a_load64high_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);
  265. begin
  266. case l.loc of
  267. LOC_REFERENCE,
  268. LOC_CREFERENCE :
  269. a_load64high_ref_reg(list,l.reference,reg);
  270. LOC_REGISTER :
  271. cg.a_load_reg_reg(list,OS_32,l.registerhigh,reg);
  272. LOC_CONSTANT :
  273. cg.a_load_const_reg(list,OS_32,l.valuehigh,reg);
  274. else
  275. internalerror(200203244);
  276. end;
  277. end;
  278. procedure tcg64f32.a_op64_const_loc(list : taasmoutput;op:TOpCG;value : qword;const l: tlocation);
  279. begin
  280. case l.loc of
  281. LOC_REFERENCE, LOC_CREFERENCE:
  282. a_op64_const_reg(list,op,value,l.register64);
  283. LOC_REGISTER,LOC_CREGISTER:
  284. a_op64_const_ref(list,op,value,l.reference);
  285. else
  286. internalerror(200203292);
  287. end;
  288. end;
  289. procedure tcg64f32.a_op64_reg_loc(list : taasmoutput;op:TOpCG;reg : tregister64;const l : tlocation);
  290. begin
  291. case l.loc of
  292. LOC_REFERENCE, LOC_CREFERENCE:
  293. a_op64_reg_ref(list,op,reg,l.reference);
  294. LOC_REGISTER,LOC_CREGISTER:
  295. a_op64_reg_reg(list,op,reg,l.register64);
  296. else
  297. internalerror(2002032422);
  298. end;
  299. end;
  300. procedure tcg64f32.a_op64_loc_reg(list : taasmoutput;op:TOpCG;const l : tlocation;reg : tregister64);
  301. begin
  302. case l.loc of
  303. LOC_REFERENCE, LOC_CREFERENCE:
  304. a_op64_ref_reg(list,op,l.reference,reg);
  305. LOC_REGISTER,LOC_CREGISTER:
  306. a_op64_reg_reg(list,op,l.register64,reg);
  307. LOC_CONSTANT :
  308. a_op64_const_reg(list,op,l.valueqword,reg);
  309. else
  310. internalerror(200203242);
  311. end;
  312. end;
  313. procedure tcg64f32.a_param64_reg(list : taasmoutput;reg : tregister64;nr : longint);
  314. begin
  315. cg.a_param_reg(list,OS_32,reg.reghi,nr);
  316. { the nr+1 needs definitivly a fix FK }
  317. { maybe the parameter numbering needs }
  318. { to take care of this on 32 Bit }
  319. { systems FK }
  320. cg.a_param_reg(list,OS_32,reg.reglo,nr+1);
  321. end;
  322. procedure tcg64f32.a_param64_const(list : taasmoutput;value : qword;nr : longint);
  323. begin
  324. if target_info.endian<>source_info.endian then
  325. swap_qword(value);
  326. cg.a_param_const(list,OS_32,hi(value),nr);
  327. { the nr+1 needs definitivly a fix FK }
  328. { maybe the parameter numbering needs }
  329. { to take care of this on 32 Bit }
  330. { systems FK }
  331. cg.a_param_const(list,OS_32,lo(value),nr+1);
  332. end;
  333. procedure tcg64f32.a_param64_ref(list : taasmoutput;const r : treference;nr : longint);
  334. var
  335. tmpref: treference;
  336. begin
  337. tmpref := r;
  338. inc(tmpref.offset,4);
  339. cg.a_param_ref(list,OS_32,tmpref,nr);
  340. { the nr+1 needs definitivly a fix FK }
  341. { maybe the parameter numbering needs }
  342. { to take care of this on 32 Bit }
  343. { systems FK }
  344. cg.a_param_ref(list,OS_32,r,nr+1);
  345. end;
  346. procedure tcg64f32.a_param64_loc(list : taasmoutput;const l:tlocation;nr : longint);
  347. begin
  348. case l.loc of
  349. LOC_REGISTER,
  350. LOC_CREGISTER :
  351. a_param64_reg(list,l.register64,nr);
  352. LOC_CONSTANT :
  353. a_param64_const(list,l.valueqword,nr);
  354. LOC_CREFERENCE,
  355. LOC_REFERENCE :
  356. a_param64_ref(list,l.reference,nr);
  357. else
  358. internalerror(200203287);
  359. end;
  360. end;
  361. procedure tcg64f32.g_rangecheck64(list : taasmoutput;const p : tnode;const todef : tdef);
  362. var
  363. neglabel,
  364. poslabel,
  365. endlabel: tasmlabel;
  366. hreg : tregister;
  367. hdef : torddef;
  368. fromdef : tdef;
  369. opsize : tcgsize;
  370. oldregisterdef: boolean;
  371. from_signed,to_signed: boolean;
  372. got_scratch: boolean;
  373. begin
  374. fromdef:=p.resulttype.def;
  375. from_signed := is_signed(fromdef);
  376. to_signed := is_signed(todef);
  377. if not is_64bitint(todef) then
  378. begin
  379. oldregisterdef := registerdef;
  380. registerdef := false;
  381. { get the high dword in a register }
  382. if p.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
  383. begin
  384. hreg := p.location.registerhigh;
  385. got_scratch := false
  386. end
  387. else
  388. begin
  389. hreg := cg.get_scratch_reg_int(list);
  390. got_scratch := true;
  391. a_load64high_ref_reg(list,p.location.reference,hreg);
  392. end;
  393. getlabel(poslabel);
  394. { check high dword, must be 0 (for positive numbers) }
  395. cg.a_cmp_const_reg_label(list,OS_32,OC_EQ,0,hreg,poslabel);
  396. { It can also be $ffffffff, but only for negative numbers }
  397. if from_signed and to_signed then
  398. begin
  399. getlabel(neglabel);
  400. cg.a_cmp_const_reg_label(list,OS_32,OC_EQ,aword(-1),hreg,neglabel);
  401. end;
  402. { !!! freeing of register should happen directly after compare! (JM) }
  403. if got_scratch then
  404. cg.free_scratch_reg(list,hreg);
  405. { For all other values we have a range check error }
  406. cg.a_call_name(list,'FPC_RANGEERROR');
  407. { if the high dword = 0, the low dword can be considered a }
  408. { simple cardinal }
  409. cg.a_label(list,poslabel);
  410. hdef:=torddef.create(u32bit,0,cardinal($ffffffff));
  411. { the real p.resulttype.def is already saved in fromdef }
  412. p.resulttype.def := hdef;
  413. { no use in calling just "g_rangecheck" since that one will }
  414. { simply call the inherited method too (JM) }
  415. cg.g_rangecheck(list,p,todef);
  416. hdef.free;
  417. { restore original resulttype.def }
  418. p.resulttype.def := todef;
  419. if from_signed and to_signed then
  420. begin
  421. getlabel(endlabel);
  422. cg.a_jmp_always(list,endlabel);
  423. { if the high dword = $ffffffff, then the low dword (when }
  424. { considered as a longint) must be < 0 }
  425. cg.a_label(list,neglabel);
  426. if p.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
  427. begin
  428. hreg := p.location.registerlow;
  429. got_scratch := false
  430. end
  431. else
  432. begin
  433. hreg := cg.get_scratch_reg_int(list);
  434. got_scratch := true;
  435. a_load64low_ref_reg(list,p.location.reference,hreg);
  436. end;
  437. { get a new neglabel (JM) }
  438. getlabel(neglabel);
  439. cg.a_cmp_const_reg_label(list,OS_32,OC_LT,0,hreg,neglabel);
  440. { !!! freeing of register should happen directly after compare! (JM) }
  441. if got_scratch then
  442. cg.free_scratch_reg(list,hreg);
  443. cg.a_call_name(list,'FPC_RANGEERROR');
  444. { if we get here, the 64bit value lies between }
  445. { longint($80000000) and -1 (JM) }
  446. cg.a_label(list,neglabel);
  447. hdef:=torddef.create(s32bit,longint($80000000),-1);
  448. p.resulttype.def := hdef;
  449. cg.g_rangecheck(list,p,todef);
  450. hdef.free;
  451. cg.a_label(list,endlabel);
  452. end;
  453. registerdef := oldregisterdef;
  454. p.resulttype.def := fromdef;
  455. { restore p's resulttype.def }
  456. end
  457. else
  458. { todef = 64bit int }
  459. { no 64bit subranges supported, so only a small check is necessary }
  460. { if both are signed or both are unsigned, no problem! }
  461. if (from_signed xor to_signed) and
  462. { also not if the fromdef is unsigned and < 64bit, since that will }
  463. { always fit in a 64bit int (todef is 64bit) }
  464. (from_signed or
  465. (torddef(fromdef).typ = u64bit)) then
  466. begin
  467. { in all cases, there is only a problem if the higest bit is set }
  468. if p.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
  469. begin
  470. if is_64bitint(fromdef) then
  471. begin
  472. hreg := p.location.registerhigh;
  473. opsize := OS_32;
  474. end
  475. else
  476. begin
  477. hreg := p.location.register;
  478. opsize := def_cgsize(p.resulttype.def);
  479. end;
  480. got_scratch := false;
  481. end
  482. else
  483. begin
  484. hreg := cg.get_scratch_reg_int(list);
  485. got_scratch := true;
  486. opsize := def_cgsize(p.resulttype.def);
  487. if opsize in [OS_64,OS_S64] then
  488. a_load64high_ref_reg(list,p.location.reference,hreg)
  489. else
  490. cg.a_load_ref_reg(list,opsize,p.location.reference,hreg);
  491. end;
  492. getlabel(poslabel);
  493. cg.a_cmp_const_reg_label(list,opsize,OC_GTE,0,hreg,poslabel);
  494. { !!! freeing of register should happen directly after compare! (JM) }
  495. if got_scratch then
  496. cg.free_scratch_reg(list,hreg);
  497. cg.a_call_name(list,'FPC_RANGEERROR');
  498. cg.a_label(list,poslabel);
  499. end;
  500. end;
  501. (*
  502. procedure int64f32_assignment_int64_reg(p : passignmentnode);
  503. begin
  504. end;
  505. begin
  506. p2_assignment:=@int64f32_assignement_int64;
  507. *)
  508. end.
  509. {
  510. $Log$
  511. Revision 1.16 2002-07-01 18:46:21 peter
  512. * internal linker
  513. * reorganized aasm layer
  514. Revision 1.15 2002/07/01 16:23:52 peter
  515. * cg64 patch
  516. * basics for currency
  517. * asnode updates for class and interface (not finished)
  518. Revision 1.14 2002/05/20 13:30:40 carl
  519. * bugfix of hdisponen (base must be set, not index)
  520. * more portability fixes
  521. Revision 1.13 2002/05/18 13:34:05 peter
  522. * readded missing revisions
  523. Revision 1.12 2002/05/16 19:46:35 carl
  524. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  525. + try to fix temp allocation (still in ifdef)
  526. + generic constructor calls
  527. + start of tassembler / tmodulebase class cleanup
  528. Revision 1.10 2002/05/12 16:53:04 peter
  529. * moved entry and exitcode to ncgutil and cgobj
  530. * foreach gets extra argument for passing local data to the
  531. iterator function
  532. * -CR checks also class typecasts at runtime by changing them
  533. into as
  534. * fixed compiler to cycle with the -CR option
  535. * fixed stabs with elf writer, finally the global variables can
  536. be watched
  537. * removed a lot of routines from cga unit and replaced them by
  538. calls to cgobj
  539. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  540. u32bit then the other is typecasted also to u32bit without giving
  541. a rangecheck warning/error.
  542. * fixed pascal calling method with reversing also the high tree in
  543. the parast, detected by tcalcst3 test
  544. Revision 1.9 2002/04/25 20:16:38 peter
  545. * moved more routines from cga/n386util
  546. Revision 1.8 2002/04/21 15:28:51 carl
  547. * a_jmp_cond -> a_jmp_always
  548. Revision 1.7 2002/04/07 13:21:18 carl
  549. + more documentation
  550. Revision 1.6 2002/04/03 10:41:35 jonas
  551. + a_load64_const_loc method
  552. Revision 1.5 2002/04/02 17:11:27 peter
  553. * tlocation,treference update
  554. * LOC_CONSTANT added for better constant handling
  555. * secondadd splitted in multiple routines
  556. * location_force_reg added for loading a location to a register
  557. of a specified size
  558. * secondassignment parses now first the right and then the left node
  559. (this is compatible with Kylix). This saves a lot of push/pop especially
  560. with string operations
  561. * adapted some routines to use the new cg methods
  562. Revision 1.4 2002/03/04 19:10:11 peter
  563. * removed compiler warnings
  564. Revision 1.3 2002/01/24 12:33:52 jonas
  565. * adapted ranges of native types to int64 (e.g. high cardinal is no
  566. longer longint($ffffffff), but just $fffffff in psystem)
  567. * small additional fix in 64bit rangecheck code generation for 32 bit
  568. processors
  569. * adaption of ranges required the matching talgorithm used for selecting
  570. which overloaded procedure to call to be adapted. It should now always
  571. select the closest match for ordinal parameters.
  572. + inttostr(qword) in sysstr.inc/sysstrh.inc
  573. + abs(int64), sqr(int64), sqr(qword) in systemh.inc/generic.inc (previous
  574. fixes were required to be able to add them)
  575. * is_in_limit() moved from ncal to types unit, should always be used
  576. instead of direct comparisons of low/high values of orddefs because
  577. qword is a special case
  578. }