39798ecdb5113cbfb0c4cd8f9cfb0df7578eb56d
[deliverable/binutils-gdb.git] / gdb / i386-tdep.h
1 /* Target-dependent code for GDB, the GNU debugger.
2 Copyright 2001
3 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
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
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
21
22 #ifndef I386_TDEP_H
23 #define I386_TDEP_H
24
25 #if !defined (FPU_REG_RAW_SIZE) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
26 #define FPU_REG_RAW_SIZE 10
27 #endif
28
29 #if !defined (XMM0_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
30 #define XMM0_REGNUM FIRST_XMM_REGNUM
31 #endif
32 #if !defined (FIRST_FPU_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
33 #define FIRST_FPU_REGNUM FP0_REGNUM
34 #endif
35 #if !defined (LAST_FPU_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
36 #define LAST_FPU_REGNUM (gdbarch_tdep (current_gdbarch)->last_fpu_regnum)
37 #endif
38 #if !defined (FIRST_XMM_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
39 #define FIRST_XMM_REGNUM (gdbarch_tdep (current_gdbarch)->first_xmm_regnum)
40 #endif
41 #if !defined (LAST_XMM_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
42 #define LAST_XMM_REGNUM (gdbarch_tdep (current_gdbarch)->last_xmm_regnum)
43 #endif
44 #if !defined (MXCSR_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
45 #define MXCSR_REGNUM (gdbarch_tdep (current_gdbarch)->mxcsr_regnum)
46 #endif
47 #if !defined (FIRST_FPU_CTRL_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
48 #define FIRST_FPU_CTRL_REGNUM (gdbarch_tdep (current_gdbarch)->first_fpu_ctrl_regnum)
49 #endif
50 #if !defined (LAST_FPU_CTRL_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
51 #define LAST_FPU_CTRL_REGNUM (FIRST_FPU_CTRL_REGNUM + 7)
52 #endif
53
54 /* All of these control registers (except for FCOFF and FDOFF) are
55 sixteen bits long (at most) in the FPU, but are zero-extended to
56 thirty-two bits in GDB's register file. This makes it easier to
57 compute the size of the control register file, and somewhat easier
58 to convert to and from the FSAVE instruction's 32-bit format. */
59 /* FPU control word. */
60 #if !defined (FCTRL_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
61 #define FCTRL_REGNUM (FIRST_FPU_CTRL_REGNUM)
62 #endif
63 /* FPU status word. */
64 #if !defined (FSTAT_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
65 #define FSTAT_REGNUM (FIRST_FPU_CTRL_REGNUM + 1)
66 #endif
67 /* FPU register tag word. */
68 #if !defined (FTAG_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
69 #define FTAG_REGNUM (FIRST_FPU_CTRL_REGNUM + 2)
70 #endif
71 /* FPU instruction's code segment selector 16 bits, called "FPU Instruction
72 Pointer Selector" in the x86 manuals. */
73 #if !defined (FCS_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
74 #define FCS_REGNUM (FIRST_FPU_CTRL_REGNUM + 3)
75 #endif
76 /* FPU instruction's offset within segment ("Fpu Code OFFset"). */
77 #if !defined (FCOFF_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
78 #define FCOFF_REGNUM (FIRST_FPU_CTRL_REGNUM + 4)
79 #endif
80 /* FPU operand's data segment. */
81 #if !defined (FDS_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
82 #define FDS_REGNUM (FIRST_FPU_CTRL_REGNUM + 5)
83 #endif
84 /* FPU operand's offset within segment. */
85 #if !defined (FDOFF_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
86 #define FDOFF_REGNUM (FIRST_FPU_CTRL_REGNUM + 6)
87 #endif
88 /* FPU opcode, bottom eleven bits. */
89 #if !defined (FOP_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
90 #define FOP_REGNUM (FIRST_FPU_CTRL_REGNUM + 7)
91 #endif
92
93 /* i386 architecture specific information. */
94 struct gdbarch_tdep
95 {
96 int last_fpu_regnum;
97 int first_xmm_regnum;
98 int last_xmm_regnum;
99 int mxcsr_regnum; /* Streaming SIMD Extension control/status. */
100 int first_fpu_ctrl_regnum;
101 };
102
103 #if !defined (IS_FP_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
104 #define IS_FP_REGNUM(n) (FIRST_FPU_REGNUM <= (n) && (n) <= LAST_FPU_REGNUM)
105 #endif
106 #if !defined (IS_FPU_CTRL_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
107 #define IS_FPU_CTRL_REGNUM(n) (FIRST_FPU_CTRL_REGNUM <= (n) && (n) <= LAST_FPU_CTRL_REGNUM)
108 #endif
109 #if !defined (IS_SSE_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
110 #define IS_SSE_REGNUM(n) (FIRST_XMM_REGNUM <= (n) && (n) <= LAST_XMM_REGNUM)
111 #endif
112
113 #endif
This page took 0.031286 seconds and 4 git commands to generate.