cpubase.pas 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. {
  2. $Id$
  3. Copyright (c) 1998-2002 by Florian Klaempfl and Peter Vreman
  4. Contains the base types for the i386
  5. * This code was inspired by the NASM sources
  6. The Netwide Assembler is Copyright (c) 1996 Simon Tatham and
  7. Julian Hall. All rights reserved.
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2 of the License, or
  11. (at your option) any later version.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. ****************************************************************************
  20. }
  21. {# Base unit for processor information. This unit contains
  22. enumerations of registers, opcodes, sizes, and other
  23. such things which are processor specific.
  24. }
  25. unit cpubase;
  26. {$i fpcdefs.inc}
  27. interface
  28. uses
  29. cutils,cclasses,
  30. globals,
  31. cpuinfo,
  32. aasmbase,
  33. cginfo
  34. {$ifdef delphi}
  35. ,dmisc
  36. {$endif}
  37. ;
  38. {*****************************************************************************
  39. Assembler Opcodes
  40. *****************************************************************************}
  41. type
  42. TAsmOp={$i i386op.inc}
  43. {# This should define the array of instructions as string }
  44. op2strtable=array[tasmop] of string[11];
  45. Const
  46. {# First value of opcode enumeration }
  47. firstop = low(tasmop);
  48. {# Last value of opcode enumeration }
  49. lastop = high(tasmop);
  50. {*****************************************************************************
  51. Operand Sizes
  52. *****************************************************************************}
  53. type
  54. topsize = (S_NO,
  55. S_B,S_W,S_L,S_BW,S_BL,S_WL,
  56. S_IS,S_IL,S_IQ,
  57. S_FS,S_FL,S_FX,S_D,S_Q,S_FV,S_FXX,
  58. S_NEAR,S_FAR,S_SHORT
  59. );
  60. {*****************************************************************************
  61. Registers
  62. *****************************************************************************}
  63. type
  64. {# Enumeration for all possible registers for cpu. It
  65. is to note that all registers of the same type
  66. (for example all FPU registers), should be grouped
  67. together.
  68. }
  69. { don't change the order }
  70. { it's used by the register size conversions }
  71. tregister = (R_NO,
  72. R_EAX,R_ECX,R_EDX,R_EBX,R_ESP,R_EBP,R_ESI,R_EDI,
  73. R_AX,R_CX,R_DX,R_BX,R_SP,R_BP,R_SI,R_DI,
  74. R_AL,R_CL,R_DL,R_BL,R_AH,R_CH,R_BH,R_DH,
  75. R_CS,R_DS,R_ES,R_SS,R_FS,R_GS,
  76. R_ST,R_ST0,R_ST1,R_ST2,R_ST3,R_ST4,R_ST5,R_ST6,R_ST7,
  77. R_DR0,R_DR1,R_DR2,R_DR3,R_DR6,R_DR7,
  78. R_CR0,R_CR2,R_CR3,R_CR4,
  79. R_TR3,R_TR4,R_TR5,R_TR6,R_TR7,
  80. R_MM0,R_MM1,R_MM2,R_MM3,R_MM4,R_MM5,R_MM6,R_MM7,
  81. R_XMM0,R_XMM1,R_XMM2,R_XMM3,R_XMM4,R_XMM5,R_XMM6,R_XMM7
  82. );
  83. { A type to store register locations for 64 Bit values. }
  84. tregister64 = packed record
  85. reglo,reghi : tregister;
  86. end;
  87. { alias for compact code }
  88. treg64 = tregister64;
  89. {# Set type definition for registers }
  90. tregisterset = set of tregister;
  91. {# Type definition for the array of string of register names }
  92. reg2strtable = array[tregister] of string[6];
  93. const
  94. {# First register in the tregister enumeration }
  95. firstreg = low(tregister);
  96. {# Last register in the tregister enumeration }
  97. lastreg = high(tregister);
  98. firstsreg = R_CS;
  99. lastsreg = R_GS;
  100. regset8bit : tregisterset = [R_AL..R_DH];
  101. regset16bit : tregisterset = [R_AX..R_DI,R_CS..R_SS];
  102. regset32bit : tregisterset = [R_EAX..R_EDI];
  103. { Convert reg to opsize }
  104. reg2opsize : array[firstreg..lastreg] of topsize = (S_NO,
  105. S_L,S_L,S_L,S_L,S_L,S_L,S_L,S_L,
  106. S_W,S_W,S_W,S_W,S_W,S_W,S_W,S_W,
  107. S_B,S_B,S_B,S_B,S_B,S_B,S_B,S_B,
  108. S_W,S_W,S_W,S_W,S_W,S_W,
  109. S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,
  110. S_L,S_L,S_L,S_L,S_L,S_L,
  111. S_L,S_L,S_L,S_L,
  112. S_L,S_L,S_L,S_L,S_L,
  113. S_D,S_D,S_D,S_D,S_D,S_D,S_D,S_D,
  114. S_D,S_D,S_D,S_D,S_D,S_D,S_D,S_D
  115. );
  116. {# Standard opcode string table (for each tasmop enumeration). The
  117. opcode strings should conform to the names as defined by the
  118. processor manufacturer.
  119. }
  120. std_op2str:op2strtable={$i i386int.inc}
  121. {# Standard register table (for each tregister enumeration). The
  122. register strings should conform to the the names as defined
  123. by the processor manufacturer
  124. }
  125. std_reg2str : reg2strtable = ('',
  126. 'eax','ecx','edx','ebx','esp','ebp','esi','edi',
  127. 'ax','cx','dx','bx','sp','bp','si','di',
  128. 'al','cl','dl','bl','ah','ch','bh','dh',
  129. 'cs','ds','es','ss','fs','gs',
  130. 'st','st(0)','st(1)','st(2)','st(3)','st(4)','st(5)','st(6)','st(7)',
  131. 'dr0','dr1','dr2','dr3','dr6','dr7',
  132. 'cr0','cr2','cr3','cr4',
  133. 'tr3','tr4','tr5','tr6','tr7',
  134. 'mm0','mm1','mm2','mm3','mm4','mm5','mm6','mm7',
  135. 'xmm0','xmm1','xmm2','xmm3','xmm4','xmm5','xmm6','xmm7'
  136. );
  137. {*****************************************************************************
  138. Conditions
  139. *****************************************************************************}
  140. type
  141. TAsmCond=(C_None,
  142. C_A,C_AE,C_B,C_BE,C_C,C_E,C_G,C_GE,C_L,C_LE,C_NA,C_NAE,
  143. C_NB,C_NBE,C_NC,C_NE,C_NG,C_NGE,C_NL,C_NLE,C_NO,C_NP,
  144. C_NS,C_NZ,C_O,C_P,C_PE,C_PO,C_S,C_Z
  145. );
  146. const
  147. cond2str:array[TAsmCond] of string[3]=('',
  148. 'a','ae','b','be','c','e','g','ge','l','le','na','nae',
  149. 'nb','nbe','nc','ne','ng','nge','nl','nle','no','np',
  150. 'ns','nz','o','p','pe','po','s','z'
  151. );
  152. inverse_cond:array[TAsmCond] of TAsmCond=(C_None,
  153. C_NA,C_NAE,C_NB,C_NBE,C_NC,C_NE,C_NG,C_NGE,C_NL,C_NLE,C_A,C_AE,
  154. C_B,C_BE,C_C,C_E,C_G,C_GE,C_L,C_LE,C_O,C_P,
  155. C_S,C_Z,C_NO,C_NP,C_NP,C_P,C_NS,C_NZ
  156. );
  157. {*****************************************************************************
  158. Flags
  159. *****************************************************************************}
  160. type
  161. TResFlags = (F_E,F_NE,F_G,F_L,F_GE,F_LE,F_C,F_NC,F_A,F_AE,F_B,F_BE);
  162. {*****************************************************************************
  163. Reference
  164. *****************************************************************************}
  165. type
  166. trefoptions=(ref_none,ref_parafixup,ref_localfixup,ref_selffixup);
  167. { reference record }
  168. preference = ^treference;
  169. treference = packed record
  170. segment,
  171. base,
  172. index : tregister;
  173. scalefactor : byte;
  174. offset : longint;
  175. symbol : tasmsymbol;
  176. offsetfixup : longint;
  177. options : trefoptions;
  178. end;
  179. { reference record }
  180. pparareference = ^tparareference;
  181. tparareference = packed record
  182. index : tregister;
  183. offset : longint;
  184. end;
  185. {*****************************************************************************
  186. Operands
  187. *****************************************************************************}
  188. { Types of operand }
  189. toptype=(top_none,top_reg,top_ref,top_const,top_symbol);
  190. toper=record
  191. ot : longint;
  192. case typ : toptype of
  193. top_none : ();
  194. top_reg : (reg:tregister);
  195. top_ref : (ref:preference);
  196. top_const : (val:aword);
  197. top_symbol : (sym:tasmsymbol;symofs:longint);
  198. end;
  199. {*****************************************************************************
  200. Generic Location
  201. *****************************************************************************}
  202. type
  203. TLoc=(
  204. LOC_INVALID, { added for tracking problems}
  205. LOC_CONSTANT, { constant value }
  206. LOC_JUMP, { boolean results only, jump to false or true label }
  207. LOC_FLAGS, { boolean results only, flags are set }
  208. LOC_CREFERENCE, { in memory constant value reference (cannot change) }
  209. LOC_REFERENCE, { in memory value }
  210. LOC_REGISTER, { in a processor register }
  211. LOC_CREGISTER, { Constant register which shouldn't be modified }
  212. LOC_FPUREGISTER, { FPU stack }
  213. LOC_CFPUREGISTER, { if it is a FPU register variable on the fpu stack }
  214. LOC_MMXREGISTER, { MMX register }
  215. LOC_CMMXREGISTER, { MMX register variable }
  216. LOC_SSEREGISTER,
  217. LOC_CSSEREGISTER
  218. );
  219. { tparamlocation describes where a parameter for a procedure is stored.
  220. References are given from the caller's point of view. The usual
  221. TLocation isn't used, because contains a lot of unnessary fields.
  222. }
  223. tparalocation = packed record
  224. size : TCGSize;
  225. loc : TLoc;
  226. sp_fixup : longint;
  227. case TLoc of
  228. LOC_REFERENCE : (reference : tparareference);
  229. { segment in reference at the same place as in loc_register }
  230. LOC_REGISTER,LOC_CREGISTER : (
  231. case longint of
  232. 1 : (register,registerhigh : tregister);
  233. { overlay a registerlow }
  234. 2 : (registerlow : tregister);
  235. { overlay a 64 Bit register type }
  236. 3 : (reg64 : tregister64);
  237. 4 : (register64 : tregister64);
  238. );
  239. { it's only for better handling }
  240. LOC_MMXREGISTER,LOC_CMMXREGISTER : (mmxreg : tregister);
  241. end;
  242. tlocation = packed record
  243. loc : TLoc;
  244. size : TCGSize;
  245. case TLoc of
  246. LOC_FLAGS : (resflags : tresflags);
  247. LOC_CONSTANT : (
  248. case longint of
  249. 1 : (value : AWord);
  250. { can't do this, this layout depends on the host cpu. Use }
  251. { lo(valueqword)/hi(valueqword) instead (JM) }
  252. { 2 : (valuelow, valuehigh:AWord); }
  253. { overlay a complete 64 Bit value }
  254. 3 : (valueqword : qword);
  255. );
  256. LOC_CREFERENCE,
  257. LOC_REFERENCE : (reference : treference);
  258. { segment in reference at the same place as in loc_register }
  259. LOC_REGISTER,LOC_CREGISTER : (
  260. case longint of
  261. 1 : (register,registerhigh,segment : tregister);
  262. { overlay a registerlow }
  263. 2 : (registerlow : tregister);
  264. { overlay a 64 Bit register type }
  265. 3 : (reg64 : tregister64);
  266. 4 : (register64 : tregister64);
  267. );
  268. { it's only for better handling }
  269. LOC_MMXREGISTER,LOC_CMMXREGISTER : (mmxreg : tregister);
  270. end;
  271. {*****************************************************************************
  272. Constants
  273. *****************************************************************************}
  274. const
  275. { declare aliases }
  276. LOC_MMREGISTER = LOC_SSEREGISTER;
  277. LOC_CMMREGISTER = LOC_CSSEREGISTER;
  278. max_operands = 3;
  279. lvaluelocations = [LOC_REFERENCE,LOC_CFPUREGISTER,
  280. LOC_CREGISTER,LOC_MMXREGISTER,LOC_CMMXREGISTER];
  281. {# Constant defining possibly all registers which might require saving }
  282. ALL_REGISTERS = [firstreg..lastreg];
  283. general_registers = [R_EAX,R_EBX,R_ECX,R_EDX];
  284. {# low and high of the available maximum width integer general purpose }
  285. { registers }
  286. LoGPReg = R_EAX;
  287. HiGPReg = R_EDX;
  288. {# low and high of every possible width general purpose register (same as }
  289. { above on most architctures apart from the 80x86) }
  290. LoReg = R_EAX;
  291. HiReg = R_DH;
  292. {# Table of registers which can be allocated by the code generator
  293. internally, when generating the code.
  294. }
  295. { legend: }
  296. { xxxregs = set of all possibly used registers of that type in the code }
  297. { generator }
  298. { usableregsxxx = set of all 32bit components of registers that can be }
  299. { possible allocated to a regvar or using getregisterxxx (this }
  300. { excludes registers which can be only used for parameter }
  301. { passing on ABI's that define this) }
  302. { c_countusableregsxxx = amount of registers in the usableregsxxx set }
  303. maxintregs = 4;
  304. intregs = [R_EAX..R_BL];
  305. usableregsint = [R_EAX,R_EBX,R_ECX,R_EDX];
  306. c_countusableregsint = 4;
  307. maxfpuregs = 8;
  308. fpuregs = [R_ST0..R_ST7];
  309. usableregsfpu = [];
  310. c_countusableregsfpu = 0;
  311. mmregs = [R_MM0..R_MM7];
  312. usableregsmm = [R_MM0..R_MM7];
  313. c_countusableregsmm = 8;
  314. firstsaveintreg = R_EAX;
  315. lastsaveintreg = R_EBX;
  316. firstsavefpureg = R_NO;
  317. lastsavefpureg = R_NO;
  318. firstsavemmreg = R_MM0;
  319. lastsavemmreg = R_MM7;
  320. maxvarregs = 4;
  321. varregs : array[1..maxvarregs] of tregister =
  322. (R_EBX,R_EDX,R_ECX,R_EAX);
  323. maxfpuvarregs = 8;
  324. {# Registers which are defined as scratch and no need to save across
  325. routine calls or in assembler blocks.
  326. }
  327. max_scratch_regs = 1;
  328. scratch_regs : array[1..max_scratch_regs] of tregister = (R_EDI);
  329. {*****************************************************************************
  330. GDB Information
  331. *****************************************************************************}
  332. {# Register indexes for stabs information, when some
  333. parameters or variables are stored in registers.
  334. Taken from i386.c (dbx_register_map) and i386.h
  335. (FIXED_REGISTERS) from GCC 3.x source code
  336. }
  337. stab_regindex : array[tregister] of shortint =
  338. (-1,
  339. 0,1,2,3,4,5,6,7,
  340. 0,1,2,3,4,5,6,7,
  341. 0,1,2,3,0,1,2,3,
  342. -1,-1,-1,-1,-1,-1,
  343. 12,12,13,14,15,16,17,18,19,
  344. -1,-1,-1,-1,-1,-1,
  345. -1,-1,-1,-1,
  346. -1,-1,-1,-1,-1,
  347. 29,30,31,32,33,34,35,36,
  348. 21,22,23,24,25,26,27,28
  349. );
  350. {*****************************************************************************
  351. Default generic sizes
  352. *****************************************************************************}
  353. {# Defines the default address size for a processor, }
  354. OS_ADDR = OS_32;
  355. {# the natural int size for a processor, }
  356. OS_INT = OS_32;
  357. {# the maximum float size for a processor, }
  358. OS_FLOAT = OS_F80;
  359. {# the size of a vector register for a processor }
  360. OS_VECTOR = OS_M64;
  361. {*****************************************************************************
  362. Generic Register names
  363. *****************************************************************************}
  364. {# Stack pointer register }
  365. stack_pointer_reg = R_ESP;
  366. {# Frame pointer register }
  367. frame_pointer_reg = R_EBP;
  368. {# Self pointer register : contains the instance address of an
  369. object or class. }
  370. self_pointer_reg = R_ESI;
  371. {# Register for addressing absolute data in a position independant way,
  372. such as in PIC code. The exact meaning is ABI specific. For
  373. further information look at GCC source : PIC_OFFSET_TABLE_REGNUM
  374. }
  375. pic_offset_reg = R_EBX;
  376. {# Results are returned in this register (32-bit values) }
  377. accumulator = R_EAX;
  378. {the return_result_reg, is used inside the called function to store its return
  379. value when that is a scalar value otherwise a pointer to the address of the
  380. result is placed inside it}
  381. return_result_reg = accumulator;
  382. {the function_result_reg contains the function result after a call to a scalar
  383. function othewise it contains a pointer to the returned result}
  384. function_result_reg = accumulator;
  385. {# Hi-Results are returned in this register (64-bit value high register) }
  386. accumulatorhigh = R_EDX;
  387. { WARNING: don't change to R_ST0!! See comments above implementation of }
  388. { a_loadfpu* methods in rgcpu (JM) }
  389. fpu_result_reg = R_ST;
  390. mmresultreg = R_MM0;
  391. {*****************************************************************************
  392. GCC /ABI linking information
  393. *****************************************************************************}
  394. const
  395. {# Registers which must be saved when calling a routine declared as
  396. cppdecl, cdecl, stdcall, safecall, palmossyscall. The registers
  397. saved should be the ones as defined in the target ABI and / or GCC.
  398. This value can be deduced from the CALLED_USED_REGISTERS array in the
  399. GCC source.
  400. }
  401. std_saved_registers = [R_ESI,R_EDI,R_EBX];
  402. {# Required parameter alignment when calling a routine declared as
  403. stdcall and cdecl. The alignment value should be the one defined
  404. by GCC or the target ABI.
  405. The value of this constant is equal to the constant
  406. PARM_BOUNDARY / BITS_PER_UNIT in the GCC source.
  407. }
  408. std_param_align = 4;
  409. {*****************************************************************************
  410. CPU Dependent Constants
  411. *****************************************************************************}
  412. {*****************************************************************************
  413. Helpers
  414. *****************************************************************************}
  415. function is_calljmp(o:tasmop):boolean;
  416. function flags_to_cond(const f: TResFlags) : TAsmCond;
  417. implementation
  418. {*****************************************************************************
  419. Helpers
  420. *****************************************************************************}
  421. function is_calljmp(o:tasmop):boolean;
  422. begin
  423. case o of
  424. A_CALL,
  425. A_JCXZ,
  426. A_JECXZ,
  427. A_JMP,
  428. A_LOOP,
  429. A_LOOPE,
  430. A_LOOPNE,
  431. A_LOOPNZ,
  432. A_LOOPZ,
  433. A_Jcc :
  434. is_calljmp:=true;
  435. else
  436. is_calljmp:=false;
  437. end;
  438. end;
  439. function flags_to_cond(const f: TResFlags) : TAsmCond;
  440. const
  441. flags_2_cond : array[TResFlags] of TAsmCond =
  442. (C_E,C_NE,C_G,C_L,C_GE,C_LE,C_C,C_NC,C_A,C_AE,C_B,C_BE);
  443. begin
  444. result := flags_2_cond[f];
  445. end;
  446. end.
  447. {
  448. $Log$
  449. Revision 1.35 2003-01-05 13:36:53 florian
  450. * x86-64 compiles
  451. + very basic support for float128 type (x86-64 only)
  452. Revision 1.34 2002/11/17 18:26:16 mazen
  453. * fixed a compilation bug accmulator-->accumulator, in definition of return_result_reg
  454. Revision 1.33 2002/11/17 17:49:08 mazen
  455. + return_result_reg and function_result_reg are now used, in all plateforms, to pass functions result between called function and its caller. See the explanation of each one
  456. Revision 1.32 2002/10/05 12:43:29 carl
  457. * fixes for Delphi 6 compilation
  458. (warning : Some features do not work under Delphi)
  459. Revision 1.31 2002/08/14 18:41:48 jonas
  460. - remove valuelow/valuehigh fields from tlocation, because they depend
  461. on the endianess of the host operating system -> difficult to get
  462. right. Use lo/hi(location.valueqword) instead (remember to use
  463. valueqword and not value!!)
  464. Revision 1.30 2002/08/13 21:40:58 florian
  465. * more fixes for ppc calling conventions
  466. Revision 1.29 2002/08/12 15:08:41 carl
  467. + stab register indexes for powerpc (moved from gdb to cpubase)
  468. + tprocessor enumeration moved to cpuinfo
  469. + linker in target_info is now a class
  470. * many many updates for m68k (will soon start to compile)
  471. - removed some ifdef or correct them for correct cpu
  472. Revision 1.28 2002/08/06 20:55:23 florian
  473. * first part of ppc calling conventions fix
  474. Revision 1.27 2002/07/25 18:01:29 carl
  475. + FPURESULTREG -> FPU_RESULT_REG
  476. Revision 1.26 2002/07/07 09:52:33 florian
  477. * powerpc target fixed, very simple units can be compiled
  478. * some basic stuff for better callparanode handling, far from being finished
  479. Revision 1.25 2002/07/01 18:46:30 peter
  480. * internal linker
  481. * reorganized aasm layer
  482. Revision 1.24 2002/07/01 16:23:55 peter
  483. * cg64 patch
  484. * basics for currency
  485. * asnode updates for class and interface (not finished)
  486. Revision 1.23 2002/05/18 13:34:22 peter
  487. * readded missing revisions
  488. Revision 1.22 2002/05/16 19:46:50 carl
  489. + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
  490. + try to fix temp allocation (still in ifdef)
  491. + generic constructor calls
  492. + start of tassembler / tmodulebase class cleanup
  493. Revision 1.19 2002/05/12 16:53:16 peter
  494. * moved entry and exitcode to ncgutil and cgobj
  495. * foreach gets extra argument for passing local data to the
  496. iterator function
  497. * -CR checks also class typecasts at runtime by changing them
  498. into as
  499. * fixed compiler to cycle with the -CR option
  500. * fixed stabs with elf writer, finally the global variables can
  501. be watched
  502. * removed a lot of routines from cga unit and replaced them by
  503. calls to cgobj
  504. * u32bit-s32bit updates for and,or,xor nodes. When one element is
  505. u32bit then the other is typecasted also to u32bit without giving
  506. a rangecheck warning/error.
  507. * fixed pascal calling method with reversing also the high tree in
  508. the parast, detected by tcalcst3 test
  509. Revision 1.18 2002/04/21 15:31:40 carl
  510. - removed some other stuff to their units
  511. Revision 1.17 2002/04/20 21:37:07 carl
  512. + generic FPC_CHECKPOINTER
  513. + first parameter offset in stack now portable
  514. * rename some constants
  515. + move some cpu stuff to other units
  516. - remove unused constents
  517. * fix stacksize for some targets
  518. * fix generic size problems which depend now on EXTEND_SIZE constant
  519. * removing frame pointer in routines is only available for : i386,m68k and vis targets
  520. Revision 1.16 2002/04/15 19:53:54 peter
  521. * fixed conflicts between the last 2 commits
  522. Revision 1.15 2002/04/15 19:44:20 peter
  523. * fixed stackcheck that would be called recursively when a stack
  524. error was found
  525. * generic changeregsize(reg,size) for i386 register resizing
  526. * removed some more routines from cga unit
  527. * fixed returnvalue handling
  528. * fixed default stacksize of linux and go32v2, 8kb was a bit small :-)
  529. Revision 1.14 2002/04/15 19:12:09 carl
  530. + target_info.size_of_pointer -> pointer_size
  531. + some cleanup of unused types/variables
  532. * move several constants from cpubase to their specific units
  533. (where they are used)
  534. + att_Reg2str -> gas_reg2str
  535. + int_reg2str -> std_reg2str
  536. Revision 1.13 2002/04/14 16:59:41 carl
  537. + att_reg2str -> gas_reg2str
  538. Revision 1.12 2002/04/02 17:11:34 peter
  539. * tlocation,treference update
  540. * LOC_CONSTANT added for better constant handling
  541. * secondadd splitted in multiple routines
  542. * location_force_reg added for loading a location to a register
  543. of a specified size
  544. * secondassignment parses now first the right and then the left node
  545. (this is compatible with Kylix). This saves a lot of push/pop especially
  546. with string operations
  547. * adapted some routines to use the new cg methods
  548. Revision 1.11 2002/03/31 20:26:37 jonas
  549. + a_loadfpu_* and a_loadmm_* methods in tcg
  550. * register allocation is now handled by a class and is mostly processor
  551. independent (+rgobj.pas and i386/rgcpu.pas)
  552. * temp allocation is now handled by a class (+tgobj.pas, -i386\tgcpu.pas)
  553. * some small improvements and fixes to the optimizer
  554. * some register allocation fixes
  555. * some fpuvaroffset fixes in the unary minus node
  556. * push/popusedregisters is now called rg.save/restoreusedregisters and
  557. (for i386) uses temps instead of push/pop's when using -Op3 (that code is
  558. also better optimizable)
  559. * fixed and optimized register saving/restoring for new/dispose nodes
  560. * LOC_FPU locations now also require their "register" field to be set to
  561. R_ST, not R_ST0 (the latter is used for LOC_CFPUREGISTER locations only)
  562. - list field removed of the tnode class because it's not used currently
  563. and can cause hard-to-find bugs
  564. Revision 1.10 2002/03/04 19:10:12 peter
  565. * removed compiler warnings
  566. }