cg64f32.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 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. All 32-bit processors should use this class as
  22. the base code generator class instead of tcg.
  23. }
  24. unit cg64f32;
  25. {$i defines.inc}
  26. interface
  27. uses
  28. aasm,
  29. cpuinfo, cpubase,
  30. cginfo, cgobj,
  31. node,symtype;
  32. type
  33. {# Defines all the methods required on 32-bit processors
  34. to handle 64-bit integers. All 32-bit processors should
  35. create derive a class of this type instead of @var(tcg).
  36. }
  37. tcg64f32 = class(tcg)
  38. procedure a_load64_const_ref(list : taasmoutput;valuelo, valuehi : AWord;const ref : treference);
  39. procedure a_load64_reg_ref(list : taasmoutput;reglo, reghi : tregister;const ref : treference);
  40. procedure a_load64_ref_reg(list : taasmoutput;const ref : treference;reglo,reghi : tregister);
  41. procedure a_load64_reg_reg(list : taasmoutput;reglosrc,reghisrc,reglodst,reghidst : tregister);
  42. procedure a_load64_const_reg(list : taasmoutput;valuelosrc,valuehisrc:AWord;reglodst,reghidst : tregister);
  43. procedure a_load64_loc_reg(list : taasmoutput;const l : tlocation;reglo,reghi : tregister);
  44. procedure a_load64_loc_ref(list : taasmoutput;const l : tlocation;const ref : treference);
  45. procedure a_load64_const_loc(list : taasmoutput;valuelo, valuehi : AWord;const l : tlocation);
  46. procedure a_load64_reg_loc(list : taasmoutput;reglo, reghi : tregister;const l : tlocation);
  47. procedure a_load64high_reg_ref(list : taasmoutput;reg : tregister;const ref : treference);
  48. procedure a_load64low_reg_ref(list : taasmoutput;reg : tregister;const ref : treference);
  49. procedure a_load64high_ref_reg(list : taasmoutput;const ref : treference;reg : tregister);
  50. procedure a_load64low_ref_reg(list : taasmoutput;const ref : treference;reg : tregister);
  51. procedure a_load64high_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);
  52. procedure a_load64low_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);
  53. procedure a_op64_ref_reg(list : taasmoutput;op:TOpCG;const ref : treference;reglo,reghi : tregister);virtual;abstract;
  54. procedure a_op64_reg_reg(list : taasmoutput;op:TOpCG;reglosrc,reghisrc,reglodst,reghidst : tregister);virtual;abstract;
  55. procedure a_op64_reg_ref(list : taasmoutput;op:TOpCG;reglosrc,reghisrc : tregister;const ref : treference);virtual;abstract;
  56. procedure a_op64_const_reg(list : taasmoutput;op:TOpCG;valuelosrc,valuehisrc:AWord;reglodst,reghidst : tregister);virtual;abstract;
  57. procedure a_op64_const_ref(list : taasmoutput;op:TOpCG;valuelosrc,valuehisrc:AWord;const ref : treference);virtual;abstract;
  58. procedure a_op64_const_loc(list : taasmoutput;op:TOpCG;valuelosrc,valuehisrc:aword;const l: tlocation);
  59. procedure a_op64_reg_loc(list : taasmoutput;op:TOpCG;reglo,reghi : tregister;const l : tlocation);
  60. procedure a_op64_loc_reg(list : taasmoutput;op:TOpCG;const l : tlocation;reglo,reghi : tregister);
  61. procedure a_param64_reg(list : taasmoutput;reglo,reghi : tregister;nr : longint);
  62. procedure a_param64_const(list : taasmoutput;valuelo,valuehi : aword;nr : longint);
  63. procedure a_param64_ref(list : taasmoutput;const r : treference;nr : longint);
  64. procedure a_param64_loc(list : taasmoutput;const l : tlocation;nr : longint);
  65. { override to catch 64bit rangechecks }
  66. procedure g_rangecheck(list: taasmoutput; const p: tnode;
  67. const todef: tdef); override;
  68. private
  69. { produces range check code for 32bit processors when one of the }
  70. { operands is 64 bit }
  71. procedure g_rangecheck64(list : taasmoutput; p : tnode;todef : tdef);
  72. end;
  73. implementation
  74. uses
  75. globtype,globals,systems,
  76. cgbase,
  77. verbose,
  78. symbase,symconst,symdef,types;
  79. procedure tcg64f32.a_load64_reg_ref(list : taasmoutput;reglo, reghi : tregister;const ref : treference);
  80. var
  81. tmpreg: tregister;
  82. tmpref: treference;
  83. begin
  84. if target_info.endian = endian_big then
  85. begin
  86. tmpreg := reglo;
  87. reglo := reghi;
  88. reghi := tmpreg;
  89. end;
  90. a_load_reg_ref(list,OS_32,reglo,ref);
  91. tmpref := ref;
  92. inc(tmpref.offset,4);
  93. a_load_reg_ref(list,OS_32,reghi,tmpref);
  94. end;
  95. procedure tcg64f32.a_load64_const_ref(list : taasmoutput;valuelo, valuehi : AWord;const ref : treference);
  96. var
  97. tmpvalue: AWord;
  98. tmpref: treference;
  99. begin
  100. if target_info.endian = endian_big then
  101. begin
  102. tmpvalue := valuelo;
  103. valuelo := valuehi;
  104. valuehi := tmpvalue;
  105. end;
  106. a_load_const_ref(list,OS_32,valuelo,ref);
  107. tmpref := ref;
  108. inc(tmpref.offset,4);
  109. a_load_const_ref(list,OS_32,valuehi,tmpref);
  110. end;
  111. procedure tcg64f32.a_load64_ref_reg(list : taasmoutput;const ref : treference;reglo,reghi : tregister);
  112. var
  113. tmpreg: tregister;
  114. tmpref: treference;
  115. got_scratch: boolean;
  116. begin
  117. if target_info.endian = endian_big then
  118. begin
  119. tmpreg := reglo;
  120. reglo := reghi;
  121. reghi := tmpreg;
  122. end;
  123. got_scratch:=false;
  124. tmpref := ref;
  125. if (tmpref.base=reglo) then
  126. begin
  127. tmpreg := get_scratch_reg(list);
  128. got_scratch:=true;
  129. a_load_reg_reg(list,OS_ADDR,tmpref.base,tmpreg);
  130. tmpref.base:=tmpreg;
  131. end
  132. else
  133. if (tmpref.index=reglo) then
  134. begin
  135. tmpreg := get_scratch_reg(list);
  136. got_scratch:=true;
  137. a_load_reg_reg(list,OS_ADDR,tmpref.index,tmpreg);
  138. tmpref.index:=tmpreg;
  139. end;
  140. a_load_ref_reg(list,OS_32,tmpref,reglo);
  141. inc(tmpref.offset,4);
  142. a_load_ref_reg(list,OS_32,tmpref,reghi);
  143. if got_scratch then
  144. free_scratch_reg(list,tmpreg);
  145. end;
  146. procedure tcg64f32.a_load64_reg_reg(list : taasmoutput;reglosrc,reghisrc,reglodst,reghidst : tregister);
  147. begin
  148. a_load_reg_reg(list,OS_32,reglosrc,reglodst);
  149. a_load_reg_reg(list,OS_32,reghisrc,reghidst);
  150. end;
  151. procedure tcg64f32.a_load64_const_reg(list : taasmoutput;valuelosrc,valuehisrc:AWord;reglodst,reghidst : tregister);
  152. begin
  153. a_load_const_reg(list,OS_32,valuelosrc,reglodst);
  154. a_load_const_reg(list,OS_32,valuehisrc,reghidst);
  155. end;
  156. procedure tcg64f32.a_load64_loc_reg(list : taasmoutput;const l : tlocation;reglo,reghi : tregister);
  157. begin
  158. case l.loc of
  159. LOC_REFERENCE, LOC_CREFERENCE:
  160. a_load64_ref_reg(list,l.reference,reglo,reghi);
  161. LOC_REGISTER,LOC_CREGISTER:
  162. a_load64_reg_reg(list,l.registerlow,l.registerhigh,reglo,reghi);
  163. LOC_CONSTANT :
  164. a_load64_const_reg(list,l.valuelow,l.valuehigh,reglo,reghi);
  165. else
  166. internalerror(200112292);
  167. end;
  168. end;
  169. procedure tcg64f32.a_load64_loc_ref(list : taasmoutput;const l : tlocation;const ref : treference);
  170. begin
  171. case l.loc of
  172. LOC_REGISTER,LOC_CREGISTER:
  173. a_load64_reg_ref(list,l.registerlow,l.registerhigh,ref);
  174. LOC_CONSTANT :
  175. a_load64_const_ref(list,l.valuelow,l.valuehigh,ref);
  176. else
  177. internalerror(200203288);
  178. end;
  179. end;
  180. procedure tcg64f32.a_load64_const_loc(list : taasmoutput;valuelo, valuehi : AWord;const l : tlocation);
  181. begin
  182. case l.loc of
  183. LOC_REFERENCE, LOC_CREFERENCE:
  184. a_load64_const_ref(list,valuelo,valuehi,l.reference);
  185. LOC_REGISTER,LOC_CREGISTER:
  186. a_load64_const_reg(list,valuelo,valuehi,l.registerlow,l.registerhigh);
  187. else
  188. internalerror(200112293);
  189. end;
  190. end;
  191. procedure tcg64f32.a_load64_reg_loc(list : taasmoutput;reglo,reghi : tregister;const l : tlocation);
  192. begin
  193. case l.loc of
  194. LOC_REFERENCE, LOC_CREFERENCE:
  195. a_load64_reg_ref(list,reglo,reghi,l.reference);
  196. LOC_REGISTER,LOC_CREGISTER:
  197. a_load64_reg_reg(list,reglo,reghi,l.registerlow,l.registerhigh);
  198. else
  199. internalerror(200112293);
  200. end;
  201. end;
  202. procedure tcg64f32.a_load64high_reg_ref(list : taasmoutput;reg : tregister;const ref : treference);
  203. var
  204. tmpref: treference;
  205. begin
  206. if target_info.endian = endian_big then
  207. a_load_reg_ref(list,OS_32,reg,ref)
  208. else
  209. begin
  210. tmpref := ref;
  211. inc(tmpref.offset,4);
  212. a_load_reg_ref(list,OS_32,reg,tmpref)
  213. end;
  214. end;
  215. procedure tcg64f32.a_load64low_reg_ref(list : taasmoutput;reg : tregister;const ref : treference);
  216. var
  217. tmpref: treference;
  218. begin
  219. if target_info.endian = endian_little then
  220. a_load_reg_ref(list,OS_32,reg,ref)
  221. else
  222. begin
  223. tmpref := ref;
  224. inc(tmpref.offset,4);
  225. a_load_reg_ref(list,OS_32,reg,tmpref)
  226. end;
  227. end;
  228. procedure tcg64f32.a_load64high_ref_reg(list : taasmoutput;const ref : treference;reg : tregister);
  229. var
  230. tmpref: treference;
  231. begin
  232. if target_info.endian = endian_big then
  233. a_load_ref_reg(list,OS_32,ref,reg)
  234. else
  235. begin
  236. tmpref := ref;
  237. inc(tmpref.offset,4);
  238. a_load_ref_reg(list,OS_32,tmpref,reg)
  239. end;
  240. end;
  241. procedure tcg64f32.a_load64low_ref_reg(list : taasmoutput;const ref : treference;reg : tregister);
  242. var
  243. tmpref: treference;
  244. begin
  245. if target_info.endian = endian_little then
  246. a_load_ref_reg(list,OS_32,ref,reg)
  247. else
  248. begin
  249. tmpref := ref;
  250. inc(tmpref.offset,4);
  251. a_load_ref_reg(list,OS_32,tmpref,reg)
  252. end;
  253. end;
  254. procedure tcg64f32.a_load64low_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);
  255. begin
  256. case l.loc of
  257. LOC_REFERENCE,
  258. LOC_CREFERENCE :
  259. a_load64low_ref_reg(list,l.reference,reg);
  260. LOC_REGISTER :
  261. a_load_reg_reg(list,OS_32,l.registerlow,reg);
  262. LOC_CONSTANT :
  263. a_load_const_reg(list,OS_32,l.valuelow,reg);
  264. else
  265. internalerror(200203244);
  266. end;
  267. end;
  268. procedure tcg64f32.a_load64high_loc_reg(list : taasmoutput;const l : tlocation;reg : tregister);
  269. begin
  270. case l.loc of
  271. LOC_REFERENCE,
  272. LOC_CREFERENCE :
  273. a_load64high_ref_reg(list,l.reference,reg);
  274. LOC_REGISTER :
  275. a_load_reg_reg(list,OS_32,l.registerhigh,reg);
  276. LOC_CONSTANT :
  277. a_load_const_reg(list,OS_32,l.valuehigh,reg);
  278. else
  279. internalerror(200203244);
  280. end;
  281. end;
  282. procedure tcg64f32.a_op64_const_loc(list : taasmoutput;op:TOpCG;valuelosrc,valuehisrc:aword;const l: tlocation);
  283. begin
  284. case l.loc of
  285. LOC_REFERENCE, LOC_CREFERENCE:
  286. a_op64_const_reg(list,op,valuelosrc,valuehisrc,l.registerlow,l.registerhigh);
  287. LOC_REGISTER,LOC_CREGISTER:
  288. a_op64_const_ref(list,op,valuelosrc,valuehisrc,l.reference);
  289. else
  290. internalerror(200203292);
  291. end;
  292. end;
  293. procedure tcg64f32.a_op64_reg_loc(list : taasmoutput;op:TOpCG;reglo,reghi : tregister;const l : tlocation);
  294. begin
  295. case l.loc of
  296. LOC_REFERENCE, LOC_CREFERENCE:
  297. a_op64_reg_ref(list,op,reglo,reghi,l.reference);
  298. LOC_REGISTER,LOC_CREGISTER:
  299. a_op64_reg_reg(list,op,reglo,reghi,l.registerlow,l.registerhigh);
  300. else
  301. internalerror(2002032422);
  302. end;
  303. end;
  304. procedure tcg64f32.a_op64_loc_reg(list : taasmoutput;op:TOpCG;const l : tlocation;reglo,reghi : tregister);
  305. begin
  306. case l.loc of
  307. LOC_REFERENCE, LOC_CREFERENCE:
  308. a_op64_ref_reg(list,op,l.reference,reglo,reghi);
  309. LOC_REGISTER,LOC_CREGISTER:
  310. a_op64_reg_reg(list,op,l.registerlow,l.registerhigh,reglo,reghi);
  311. LOC_CONSTANT :
  312. a_op64_const_reg(list,op,l.valuelow,l.valuehigh,reglo,reghi);
  313. else
  314. internalerror(200203242);
  315. end;
  316. end;
  317. procedure tcg64f32.a_param64_reg(list : taasmoutput;reglo,reghi : tregister;nr : longint);
  318. begin
  319. a_param_reg(list,OS_32,reghi,nr);
  320. a_param_reg(list,OS_32,reglo,nr+1);
  321. end;
  322. procedure tcg64f32.a_param64_const(list : taasmoutput;valuelo,valuehi : aword;nr : longint);
  323. begin
  324. a_param_const(list,OS_32,valuehi,nr);
  325. a_param_const(list,OS_32,valuelo,nr+1);
  326. end;
  327. procedure tcg64f32.a_param64_ref(list : taasmoutput;const r : treference;nr : longint);
  328. var
  329. tmpref: treference;
  330. begin
  331. a_param_ref(list,OS_32,r,nr);
  332. tmpref := r;
  333. inc(tmpref.offset,4);
  334. a_param_ref(list,OS_32,tmpref,nr+1);
  335. end;
  336. procedure tcg64f32.a_param64_loc(list : taasmoutput;const l:tlocation;nr : longint);
  337. begin
  338. case l.loc of
  339. LOC_REGISTER,
  340. LOC_CREGISTER :
  341. a_param64_reg(list,l.registerlow,l.registerhigh,nr);
  342. LOC_CONSTANT :
  343. a_param64_const(list,l.valuelow,l.valuehigh,nr);
  344. LOC_CREFERENCE,
  345. LOC_REFERENCE :
  346. a_param64_ref(list,l.reference,nr);
  347. else
  348. internalerror(200203287);
  349. end;
  350. end;
  351. procedure tcg64f32.g_rangecheck(list: taasmoutput; const p: tnode;
  352. const todef: tdef);
  353. begin
  354. { range checking on and range checkable value? }
  355. if not(cs_check_range in aktlocalswitches) or
  356. not(todef.deftype in [orddef,enumdef,arraydef]) then
  357. exit;
  358. { special case for 64bit rangechecks }
  359. if is_64bitint(p.resulttype.def) or is_64bitint(todef) then
  360. g_rangecheck64(list,p,todef)
  361. else
  362. inherited g_rangecheck(list,p,todef);
  363. end;
  364. procedure tcg64f32.g_rangecheck64(list : taasmoutput; p : tnode;todef : tdef);
  365. var
  366. neglabel,
  367. poslabel,
  368. endlabel: tasmlabel;
  369. hreg : tregister;
  370. hdef : torddef;
  371. fromdef : tdef;
  372. opsize : tcgsize;
  373. oldregisterdef: boolean;
  374. from_signed,to_signed: boolean;
  375. got_scratch: boolean;
  376. begin
  377. fromdef:=p.resulttype.def;
  378. from_signed := is_signed(fromdef);
  379. to_signed := is_signed(todef);
  380. if not is_64bitint(todef) then
  381. begin
  382. oldregisterdef := registerdef;
  383. registerdef := false;
  384. { get the high dword in a register }
  385. if p.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
  386. begin
  387. hreg := p.location.registerhigh;
  388. got_scratch := false
  389. end
  390. else
  391. begin
  392. hreg := get_scratch_reg(list);
  393. got_scratch := true;
  394. a_load64high_ref_reg(list,p.location.reference,hreg);
  395. end;
  396. getlabel(poslabel);
  397. { check high dword, must be 0 (for positive numbers) }
  398. a_cmp_const_reg_label(list,OS_32,OC_EQ,0,hreg,poslabel);
  399. { It can also be $ffffffff, but only for negative numbers }
  400. if from_signed and to_signed then
  401. begin
  402. getlabel(neglabel);
  403. a_cmp_const_reg_label(list,OS_32,OC_EQ,aword(-1),hreg,neglabel);
  404. end;
  405. { !!! freeing of register should happen directly after compare! (JM) }
  406. if got_scratch then
  407. free_scratch_reg(list,hreg);
  408. { For all other values we have a range check error }
  409. a_call_name(list,'FPC_RANGEERROR',0);
  410. { if the high dword = 0, the low dword can be considered a }
  411. { simple cardinal }
  412. a_label(list,poslabel);
  413. hdef:=torddef.create(u32bit,0,cardinal($ffffffff));
  414. { the real p.resulttype.def is already saved in fromdef }
  415. p.resulttype.def := hdef;
  416. { no use in calling just "g_rangecheck" since that one will }
  417. { simply call the inherited method too (JM) }
  418. inherited g_rangecheck(list,p,todef);
  419. hdef.free;
  420. { restore original resulttype.def }
  421. p.resulttype.def := todef;
  422. if from_signed and to_signed then
  423. begin
  424. getlabel(endlabel);
  425. a_jmp_always(list,endlabel);
  426. { if the high dword = $ffffffff, then the low dword (when }
  427. { considered as a longint) must be < 0 }
  428. a_label(list,neglabel);
  429. if p.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
  430. begin
  431. hreg := p.location.registerlow;
  432. got_scratch := false
  433. end
  434. else
  435. begin
  436. hreg := get_scratch_reg(list);
  437. got_scratch := true;
  438. a_load64low_ref_reg(list,p.location.reference,hreg);
  439. end;
  440. { get a new neglabel (JM) }
  441. getlabel(neglabel);
  442. a_cmp_const_reg_label(list,OS_32,OC_LT,0,hreg,neglabel);
  443. { !!! freeing of register should happen directly after compare! (JM) }
  444. if got_scratch then
  445. free_scratch_reg(list,hreg);
  446. a_call_name(list,'FPC_RANGEERROR',0);
  447. { if we get here, the 64bit value lies between }
  448. { longint($80000000) and -1 (JM) }
  449. a_label(list,neglabel);
  450. hdef:=torddef.create(s32bit,longint($80000000),-1);
  451. p.resulttype.def := hdef;
  452. inherited g_rangecheck(list,p,todef);
  453. hdef.free;
  454. a_label(list,endlabel);
  455. end;
  456. registerdef := oldregisterdef;
  457. p.resulttype.def := fromdef;
  458. { restore p's resulttype.def }
  459. end
  460. else
  461. { todef = 64bit int }
  462. { no 64bit subranges supported, so only a small check is necessary }
  463. { if both are signed or both are unsigned, no problem! }
  464. if (from_signed xor to_signed) and
  465. { also not if the fromdef is unsigned and < 64bit, since that will }
  466. { always fit in a 64bit int (todef is 64bit) }
  467. (from_signed or
  468. (torddef(fromdef).typ = u64bit)) then
  469. begin
  470. { in all cases, there is only a problem if the higest bit is set }
  471. if p.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
  472. begin
  473. if is_64bitint(fromdef) then
  474. begin
  475. hreg := p.location.registerhigh;
  476. opsize := OS_32;
  477. end
  478. else
  479. begin
  480. hreg := p.location.register;
  481. opsize := def_cgsize(p.resulttype.def);
  482. end;
  483. got_scratch := false;
  484. end
  485. else
  486. begin
  487. hreg := get_scratch_reg(list);
  488. got_scratch := true;
  489. opsize := def_cgsize(p.resulttype.def);
  490. if opsize in [OS_64,OS_S64] then
  491. a_load64high_ref_reg(list,p.location.reference,hreg)
  492. else
  493. a_load_ref_reg(list,opsize,p.location.reference,hreg);
  494. end;
  495. getlabel(poslabel);
  496. a_cmp_const_reg_label(list,opsize,OC_GTE,0,hreg,poslabel);
  497. { !!! freeing of register should happen directly after compare! (JM) }
  498. if got_scratch then
  499. free_scratch_reg(list,hreg);
  500. a_call_name(list,'FPC_RANGEERROR',0);
  501. a_label(list,poslabel);
  502. end;
  503. end;
  504. (*
  505. procedure int64f32_assignment_int64_reg(p : passignmentnode);
  506. begin
  507. end;
  508. begin
  509. p2_assignment:=@int64f32_assignement_int64;
  510. *)
  511. end.
  512. {
  513. $Log$
  514. Revision 1.8 2002-04-21 15:28:51 carl
  515. * a_jmp_cond -> a_jmp_always
  516. Revision 1.7 2002/04/07 13:21:18 carl
  517. + more documentation
  518. Revision 1.6 2002/04/03 10:41:35 jonas
  519. + a_load64_const_loc method
  520. Revision 1.5 2002/04/02 17:11:27 peter
  521. * tlocation,treference update
  522. * LOC_CONSTANT added for better constant handling
  523. * secondadd splitted in multiple routines
  524. * location_force_reg added for loading a location to a register
  525. of a specified size
  526. * secondassignment parses now first the right and then the left node
  527. (this is compatible with Kylix). This saves a lot of push/pop especially
  528. with string operations
  529. * adapted some routines to use the new cg methods
  530. Revision 1.4 2002/03/04 19:10:11 peter
  531. * removed compiler warnings
  532. Revision 1.3 2002/01/24 12:33:52 jonas
  533. * adapted ranges of native types to int64 (e.g. high cardinal is no
  534. longer longint($ffffffff), but just $fffffff in psystem)
  535. * small additional fix in 64bit rangecheck code generation for 32 bit
  536. processors
  537. * adaption of ranges required the matching talgorithm used for selecting
  538. which overloaded procedure to call to be adapted. It should now always
  539. select the closest match for ordinal parameters.
  540. + inttostr(qword) in sysstr.inc/sysstrh.inc
  541. + abs(int64), sqr(int64), sqr(qword) in systemh.inc/generic.inc (previous
  542. fixes were required to be able to add them)
  543. * is_in_limit() moved from ncal to types unit, should always be used
  544. instead of direct comparisons of low/high values of orddefs because
  545. qword is a special case
  546. Revision 1.2 2001/12/30 17:24:48 jonas
  547. * range checking is now processor independent (part in cgobj,
  548. part in cg64f32) and should work correctly again (it needed
  549. some changes after the changes of the low and high of
  550. tordef's to int64)
  551. * maketojumpbool() is now processor independent (in ncgutil)
  552. * getregister32 is now called getregisterint
  553. Revision 1.1 2001/12/29 15:29:58 jonas
  554. * powerpc/cgcpu.pas compiles :)
  555. * several powerpc-related fixes
  556. * cpuasm unit is now based on common tainst unit
  557. + nppcmat unit for powerpc (almost complete)
  558. Revision 1.1 2000/07/13 06:30:07 michael
  559. + Initial import
  560. Revision 1.1 2000/03/01 15:36:13 florian
  561. * some new stuff for the new cg
  562. }