ncgadd.pas 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808
  1. {
  2. $Id$
  3. Copyright (c) 2000-2002 by the FPC development team
  4. Code generation for add nodes (generic version)
  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 ncgadd;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. node,nadd,cpubase,cginfo;
  23. type
  24. tcgaddnode = class(taddnode)
  25. { function pass_1: tnode; override;}
  26. procedure pass_2;override;
  27. protected
  28. { call secondpass for both left and right }
  29. procedure pass_left_right;
  30. { set the register of the result location }
  31. procedure set_result_location_reg;
  32. { load left and right nodes into registers }
  33. procedure force_reg_left_right(allow_swap,allow_constant:boolean);
  34. { free used registers, except result location }
  35. procedure release_reg_left_right;
  36. procedure second_opfloat;
  37. procedure second_opboolean;
  38. procedure second_opsmallset;
  39. procedure second_op64bit;
  40. procedure second_opordinal;
  41. procedure second_addfloat;virtual;abstract;
  42. procedure second_addboolean;virtual;
  43. procedure second_addsmallset;virtual;
  44. procedure second_add64bit;virtual;
  45. procedure second_addordinal;virtual;
  46. procedure second_cmpfloat;virtual;abstract;
  47. procedure second_cmpboolean;virtual;
  48. procedure second_cmpsmallset;virtual;abstract;
  49. procedure second_cmp64bit;virtual;abstract;
  50. procedure second_cmpordinal;virtual;abstract;
  51. end;
  52. implementation
  53. uses
  54. globtype,systems,
  55. cutils,verbose,globals,
  56. symconst,symdef,paramgr,
  57. aasmbase,aasmtai,aasmcpu,defutil,htypechk,
  58. cgbase,cpuinfo,pass_1,pass_2,regvars,
  59. ncon,nset,ncgutil,tgobj,rgobj,cgobj,
  60. {$ifdef cpu64bit}
  61. cg64f64
  62. {$else cpu64bit}
  63. cg64f32
  64. {$endif cpu64bit}
  65. ;
  66. {*****************************************************************************
  67. Helpers
  68. *****************************************************************************}
  69. procedure tcgaddnode.pass_left_right;
  70. var
  71. tmpreg : tregister;
  72. isjump,
  73. pushedfpu : boolean;
  74. otl,ofl : tasmlabel;
  75. begin
  76. { calculate the operator which is more difficult }
  77. firstcomplex(self);
  78. { in case of constant put it to the left }
  79. if (left.nodetype=ordconstn) then
  80. swapleftright;
  81. isjump:=(left.location.loc=LOC_JUMP);
  82. if isjump then
  83. begin
  84. otl:=truelabel;
  85. objectlibrary.getlabel(truelabel);
  86. ofl:=falselabel;
  87. objectlibrary.getlabel(falselabel);
  88. end;
  89. secondpass(left);
  90. if left.location.loc in [LOC_FLAGS,LOC_JUMP] then
  91. location_force_reg(exprasmlist,left.location,left.location.size,false);
  92. if isjump then
  93. begin
  94. truelabel:=otl;
  95. falselabel:=ofl;
  96. end;
  97. { are too few registers free? }
  98. if left.location.loc=LOC_FPUREGISTER then
  99. pushedfpu:=maybe_pushfpu(exprasmlist,right.registersfpu,left.location)
  100. else
  101. pushedfpu:=false;
  102. isjump:=(right.location.loc=LOC_JUMP);
  103. if isjump then
  104. begin
  105. otl:=truelabel;
  106. objectlibrary.getlabel(truelabel);
  107. ofl:=falselabel;
  108. objectlibrary.getlabel(falselabel);
  109. end;
  110. secondpass(right);
  111. if right.location.loc in [LOC_FLAGS,LOC_JUMP] then
  112. location_force_reg(exprasmlist,right.location,right.location.size,false);
  113. if isjump then
  114. begin
  115. truelabel:=otl;
  116. falselabel:=ofl;
  117. end;
  118. if pushedfpu then
  119. begin
  120. tmpreg := rg.getregisterfpu(exprasmlist,left.location.size);
  121. cg.a_loadfpu_loc_reg(exprasmlist,left.location,tmpreg);
  122. location_reset(left.location,LOC_FPUREGISTER,left.location.size);
  123. left.location.register := tmpreg;
  124. end;
  125. end;
  126. procedure tcgaddnode.set_result_location_reg;
  127. begin
  128. location_reset(location,LOC_REGISTER,def_cgsize(resulttype.def));
  129. if left.location.loc=LOC_REGISTER then
  130. begin
  131. if TCGSize2Size[left.location.size]<>TCGSize2Size[location.size] then
  132. internalerror(200307041);
  133. {$ifndef cpu64bit}
  134. if location.size in [OS_64,OS_S64] then
  135. begin
  136. location.registerlow := left.location.registerlow;
  137. location.registerhigh := left.location.registerhigh;
  138. end
  139. else
  140. {$endif}
  141. location.register := left.location.register;
  142. end
  143. else
  144. if right.location.loc=LOC_REGISTER then
  145. begin
  146. if right.location.size<>location.size then
  147. internalerror(200307042);
  148. {$ifndef cpu64bit}
  149. if location.size in [OS_64,OS_S64] then
  150. begin
  151. location.registerlow := right.location.registerlow;
  152. location.registerhigh := right.location.registerhigh;
  153. end
  154. else
  155. {$endif}
  156. location.register := right.location.register;
  157. end
  158. else
  159. begin
  160. {$ifndef cpu64bit}
  161. if location.size in [OS_64,OS_S64] then
  162. begin
  163. location.registerlow := rg.getregisterint(exprasmlist,OS_INT);
  164. location.registerhigh := rg.getregisterint(exprasmlist,OS_INT);
  165. end
  166. else
  167. {$endif}
  168. location.register := rg.getregisterint(exprasmlist,location.size);
  169. end;
  170. end;
  171. procedure tcgaddnode.force_reg_left_right(allow_swap,allow_constant:boolean);
  172. begin
  173. if (left.location.loc<>LOC_REGISTER) and
  174. not(
  175. allow_constant and
  176. (left.location.loc=LOC_CONSTANT)
  177. ) then
  178. location_force_reg(exprasmlist,left.location,left.location.size,false);
  179. if (right.location.loc<>LOC_REGISTER) and
  180. not(
  181. allow_constant and
  182. (right.location.loc=LOC_CONSTANT) and
  183. (left.location.loc<>LOC_CONSTANT)
  184. ) then
  185. location_force_reg(exprasmlist,right.location,right.location.size,false);
  186. { Left is always a register, right can be register or constant }
  187. if left.location.loc<>LOC_REGISTER then
  188. begin
  189. { when it is not allowed to swap we have a constant on
  190. left, that will give problems }
  191. if not allow_swap then
  192. internalerror(200307041);
  193. swapleftright;
  194. end;
  195. end;
  196. procedure tcgaddnode.release_reg_left_right;
  197. begin
  198. if (right.location.loc in [LOC_REGISTER,LOC_FPUREGISTER]) and
  199. not(
  200. (location.loc=LOC_REGISTER) and
  201. (location.register=right.location.register)
  202. ) then
  203. location_release(exprasmlist,right.location);
  204. if (left.location.loc in [LOC_REGISTER,LOC_FPUREGISTER]) and
  205. not(
  206. (location.loc=LOC_REGISTER) and
  207. (location.register=left.location.register)
  208. ) then
  209. location_release(exprasmlist,left.location);
  210. end;
  211. {*****************************************************************************
  212. Smallsets
  213. *****************************************************************************}
  214. procedure tcgaddnode.second_opsmallset;
  215. begin
  216. { when a setdef is passed, it has to be a smallset }
  217. if ((left.resulttype.def.deftype=setdef) and
  218. (tsetdef(left.resulttype.def).settype<>smallset)) or
  219. ((right.resulttype.def.deftype=setdef) and
  220. (tsetdef(right.resulttype.def).settype<>smallset)) then
  221. internalerror(200203301);
  222. if nodetype in [equaln,unequaln,gtn,gten,lten,ltn] then
  223. second_cmpsmallset
  224. else
  225. second_addsmallset;
  226. end;
  227. procedure tcgaddnode.second_addsmallset;
  228. var
  229. cgop : TOpCg;
  230. tmpreg : tregister;
  231. opdone : boolean;
  232. begin
  233. opdone := false;
  234. pass_left_right;
  235. force_reg_left_right(true,true);
  236. set_result_location_reg;
  237. case nodetype of
  238. addn :
  239. begin
  240. { non-commucative }
  241. if (nf_swaped in flags) and
  242. (left.nodetype=setelementn) then
  243. swapleftright;
  244. { are we adding set elements ? }
  245. if right.nodetype=setelementn then
  246. begin
  247. { no range support for smallsets! }
  248. if assigned(tsetelementnode(right).right) then
  249. internalerror(43244);
  250. if (right.location.loc = LOC_CONSTANT) then
  251. cg.a_op_const_reg_reg(exprasmlist,OP_OR,location.size,
  252. aword(1 shl aword(right.location.value)),
  253. left.location.register,location.register)
  254. else
  255. begin
  256. tmpreg := rg.getregisterint(exprasmlist,location.size);
  257. cg.a_load_const_reg(exprasmlist,location.size,1,tmpreg);
  258. cg.a_op_reg_reg(exprasmlist,OP_SHL,location.size,
  259. right.location.register,tmpreg);
  260. if left.location.loc <> LOC_CONSTANT then
  261. cg.a_op_reg_reg_reg(exprasmlist,OP_OR,location.size,tmpreg,
  262. left.location.register,location.register)
  263. else
  264. cg.a_op_const_reg_reg(exprasmlist,OP_OR,location.size,
  265. aword(left.location.value),tmpreg,location.register);
  266. rg.ungetregisterint(exprasmlist,tmpreg);
  267. end;
  268. opdone := true;
  269. end
  270. else
  271. cgop := OP_OR;
  272. end;
  273. symdifn :
  274. cgop:=OP_XOR;
  275. muln :
  276. cgop:=OP_AND;
  277. subn :
  278. begin
  279. cgop:=OP_AND;
  280. if (not(nf_swaped in flags)) then
  281. if (right.location.loc=LOC_CONSTANT) then
  282. right.location.value := not(right.location.value)
  283. else
  284. opdone := true
  285. else if (left.location.loc=LOC_CONSTANT) then
  286. left.location.value := not(left.location.value)
  287. else
  288. begin
  289. swapleftright;
  290. opdone := true;
  291. end;
  292. if opdone then
  293. begin
  294. if left.location.loc = LOC_CONSTANT then
  295. begin
  296. tmpreg := rg.getregisterint(exprasmlist,location.size);
  297. cg.a_load_const_reg(exprasmlist,location.size,
  298. aword(left.location.value),tmpreg);
  299. cg.a_op_reg_reg(exprasmlist,OP_NOT,location.size,right.location.register,right.location.register);
  300. cg.a_op_reg_reg(exprasmlist,OP_AND,location.size,right.location.register,tmpreg);
  301. cg.a_load_reg_reg(exprasmlist,OS_INT,location.size,tmpreg,location.register);
  302. rg.ungetregisterint(exprasmlist,tmpreg);
  303. end
  304. else
  305. begin
  306. cg.a_op_reg_reg(exprasmlist,OP_NOT,right.location.size,right.location.register,right.location.register);
  307. cg.a_op_reg_reg(exprasmlist,OP_AND,left.location.size,right.location.register,left.location.register);
  308. cg.a_load_reg_reg(exprasmlist,left.location.size,location.size,left.location.register,location.register);
  309. end;
  310. end;
  311. end;
  312. else
  313. internalerror(2002072701);
  314. end;
  315. if not opdone then
  316. begin
  317. // these are all commutative operations
  318. if (left.location.loc = LOC_CONSTANT) then
  319. swapleftright;
  320. if (right.location.loc = LOC_CONSTANT) then
  321. cg.a_op_const_reg_reg(exprasmlist,cgop,location.size,
  322. aword(right.location.value),left.location.register,
  323. location.register)
  324. else
  325. cg.a_op_reg_reg_reg(exprasmlist,cgop,location.size,
  326. right.location.register,left.location.register,
  327. location.register);
  328. end;
  329. release_reg_left_right;
  330. end;
  331. {*****************************************************************************
  332. Boolean
  333. *****************************************************************************}
  334. procedure tcgaddnode.second_opboolean;
  335. begin
  336. if nodetype in [ltn,lten,gtn,gten,equaln,unequaln] then
  337. second_cmpboolean
  338. else
  339. second_addboolean;
  340. end;
  341. procedure tcgaddnode.second_addboolean;
  342. var
  343. cgop : TOpCg;
  344. otl,ofl : tasmlabel;
  345. begin
  346. { And,Or will only evaluate from left to right only the
  347. needed nodes unless full boolean evaluation is enabled }
  348. if (nodetype in [orn,andn]) and
  349. not(cs_full_boolean_eval in aktlocalswitches) then
  350. begin
  351. location_reset(location,LOC_JUMP,OS_NO);
  352. case nodetype of
  353. andn :
  354. begin
  355. otl:=truelabel;
  356. objectlibrary.getlabel(truelabel);
  357. secondpass(left);
  358. maketojumpbool(exprasmlist,left,lr_load_regvars);
  359. cg.a_label(exprasmlist,truelabel);
  360. truelabel:=otl;
  361. end;
  362. orn :
  363. begin
  364. ofl:=falselabel;
  365. objectlibrary.getlabel(falselabel);
  366. secondpass(left);
  367. maketojumpbool(exprasmlist,left,lr_load_regvars);
  368. cg.a_label(exprasmlist,falselabel);
  369. falselabel:=ofl;
  370. end;
  371. else
  372. internalerror(200307044);
  373. end;
  374. secondpass(right);
  375. maketojumpbool(exprasmlist,right,lr_load_regvars);
  376. end
  377. else
  378. begin
  379. pass_left_right;
  380. force_reg_left_right(false,true);
  381. set_result_location_reg;
  382. case nodetype of
  383. xorn :
  384. cgop:=OP_XOR;
  385. orn :
  386. cgop:=OP_OR;
  387. andn :
  388. cgop:=OP_AND;
  389. else
  390. internalerror(200203247);
  391. end;
  392. if right.location.loc <> LOC_CONSTANT then
  393. cg.a_op_reg_reg_reg(exprasmlist,cgop,location.size,
  394. left.location.register,right.location.register,
  395. location.register)
  396. else
  397. cg.a_op_const_reg_reg(exprasmlist,cgop,location.size,
  398. aword(right.location.value),left.location.register,
  399. location.register);
  400. end;
  401. release_reg_left_right;
  402. end;
  403. {*****************************************************************************
  404. 64-bit
  405. *****************************************************************************}
  406. procedure tcgaddnode.second_op64bit;
  407. begin
  408. if nodetype in [ltn,lten,gtn,gten,equaln,unequaln] then
  409. second_cmp64bit
  410. else
  411. second_add64bit;
  412. end;
  413. procedure tcgaddnode.second_add64bit;
  414. var
  415. op : TOpCG;
  416. checkoverflow : boolean;
  417. begin
  418. pass_left_right;
  419. force_reg_left_right(false,(cs_check_overflow in aktlocalswitches) and
  420. (nodetype in [addn,subn]));
  421. set_result_location_reg;
  422. { assume no overflow checking is required }
  423. checkoverflow := false;
  424. case nodetype of
  425. addn :
  426. begin
  427. op:=OP_ADD;
  428. checkoverflow := true;
  429. end;
  430. subn :
  431. begin
  432. op:=OP_SUB;
  433. checkoverflow := true;
  434. end;
  435. xorn:
  436. op:=OP_XOR;
  437. orn:
  438. op:=OP_OR;
  439. andn:
  440. op:=OP_AND;
  441. muln:
  442. begin
  443. { should be handled in pass_1 (JM) }
  444. internalerror(200109051);
  445. end;
  446. else
  447. internalerror(2002072705);
  448. end;
  449. case nodetype of
  450. xorn,orn,andn,addn:
  451. begin
  452. if (right.location.loc = LOC_CONSTANT) then
  453. cg64.a_op64_const_reg_reg(exprasmlist,op,right.location.valueqword,
  454. left.location.register64,location.register64)
  455. else
  456. cg64.a_op64_reg_reg_reg(exprasmlist,op,right.location.register64,
  457. left.location.register64,location.register64);
  458. end;
  459. subn:
  460. begin
  461. if (nf_swaped in flags) then
  462. swapleftright;
  463. if left.location.loc <> LOC_CONSTANT then
  464. begin
  465. if right.location.loc <> LOC_CONSTANT then
  466. // reg64 - reg64
  467. cg64.a_op64_reg_reg_reg(exprasmlist,OP_SUB,
  468. right.location.register64,left.location.register64,
  469. location.register64)
  470. else
  471. // reg64 - const64
  472. cg64.a_op64_const_reg_reg(exprasmlist,OP_SUB,
  473. right.location.valueqword,left.location.register64,
  474. location.register64)
  475. end
  476. else
  477. begin
  478. // const64 - reg64
  479. location_force_reg(exprasmlist,left.location,left.location.size,true);
  480. cg64.a_op64_reg_reg_reg(exprasmlist,OP_SUB,
  481. right.location.register64,left.location.register64,
  482. location.register64);
  483. end;
  484. end;
  485. else
  486. internalerror(2002072803);
  487. end;
  488. { emit overflow check if enabled }
  489. if checkoverflow then
  490. cg.g_overflowcheck(exprasmlist,Location,ResultType.Def);
  491. release_reg_left_right;
  492. end;
  493. {*****************************************************************************
  494. Floats
  495. *****************************************************************************}
  496. procedure tcgaddnode.second_opfloat;
  497. begin
  498. if nodetype in [ltn,lten,gtn,gten,equaln,unequaln] then
  499. second_cmpfloat
  500. else
  501. second_addfloat;
  502. end;
  503. {*****************************************************************************
  504. Ordinals
  505. *****************************************************************************}
  506. procedure tcgaddnode.second_opordinal;
  507. begin
  508. if (nodetype in [ltn,lten,gtn,gten,equaln,unequaln]) then
  509. second_cmpordinal
  510. else
  511. second_addordinal;
  512. end;
  513. procedure tcgaddnode.second_addordinal;
  514. var
  515. unsigned,
  516. checkoverflow : boolean;
  517. cgop : topcg;
  518. tmpreg : tregister;
  519. begin
  520. pass_left_right;
  521. force_reg_left_right(false,(cs_check_overflow in aktlocalswitches) and
  522. (nodetype in [addn,subn,muln]));
  523. set_result_location_reg;
  524. { determine if the comparison will be unsigned }
  525. unsigned:=not(is_signed(left.resulttype.def)) or
  526. not(is_signed(right.resulttype.def));
  527. { assume no overflow checking is require }
  528. checkoverflow := false;
  529. case nodetype of
  530. addn:
  531. begin
  532. cgop := OP_ADD;
  533. checkoverflow := true;
  534. end;
  535. xorn :
  536. begin
  537. cgop := OP_XOR;
  538. end;
  539. orn :
  540. begin
  541. cgop := OP_OR;
  542. end;
  543. andn:
  544. begin
  545. cgop := OP_AND;
  546. end;
  547. muln:
  548. begin
  549. checkoverflow := true;
  550. if unsigned then
  551. cgop := OP_MUL
  552. else
  553. cgop := OP_IMUL;
  554. end;
  555. subn :
  556. begin
  557. checkoverflow := true;
  558. cgop := OP_SUB;
  559. end;
  560. end;
  561. if nodetype <> subn then
  562. begin
  563. if (right.location.loc <> LOC_CONSTANT) then
  564. cg.a_op_reg_reg_reg(exprasmlist,cgop,location.size,
  565. left.location.register,right.location.register,
  566. location.register)
  567. else
  568. cg.a_op_const_reg_reg(exprasmlist,cgop,location.size,
  569. aword(right.location.value),left.location.register,
  570. location.register);
  571. end
  572. else { subtract is a special case since its not commutative }
  573. begin
  574. if (nf_swaped in flags) then
  575. swapleftright;
  576. if left.location.loc <> LOC_CONSTANT then
  577. begin
  578. if right.location.loc <> LOC_CONSTANT then
  579. cg.a_op_reg_reg_reg(exprasmlist,OP_SUB,location.size,
  580. right.location.register,left.location.register,
  581. location.register)
  582. else
  583. cg.a_op_const_reg_reg(exprasmlist,OP_SUB,location.size,
  584. aword(right.location.value),left.location.register,
  585. location.register);
  586. end
  587. else
  588. begin
  589. tmpreg := rg.getregisterint(exprasmlist,location.size);
  590. cg.a_load_const_reg(exprasmlist,location.size,
  591. aword(left.location.value),tmpreg);
  592. cg.a_op_reg_reg_reg(exprasmlist,OP_SUB,location.size,
  593. right.location.register,tmpreg,location.register);
  594. rg.ungetregisterint(exprasmlist,tmpreg);
  595. end;
  596. end;
  597. { emit overflow check if required }
  598. if checkoverflow then
  599. cg.g_overflowcheck(exprasmlist,Location,ResultType.Def);
  600. release_reg_left_right;
  601. end;
  602. procedure tcgaddnode.second_cmpboolean;
  603. begin
  604. second_cmpordinal;
  605. end;
  606. {*****************************************************************************
  607. pass_2
  608. *****************************************************************************}
  609. procedure tcgaddnode.pass_2;
  610. begin
  611. case left.resulttype.def.deftype of
  612. orddef :
  613. begin
  614. { handling boolean expressions }
  615. if is_boolean(left.resulttype.def) and
  616. is_boolean(right.resulttype.def) then
  617. second_opboolean
  618. { 64bit operations }
  619. else if is_64bit(left.resulttype.def) then
  620. second_op64bit
  621. else
  622. second_opordinal;
  623. end;
  624. stringdef :
  625. begin
  626. { this should already be handled in pass1 }
  627. internalerror(2002072402);
  628. end;
  629. setdef :
  630. begin
  631. { normalsets are already handled in pass1 }
  632. if (tsetdef(left.resulttype.def).settype<>smallset) then
  633. internalerror(200109041);
  634. second_opsmallset;
  635. end;
  636. arraydef :
  637. begin
  638. {$ifdef SUPPORT_MMX}
  639. if is_mmx_able_array(left.resulttype.def) then
  640. second_opmmx;
  641. {$endif SUPPORT_MMX}
  642. { only mmx arrays are possible }
  643. internalerror(200306016);
  644. end;
  645. floatdef :
  646. second_opfloat;
  647. else
  648. second_opordinal;
  649. end;
  650. end;
  651. begin
  652. caddnode:=tcgaddnode;
  653. end.
  654. {
  655. $Log$
  656. Revision 1.17 2003-09-03 15:55:00 peter
  657. * NEWRA branch merged
  658. Revision 1.16 2003/09/03 11:18:36 florian
  659. * fixed arm concatcopy
  660. + arm support in the common compiler sources added
  661. * moved some generic cg code around
  662. + tfputype added
  663. * ...
  664. Revision 1.15.2.2 2003/09/01 21:02:55 peter
  665. * sparc updates for new tregister
  666. Revision 1.15.2.1 2003/08/27 20:23:55 peter
  667. * remove old ra code
  668. Revision 1.15 2003/07/08 21:24:59 peter
  669. * sparc fixes
  670. Revision 1.14 2003/07/06 17:44:12 peter
  671. * cleanup and first sparc implementation
  672. Revision 1.13 2003/06/12 16:43:07 peter
  673. * newra compiles for sparc
  674. Revision 1.12 2003/06/10 20:46:17 mazen
  675. * fixing a general compile problem related to
  676. cg.g_overflowcheck declaration that has
  677. changed
  678. Revision 1.11 2003/06/01 21:38:06 peter
  679. * getregisterfpu size parameter added
  680. * op_const_reg size parameter added
  681. * sparc updates
  682. Revision 1.10 2003/05/23 14:27:35 peter
  683. * remove some unit dependencies
  684. * current_procinfo changes to store more info
  685. Revision 1.9 2003/04/30 22:15:59 florian
  686. * some 64 bit adaptions in ncgadd
  687. * x86-64 now uses ncgadd
  688. * tparamanager.ret_in_acc doesn't return true anymore for a void-def
  689. Revision 1.8 2003/04/23 20:16:04 peter
  690. + added currency support based on int64
  691. + is_64bit for use in cg units instead of is_64bitint
  692. * removed cgmessage from n386add, replace with internalerrors
  693. Revision 1.7 2003/04/22 23:50:22 peter
  694. * firstpass uses expectloc
  695. * checks if there are differences between the expectloc and
  696. location.loc from secondpass in EXTDEBUG
  697. Revision 1.6 2003/02/19 22:00:14 daniel
  698. * Code generator converted to new register notation
  699. - Horribily outdated todo.txt removed
  700. Revision 1.5 2003/02/02 19:25:54 carl
  701. * Several bugfixes for m68k target (register alloc., opcode emission)
  702. + VIS target
  703. + Generic add more complete (still not verified)
  704. Revision 1.4 2003/01/08 18:43:56 daniel
  705. * Tregister changed into a record
  706. Revision 1.3 2002/12/14 15:02:03 carl
  707. * maxoperands -> max_operands (for portability in rautils.pas)
  708. * fix some range-check errors with loadconst
  709. + add ncgadd unit to m68k
  710. * some bugfix of a_param_reg with LOC_CREFERENCE
  711. Revision 1.2 2002/12/08 15:02:17 carl
  712. + more fixes
  713. Revision 1.1 2002/12/07 19:51:35 carl
  714. + first version (uncompilable!)
  715. }