rax86_64.pas 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Carl Eric Codere and Peter Vreman
  4. Handles the common x86-64 assembler reader routines
  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 rax86_64;
  19. {$i fpcdefs.inc}
  20. interface
  21. uses
  22. aasmbase,aasmtai,aasmcpu,
  23. cpubase,rautils,cclasses;
  24. { Parser helpers }
  25. function is_prefix(t:tasmop):boolean;
  26. function is_override(t:tasmop):boolean;
  27. Function CheckPrefix(prefixop,op:tasmop): Boolean;
  28. Function CheckOverride(overrideop,op:tasmop): Boolean;
  29. Procedure FWaitWarning;
  30. type
  31. T386Operand=class(TOperand)
  32. Procedure SetCorrectSize(opcode:tasmop);override;
  33. end;
  34. T386Instruction=class(TInstruction)
  35. { Operand sizes }
  36. procedure AddReferenceSizes;
  37. procedure SetInstructionOpsize;
  38. procedure CheckOperandSizes;
  39. procedure CheckNonCommutativeOpcodes;
  40. { opcode adding }
  41. procedure ConcatInstruction(p : taasmoutput);override;
  42. end;
  43. tstr2opentry = class(Tnamedindexitem)
  44. op: TAsmOp;
  45. end;
  46. const
  47. AsmPrefixes = 6;
  48. AsmPrefix : array[0..AsmPrefixes-1] of TasmOP =(
  49. A_LOCK,A_REP,A_REPE,A_REPNE,A_REPNZ,A_REPZ
  50. );
  51. AsmOverrides = 6;
  52. AsmOverride : array[0..AsmOverrides-1] of TasmOP =(
  53. A_SEGCS,A_SEGES,A_SEGDS,A_SEGFS,A_SEGGS,A_SEGSS
  54. );
  55. CondAsmOps=3;
  56. CondAsmOp:array[0..CondAsmOps-1] of TasmOp=(
  57. A_CMOVcc, A_Jcc, A_SETcc
  58. );
  59. CondAsmOpStr:array[0..CondAsmOps-1] of string[4]=(
  60. 'CMOV','J','SET'
  61. );
  62. implementation
  63. uses
  64. globtype,globals,systems,verbose,
  65. cpuinfo,agx64att;
  66. {$define ATTOP}
  67. {$define INTELOP}
  68. {$ifdef NORA386INT}
  69. {$ifdef NOAG386NSM}
  70. {$ifdef NOAG386INT}
  71. {$undef INTELOP}
  72. {$endif}
  73. {$endif}
  74. {$endif}
  75. {$ifdef NORA386ATT}
  76. {$ifdef NOAG386ATT}
  77. {$undef ATTOP}
  78. {$endif}
  79. {$endif}
  80. {*****************************************************************************
  81. Parser Helpers
  82. *****************************************************************************}
  83. function is_prefix(t:tasmop):boolean;
  84. var
  85. i : longint;
  86. Begin
  87. is_prefix:=false;
  88. for i:=1 to AsmPrefixes do
  89. if t=AsmPrefix[i-1] then
  90. begin
  91. is_prefix:=true;
  92. exit;
  93. end;
  94. end;
  95. function is_override(t:tasmop):boolean;
  96. var
  97. i : longint;
  98. Begin
  99. is_override:=false;
  100. for i:=1 to AsmOverrides do
  101. if t=AsmOverride[i-1] then
  102. begin
  103. is_override:=true;
  104. exit;
  105. end;
  106. end;
  107. Function CheckPrefix(prefixop,op:tasmop): Boolean;
  108. { Checks if the prefix is valid with the following opcode }
  109. { return false if not, otherwise true }
  110. Begin
  111. CheckPrefix := TRUE;
  112. (* Case prefix of
  113. A_REP,A_REPNE,A_REPE:
  114. Case opcode Of
  115. A_SCASB,A_SCASW,A_SCASD,
  116. A_INS,A_OUTS,A_MOVS,A_CMPS,A_LODS,A_STOS:;
  117. Else
  118. Begin
  119. CheckPrefix := FALSE;
  120. exit;
  121. end;
  122. end; { case }
  123. A_LOCK:
  124. Case opcode Of
  125. A_BT,A_BTS,A_BTR,A_BTC,A_XCHG,A_ADD,A_OR,A_ADC,A_SBB,A_AND,A_SUB,
  126. A_XOR,A_NOT,A_NEG,A_INC,A_DEC:;
  127. Else
  128. Begin
  129. CheckPrefix := FALSE;
  130. Exit;
  131. end;
  132. end; { case }
  133. A_NONE: exit; { no prefix here }
  134. else
  135. CheckPrefix := FALSE;
  136. end; { end case } *)
  137. end;
  138. Function CheckOverride(overrideop,op:tasmop): Boolean;
  139. { Check if the override is valid, and if so then }
  140. { update the instr variable accordingly. }
  141. Begin
  142. CheckOverride := true;
  143. { Case instr.getinstruction of
  144. A_MOVS,A_XLAT,A_CMPS:
  145. Begin
  146. CheckOverride := TRUE;
  147. Message(assem_e_segment_override_not_supported);
  148. end
  149. end }
  150. end;
  151. Procedure FWaitWarning;
  152. begin
  153. if (target_info.target=target_i386_GO32V2) and (cs_fp_emulation in aktmoduleswitches) then
  154. Message(asmr_w_fwait_emu_prob);
  155. end;
  156. {*****************************************************************************
  157. T386Operand
  158. *****************************************************************************}
  159. Procedure T386Operand.SetCorrectSize(opcode:tasmop);
  160. begin
  161. if att_needsuffix[opcode]=attsufFPU then
  162. begin
  163. case size of
  164. S_L : size:=S_FS;
  165. S_IQ : size:=S_FL;
  166. end;
  167. end
  168. else if att_needsuffix[opcode]=attsufFPUint then
  169. begin
  170. case size of
  171. S_W : size:=S_IS;
  172. S_L : size:=S_IL;
  173. end;
  174. end;
  175. end;
  176. {*****************************************************************************
  177. T386Instruction
  178. *****************************************************************************}
  179. procedure T386Instruction.AddReferenceSizes;
  180. { this will add the sizes for references like [esi] which do not
  181. have the size set yet, it will take only the size if the other
  182. operand is a register }
  183. var
  184. operand2,i : longint;
  185. s : tasmsymbol;
  186. so : longint;
  187. begin
  188. for i:=1to ops do
  189. begin
  190. operands[i].SetCorrectSize(opcode);
  191. if (operands[i].size=S_NO) then
  192. begin
  193. case operands[i].Opr.Typ of
  194. OPR_REFERENCE :
  195. begin
  196. if i=2 then
  197. operand2:=1
  198. else
  199. operand2:=2;
  200. if operand2<ops then
  201. begin
  202. { Only allow register as operand to take the size from }
  203. if operands[operand2].opr.typ=OPR_REGISTER then
  204. begin
  205. if ((opcode<>A_MOVD) and
  206. (opcode<>A_CVTSI2SS)) then
  207. operands[i].size:=operands[operand2].size;
  208. end
  209. else
  210. begin
  211. { if no register then take the opsize (which is available with ATT),
  212. if not availble then give an error }
  213. if opsize<>S_NO then
  214. operands[i].size:=opsize
  215. else
  216. begin
  217. Message(asmr_e_unable_to_determine_reference_size);
  218. { recovery }
  219. operands[i].size:=S_L;
  220. end;
  221. end;
  222. end
  223. else
  224. begin
  225. if opsize<>S_NO then
  226. operands[i].size:=opsize
  227. end;
  228. end;
  229. OPR_SYMBOL :
  230. begin
  231. { Fix lea which need a reference }
  232. if opcode=A_LEA then
  233. begin
  234. s:=operands[i].opr.symbol;
  235. so:=operands[i].opr.symofs;
  236. operands[i].opr.typ:=OPR_REFERENCE;
  237. Fillchar(operands[i].opr.ref,sizeof(treference),0);
  238. operands[i].opr.ref.symbol:=s;
  239. operands[i].opr.ref.offset:=so;
  240. end;
  241. operands[i].size:=S_L;
  242. end;
  243. end;
  244. end;
  245. end;
  246. end;
  247. procedure T386Instruction.SetInstructionOpsize;
  248. begin
  249. if opsize<>S_NO then
  250. exit;
  251. case ops of
  252. 0 : ;
  253. 1 :
  254. { "push es" must be stored as a long PM }
  255. if ((opcode=A_PUSH) or
  256. (opcode=A_POP)) and
  257. (operands[1].opr.typ=OPR_REGISTER) and
  258. ((operands[1].opr.reg>=firstsreg) and
  259. (operands[1].opr.reg<=lastsreg)) then
  260. opsize:=S_L
  261. else
  262. opsize:=operands[1].size;
  263. 2 :
  264. begin
  265. case opcode of
  266. A_MOVZX,A_MOVSX :
  267. begin
  268. case operands[1].size of
  269. S_W :
  270. case operands[2].size of
  271. S_L :
  272. opsize:=S_WL;
  273. end;
  274. S_B :
  275. case operands[2].size of
  276. S_W :
  277. opsize:=S_BW;
  278. S_L :
  279. opsize:=S_BL;
  280. end;
  281. end;
  282. end;
  283. A_MOVD : { movd is a move from a mmx register to a
  284. 32 bit register or memory, so no opsize is correct here PM }
  285. exit;
  286. A_OUT :
  287. opsize:=operands[1].size;
  288. else
  289. opsize:=operands[2].size;
  290. end;
  291. end;
  292. 3 :
  293. opsize:=operands[3].size;
  294. end;
  295. end;
  296. procedure T386Instruction.CheckOperandSizes;
  297. var
  298. sizeerr : boolean;
  299. i : longint;
  300. begin
  301. { Check only the most common opcodes here, the others are done in
  302. the assembler pass }
  303. case opcode of
  304. A_PUSH,A_POP,A_DEC,A_INC,A_NOT,A_NEG,
  305. A_CMP,A_MOV,
  306. A_ADD,A_SUB,A_ADC,A_SBB,
  307. A_AND,A_OR,A_TEST,A_XOR: ;
  308. else
  309. exit;
  310. end;
  311. { Handle the BW,BL,WL separatly }
  312. sizeerr:=false;
  313. { special push/pop selector case }
  314. if ((opcode=A_PUSH) or
  315. (opcode=A_POP)) and
  316. (operands[1].opr.typ=OPR_REGISTER) and
  317. ((operands[1].opr.reg>=firstsreg) and
  318. (operands[1].opr.reg<=lastsreg)) then
  319. exit;
  320. if opsize in [S_BW,S_BL,S_WL] then
  321. begin
  322. if ops<>2 then
  323. sizeerr:=true
  324. else
  325. begin
  326. case opsize of
  327. S_BW :
  328. sizeerr:=(operands[1].size<>S_B) or (operands[2].size<>S_W);
  329. S_BL :
  330. sizeerr:=(operands[1].size<>S_B) or (operands[2].size<>S_L);
  331. S_WL :
  332. sizeerr:=(operands[1].size<>S_W) or (operands[2].size<>S_L);
  333. end;
  334. end;
  335. end
  336. else
  337. begin
  338. for i:=1 to ops do
  339. begin
  340. if (operands[i].opr.typ<>OPR_CONSTANT) and
  341. (operands[i].size in [S_B,S_W,S_L]) and
  342. (operands[i].size<>opsize) then
  343. sizeerr:=true;
  344. end;
  345. end;
  346. if sizeerr then
  347. begin
  348. { if range checks are on then generate an error }
  349. if (cs_compilesystem in aktmoduleswitches) or
  350. not (cs_check_range in aktlocalswitches) then
  351. Message(asmr_w_size_suffix_and_dest_dont_match)
  352. else
  353. Message(asmr_e_size_suffix_and_dest_dont_match);
  354. end;
  355. end;
  356. { This check must be done with the operand in ATT order
  357. i.e.after swapping in the intel reader
  358. but before swapping in the NASM and TASM writers PM }
  359. procedure T386Instruction.CheckNonCommutativeOpcodes;
  360. begin
  361. if ((ops=2) and
  362. (operands[1].opr.typ=OPR_REGISTER) and
  363. (operands[2].opr.typ=OPR_REGISTER) and
  364. { if the first is ST and the second is also a register
  365. it is necessarily ST1 .. ST7 }
  366. (operands[1].opr.reg=R_ST)) or
  367. (ops=0) then
  368. if opcode=A_FSUBR then
  369. opcode:=A_FSUB
  370. else if opcode=A_FSUB then
  371. opcode:=A_FSUBR
  372. else if opcode=A_FDIVR then
  373. opcode:=A_FDIV
  374. else if opcode=A_FDIV then
  375. opcode:=A_FDIVR
  376. else if opcode=A_FSUBRP then
  377. opcode:=A_FSUBP
  378. else if opcode=A_FSUBP then
  379. opcode:=A_FSUBRP
  380. else if opcode=A_FDIVRP then
  381. opcode:=A_FDIVP
  382. else if opcode=A_FDIVP then
  383. opcode:=A_FDIVRP;
  384. if ((ops=1) and
  385. (operands[1].opr.typ=OPR_REGISTER) and
  386. (operands[1].opr.reg in [R_ST1..R_ST7])) then
  387. if opcode=A_FSUBRP then
  388. opcode:=A_FSUBP
  389. else if opcode=A_FSUBP then
  390. opcode:=A_FSUBRP
  391. else if opcode=A_FDIVRP then
  392. opcode:=A_FDIVP
  393. else if opcode=A_FDIVP then
  394. opcode:=A_FDIVRP;
  395. end;
  396. {*****************************************************************************
  397. opcode Adding
  398. *****************************************************************************}
  399. procedure T386Instruction.ConcatInstruction(p : taasmoutput);
  400. var
  401. siz : topsize;
  402. i,asize : longint;
  403. ai : taicpu;
  404. begin
  405. { Get Opsize }
  406. if (opsize<>S_NO) or (Ops=0) then
  407. siz:=opsize
  408. else
  409. begin
  410. if (Ops=2) and (operands[1].opr.typ=OPR_REGISTER) then
  411. siz:=operands[1].size
  412. else
  413. siz:=operands[Ops].size;
  414. { MOVD should be of size S_LQ or S_QL, but these do not exist PM }
  415. if (ops=2) and (operands[1].size<>S_NO) and
  416. (operands[2].size<>S_NO) and (operands[1].size<>operands[2].size) then
  417. siz:=S_NO;
  418. end;
  419. if ((opcode=A_MOVD)or
  420. (opcode=A_CVTSI2SS)) and
  421. ((operands[1].size=S_NO) or
  422. (operands[2].size=S_NO)) then
  423. siz:=S_NO;
  424. { NASM does not support FADD without args
  425. as alias of FADDP
  426. and GNU AS interprets FADD without operand differently
  427. for version 2.9.1 and 2.9.5 !! }
  428. if (ops=0) and
  429. ((opcode=A_FADD) or
  430. (opcode=A_FMUL) or
  431. (opcode=A_FSUB) or
  432. (opcode=A_FSUBR) or
  433. (opcode=A_FDIV) or
  434. (opcode=A_FDIVR)) then
  435. begin
  436. if opcode=A_FADD then
  437. opcode:=A_FADDP
  438. else if opcode=A_FMUL then
  439. opcode:=A_FMULP
  440. else if opcode=A_FSUB then
  441. opcode:=A_FSUBP
  442. else if opcode=A_FSUBR then
  443. opcode:=A_FSUBRP
  444. else if opcode=A_FDIV then
  445. opcode:=A_FDIVP
  446. else if opcode=A_FDIVR then
  447. opcode:=A_FDIVRP;
  448. {$ifdef ATTOP}
  449. message1(asmr_w_fadd_to_faddp,att_op2str[opcode]);
  450. {$else}
  451. {$ifdef INTELOP}
  452. message1(asmr_w_fadd_to_faddp,std_op2str[opcode]);
  453. {$else}
  454. message1(asmr_w_fadd_to_faddp,'fXX');
  455. {$endif INTELOP}
  456. {$endif ATTOP}
  457. end;
  458. { GNU AS interprets FDIV without operand differently
  459. for version 2.9.1 and 2.10
  460. we add explicit args to it !! }
  461. if (ops=0) and
  462. ((opcode=A_FSUBP) or
  463. (opcode=A_FSUBRP) or
  464. (opcode=A_FDIVP) or
  465. (opcode=A_FDIVRP) or
  466. (opcode=A_FSUB) or
  467. (opcode=A_FSUBR) or
  468. (opcode=A_FDIV) or
  469. (opcode=A_FDIVR)) then
  470. begin
  471. {$ifdef ATTOP}
  472. message1(asmr_w_adding_explicit_args_fXX,att_op2str[opcode]);
  473. {$else}
  474. {$ifdef INTELOP}
  475. message1(asmr_w_adding_explicit_args_fXX,att_op2str[opcode]);
  476. {$else}
  477. message1(asmr_w_adding_explicit_args_fXX,'fXX');
  478. {$endif INTELOP}
  479. {$endif ATTOP}
  480. ops:=2;
  481. operands[1].opr.typ:=OPR_REGISTER;
  482. operands[2].opr.typ:=OPR_REGISTER;
  483. operands[1].opr.reg:=R_ST;
  484. operands[2].opr.reg:=R_ST1;
  485. end;
  486. if (ops=1) and
  487. ((operands[1].opr.typ=OPR_REGISTER) and
  488. (operands[1].opr.reg in [R_ST1..R_ST7])) and
  489. ((opcode=A_FSUBP) or
  490. (opcode=A_FSUBRP) or
  491. (opcode=A_FDIVP) or
  492. (opcode=A_FDIVRP) or
  493. (opcode=A_FADDP) or
  494. (opcode=A_FMULP)) then
  495. begin
  496. {$ifdef ATTOP}
  497. message1(asmr_w_adding_explicit_first_arg_fXX,att_op2str[opcode]);
  498. {$else}
  499. {$ifdef INTELOP}
  500. message1(asmr_w_adding_explicit_first_arg_fXX,std_op2str[opcode]);
  501. {$else}
  502. message1(asmr_w_adding_explicit_first_arg_fXX,'fXX');
  503. {$endif INTELOP}
  504. {$endif ATTOP}
  505. ops:=2;
  506. operands[2].opr.typ:=OPR_REGISTER;
  507. operands[2].opr.reg:=operands[1].opr.reg;
  508. operands[1].opr.reg:=R_ST;
  509. end;
  510. if (ops=1) and
  511. ((operands[1].opr.typ=OPR_REGISTER) and
  512. (operands[1].opr.reg in [R_ST1..R_ST7])) and
  513. ((opcode=A_FSUB) or
  514. (opcode=A_FSUBR) or
  515. (opcode=A_FDIV) or
  516. (opcode=A_FDIVR) or
  517. (opcode=A_FADD) or
  518. (opcode=A_FMUL)) then
  519. begin
  520. {$ifdef ATTOP}
  521. message1(asmr_w_adding_explicit_second_arg_fXX,att_op2str[opcode]);
  522. {$else}
  523. {$ifdef INTELOP}
  524. message1(asmr_w_adding_explicit_second_arg_fXX,std_op2str[opcode]);
  525. {$else}
  526. message1(asmr_w_adding_explicit_second_arg_fXX,'fXX');
  527. {$endif INTELOP}
  528. {$endif ATTOP}
  529. ops:=2;
  530. operands[2].opr.typ:=OPR_REGISTER;
  531. operands[2].opr.reg:=R_ST;
  532. end;
  533. { I tried to convince Linus Torwald to add
  534. code to support ENTER instruction
  535. (when raising a stack page fault)
  536. but he replied that ENTER is a bad instruction and
  537. Linux does not need to support it
  538. So I think its at least a good idea to add a warning
  539. if someone uses this in assembler code
  540. FPC itself does not use it at all PM }
  541. if (opcode=A_ENTER) and ((target_info.target=target_i386_linux) or
  542. (target_info.target=target_i386_FreeBSD)) then
  543. begin
  544. message(asmr_w_enter_not_supported_by_linux);
  545. end;
  546. ai:=taicpu.op_none(opcode,siz);
  547. ai.Ops:=Ops;
  548. for i:=1to Ops do
  549. begin
  550. case operands[i].opr.typ of
  551. OPR_CONSTANT :
  552. ai.loadconst(i-1,aword(operands[i].opr.val));
  553. OPR_REGISTER:
  554. ai.loadreg(i-1,operands[i].opr.reg);
  555. OPR_SYMBOL:
  556. ai.loadsymbol(i-1,operands[i].opr.symbol,operands[i].opr.symofs);
  557. OPR_REFERENCE:
  558. begin
  559. ai.loadref(i-1,operands[i].opr.ref);
  560. if operands[i].size<>S_NO then
  561. begin
  562. asize:=0;
  563. case operands[i].size of
  564. S_B :
  565. asize:=OT_BITS8;
  566. S_W, S_IS :
  567. asize:=OT_BITS16;
  568. S_L, S_IL, S_FS:
  569. asize:=OT_BITS32;
  570. S_Q, S_D, S_FL, S_FV :
  571. asize:=OT_BITS64;
  572. S_FX :
  573. asize:=OT_BITS80;
  574. end;
  575. if asize<>0 then
  576. ai.oper[i-1].ot:=(ai.oper[i-1].ot and not OT_SIZE_MASK) or asize;
  577. end;
  578. end;
  579. end;
  580. end;
  581. if (opcode=A_CALL) and (opsize=S_FAR) then
  582. opcode:=A_LCALL;
  583. if (opcode=A_JMP) and (opsize=S_FAR) then
  584. opcode:=A_LJMP;
  585. if (opcode=A_LCALL) or (opcode=A_LJMP) then
  586. opsize:=S_FAR;
  587. { Condition ? }
  588. if condition<>C_None then
  589. ai.SetCondition(condition);
  590. { Concat the opcode or give an error }
  591. if assigned(ai) then
  592. begin
  593. { Check the instruction if it's valid }
  594. {$ifndef NOAG386BIN}
  595. ai.CheckIfValid;
  596. {$endif NOAG386BIN}
  597. p.concat(ai);
  598. end
  599. else
  600. Message(asmr_e_invalid_opcode_and_operand);
  601. end;
  602. end.
  603. {
  604. $Log$
  605. Revision 1.1 2002-07-24 22:38:15 florian
  606. + initial release of x86-64 target code
  607. Revision 1.22 2002/07/01 18:46:34 peter
  608. * internal linker
  609. * reorganized aasm layer
  610. Revision 1.21 2002/05/18 13:34:25 peter
  611. * readded missing revisions
  612. Revision 1.20 2002/05/16 19:46:52 carl
  613. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  614. + try to fix temp allocation (still in ifdef)
  615. + generic constructor calls
  616. + start of tassembler / tmodulebase class cleanup
  617. Revision 1.18 2002/05/12 16:53:18 peter
  618. * moved entry and exitcode to ncgutil and cgobj
  619. * foreach gets extra argument for passing local data to the
  620. iterator function
  621. * -CR checks also class typecasts at runtime by changing them
  622. into as
  623. * fixed compiler to cycle with the -CR option
  624. * fixed stabs with elf writer, finally the global variables can
  625. be watched
  626. * removed a lot of routines from cga unit and replaced them by
  627. calls to cgobj
  628. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  629. u32bit then the other is typecasted also to u32bit without giving
  630. a rangecheck warning/error.
  631. * fixed pascal calling method with reversing also the high tree in
  632. the parast, detected by tcalcst3 test
  633. Revision 1.17 2002/04/15 19:12:09 carl
  634. + target_info.size_of_pointer -> pointer_size
  635. + some cleanup of unused types/variables
  636. * move several constants from cpubase to their specific units
  637. (where they are used)
  638. + att_Reg2str -> gas_reg2str
  639. + int_reg2str -> std_reg2str
  640. Revision 1.16 2002/04/04 19:06:13 peter
  641. * removed unused units
  642. * use tlocation.size in cg.a_*loc*() routines
  643. Revision 1.15 2002/04/02 17:11:39 peter
  644. * tlocation,treference update
  645. * LOC_CONSTANT added for better constant handling
  646. * secondadd splitted in multiple routines
  647. * location_force_reg added for loading a location to a register
  648. of a specified size
  649. * secondassignment parses now first the right and then the left node
  650. (this is compatible with Kylix). This saves a lot of push/pop especially
  651. with string operations
  652. * adapted some routines to use the new cg methods
  653. Revision 1.14 2002/01/24 18:25:53 peter
  654. * implicit result variable generation for assembler routines
  655. * removed m_tp modeswitch, use m_tp7 or not(m_fpc) instead
  656. }