123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- {
- $Id$
- Copyright (c) 1998-2000 by Florian Klaempfl and Peter Vreman
- Contains the basic declarations for the x86-64 architecture
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- ****************************************************************************
- }
- { This include file contains the basic declarations for the x86-64 architecture.
- }
- {*****************************************************************************
- Operand Sizes
- *****************************************************************************}
- type
- topsize = (S_NO,
- S_B,S_W,S_L,S_Q,S_BW,S_BL,S_WL,S_BQ,S_WQ,S_LQ,
- S_IS,S_IL,S_IQ,
- S_FS,S_FL,S_FX,S_FV,S_FXX,
- S_MD,
- S_NEAR,S_FAR,S_SHORT,
- S_T
- );
- {*****************************************************************************
- Registers
- *****************************************************************************}
- const
- { Standard opcode string table (for each tasmop enumeration). The
- opcode strings should conform to the names as defined by the
- processor manufacturer.
- }
- std_op2str:op2strtable={$i x8664int.inc}
- {*****************************************************************************
- Constants
- *****************************************************************************}
- const
- c_countusableregsint = 4;
- {*****************************************************************************
- GDB Information
- *****************************************************************************}
- {# Register indexes for stabs information, when some
- parameters or variables are stored in registers.
- Taken from i386.c (dbx_register_map) and i386.h
- (FIXED_REGISTERS) from GCC 3.x source code
- }
- stab_regindex : array[tregisterindex] of shortint = (
- {$i r8664stab.inc}
- );
- {*****************************************************************************
- Default generic sizes
- *****************************************************************************}
- { Defines the default address size for a processor, }
- OS_ADDR = OS_64;
- { the natural int size for a processor, }
- OS_INT = OS_64;
- { the maximum float size for a processor, }
- OS_FLOAT = OS_F80;
- { the size of a vector register for a processor }
- OS_VECTOR = OS_M64;
- {*****************************************************************************
- Generic Register names
- *****************************************************************************}
- {# Stack pointer register }
- RS_STACK_POINTER_REG = RS_RSP;
- NR_STACK_POINTER_REG = NR_RSP;
- {# Frame pointer register }
- RS_FRAME_POINTER_REG = RS_RBP;
- NR_FRAME_POINTER_REG = NR_RBP;
- { Return address for DWARF }
- NR_RETURN_ADDRESS_REG = NR_EIP;
- { Register for addressing absolute data in a position independant way,
- such as in PIC code. The exact meaning is ABI specific. For
- further information look at GCC source : PIC_OFFSET_TABLE_REGNUM
- }
- NR_PIC_OFFSET_REG = NR_RBX;
- { Results are returned in this register (both 32 and 64 bits }
- NR_FUNCTION_RETURN_REG = NR_RAX;
- RS_FUNCTION_RETURN_REG = RS_RAX;
- { The value returned from a function is available in this register }
- NR_FUNCTION_RESULT_REG = NR_FUNCTION_RETURN_REG;
- RS_FUNCTION_RESULT_REG = RS_FUNCTION_RETURN_REG;
- { WARNING: don't change to R_ST0!! See comments above implementation of }
- { a_loadfpu* methods in rgcpu (JM) }
- NR_FPU_RESULT_REG = NR_ST;
- NR_MM_RESULT_REG = NR_XMM0;
- { Offset where the parent framepointer is pushed }
- PARENT_FRAMEPOINTER_OFFSET = 16;
- {*****************************************************************************
- GCC /ABI linking information
- *****************************************************************************}
- const
- { Registers which must be saved when calling a routine declared as
- cppdecl, cdecl, stdcall, safecall, palmossyscall. The registers
- saved should be the ones as defined in the target ABI and / or GCC.
- This value can be deduced from the CALLED_USED_REGISTERS array in the
- GCC source.
- }
- saved_standard_registers : array[0..4] of tsuperregister = (RS_EBX,RS_R12,RS_R13,RS_R14,RS_R15);
- { Registers which must be saved when calling a routine declared as
- cppdecl, cdecl, stdcall, safecall, palmossyscall. The registers
- saved should be the ones as defined in the target ABI and / or GCC.
- This value can be deduced from the CALLED_USED_REGISTERS array in the
- GCC source.
- }
- saved_xmm_registers : array[0..4] of tsuperregister = (RS_EBX,RS_R12,RS_R13,RS_R14,RS_R15);
- { Required parameter alignment when calling a routine declared as
- stdcall and cdecl. The alignment value should be the one defined
- by GCC or the target ABI.
- The value of this constant is equal to the constant
- PARM_BOUNDARY / BITS_PER_UNIT in the GCC source.
- }
- std_param_align = 8;
- {
- $Log$
- Revision 1.16 2004-12-12 12:56:18 peter
- * compile fixes for x86_64
- Revision 1.15 2004/06/20 08:55:32 florian
- * logs truncated
- Revision 1.14 2004/06/16 20:07:11 florian
- * dwarf branch merged
- Revision 1.13.2.3 2004/05/02 19:08:01 florian
- * rewrote tcgcallnode.handle_return_value
- Revision 1.13.2.2 2004/04/24 18:30:12 florian
- * extended parameters shouldn't be poped by the callee on x86-64 either
- Revision 1.13.2.1 2004/04/20 17:39:52 peter
- * return_address_reg added
- Revision 1.13 2004/02/09 22:14:17 peter
- * more x86_64 parameter fixes
- * tparalocation.lochigh is now used to indicate if registerhigh
- is used and what the type is
- }
|