cpubase.inc 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. {
  2. Copyright (c) 1998-2000 by Florian Klaempfl and Peter Vreman
  3. Contains the basic declarations for the x86-64 architecture
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. { This include file contains the basic declarations for the x86-64 architecture.
  18. }
  19. {*****************************************************************************
  20. Operand Sizes
  21. *****************************************************************************}
  22. type
  23. topsize = (S_NO,
  24. S_B,S_W,S_L,S_Q,S_BW,S_BL,S_WL,S_BQ,S_WQ,S_LQ,
  25. S_IS,S_IL,S_IQ,
  26. S_FS,S_FL,S_FX,S_FV,S_FXX,
  27. S_MD,
  28. S_NEAR,S_FAR,S_SHORT,
  29. S_T,
  30. S_XMM,
  31. S_YMM
  32. );
  33. TOpSizes = set of topsize;
  34. {*****************************************************************************
  35. Registers
  36. *****************************************************************************}
  37. const
  38. { Standard opcode string table (for each tasmop enumeration). The
  39. opcode strings should conform to the names as defined by the
  40. processor manufacturer.
  41. }
  42. std_op2str:op2strtable={$i x8664int.inc}
  43. {*****************************************************************************
  44. GDB Information
  45. *****************************************************************************}
  46. {# Register indexes for stabs information, when some
  47. parameters or variables are stored in registers.
  48. Taken from i386.c (dbx_register_map) and i386.h
  49. (FIXED_REGISTERS) from GCC 3.x source code
  50. }
  51. stab_regindex : array[tregisterindex] of shortint = (
  52. {$i r8664stab.inc}
  53. );
  54. {*****************************************************************************
  55. Default generic sizes
  56. *****************************************************************************}
  57. { Defines the default address size for a processor, }
  58. OS_ADDR = OS_64;
  59. { the natural int size for a processor,
  60. has to match osuinttype/ossinttype as initialized in psystem }
  61. OS_INT = OS_64;
  62. OS_SINT = OS_S64;
  63. { the maximum float size for a processor, }
  64. OS_FLOAT = OS_F80;
  65. { the size of a vector register for a processor }
  66. OS_VECTOR = OS_M128;
  67. {*****************************************************************************
  68. Generic Register names
  69. *****************************************************************************}
  70. {# Stack pointer register }
  71. RS_STACK_POINTER_REG = RS_RSP;
  72. NR_STACK_POINTER_REG = NR_RSP;
  73. {# Frame pointer register }
  74. RS_FRAME_POINTER_REG = RS_RBP;
  75. NR_FRAME_POINTER_REG = NR_RBP;
  76. { Return address for DWARF }
  77. NR_RETURN_ADDRESS_REG = NR_EIP;
  78. { Register for addressing absolute data in a position independant way,
  79. such as in PIC code. The exact meaning is ABI specific. For
  80. further information look at GCC source : PIC_OFFSET_TABLE_REGNUM
  81. }
  82. NR_PIC_OFFSET_REG = NR_RBX;
  83. { Results are returned in this register (both 32 and 64 bits }
  84. NR_FUNCTION_RETURN_REG = NR_RAX;
  85. RS_FUNCTION_RETURN_REG = RS_RAX;
  86. NR_FUNCTION_RETURN_REG_HIGH = NR_RDX;
  87. RS_FUNCTION_RETURN_REG_HIGH = RS_RDX;
  88. { The value returned from a function is available in this register }
  89. NR_FUNCTION_RESULT_REG = NR_FUNCTION_RETURN_REG;
  90. RS_FUNCTION_RESULT_REG = RS_FUNCTION_RETURN_REG;
  91. NR_FUNCTION_RESULT_REG_HIGH = NR_FUNCTION_RETURN_REG_HIGH;
  92. RS_FUNCTION_RESULT_REG_HIGH = RS_FUNCTION_RETURN_REG_HIGH;
  93. { WARNING: don't change to R_ST0!! See comments above implementation of }
  94. { a_loadfpu* methods in rgcpu (JM) }
  95. NR_FPU_RESULT_REG = NR_ST;
  96. NR_MM_RESULT_REG = NR_XMM0;
  97. RS_MM_RESULT_REG = RS_XMM0;
  98. NR_MM_RESULT_REG_HIGH = NR_XMM1;
  99. RS_MM_RESULT_REG_HIGH = RS_XMM1;
  100. { Offset where the parent framepointer is pushed }
  101. PARENT_FRAMEPOINTER_OFFSET = 16;
  102. {*****************************************************************************
  103. GCC /ABI linking information
  104. *****************************************************************************}
  105. const
  106. { these arrays differ between unix and win64 }
  107. saved_standard_registers : array of tsuperregister = nil;
  108. saved_mm_registers : array of tsuperregister = nil;
  109. saved_address_registers : array[0..0] of tsuperregister = (RS_INVALID);
  110. { Required parameter alignment when calling a routine declared as
  111. stdcall and cdecl. The alignment value should be the one defined
  112. by GCC or the target ABI.
  113. The value of this constant is equal to the constant
  114. PARM_BOUNDARY / BITS_PER_UNIT in the GCC source.
  115. }
  116. std_param_align = 8;