2001-09-21 14:15:15 +02:00
|
|
|
/* Target-dependent code for GDB, the GNU debugger.
|
|
|
|
Copyright 2001
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
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., 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
|
|
|
|
#ifndef I386_TDEP_H
|
|
|
|
#define I386_TDEP_H
|
|
|
|
|
|
|
|
#define FPU_REG_RAW_SIZE 10
|
|
|
|
|
2001-11-08 19:32:08 +01:00
|
|
|
#if !defined (XMM0_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define XMM0_REGNUM FIRST_XMM_REGNUM
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
|
|
|
#if !defined (FIRST_FPU_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define FIRST_FPU_REGNUM FP0_REGNUM
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
|
|
|
#if !defined (LAST_FPU_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define LAST_FPU_REGNUM (gdbarch_tdep (current_gdbarch)->last_fpu_regnum)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
|
|
|
#if !defined (FIRST_XMM_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define FIRST_XMM_REGNUM (gdbarch_tdep (current_gdbarch)->first_xmm_regnum)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
|
|
|
#if !defined (LAST_XMM_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define LAST_XMM_REGNUM (gdbarch_tdep (current_gdbarch)->last_xmm_regnum)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
|
|
|
#if !defined (MXCSR_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define MXCSR_REGNUM (gdbarch_tdep (current_gdbarch)->mxcsr_regnum)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
|
|
|
#if !defined (FIRST_FPU_CTRL_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define FIRST_FPU_CTRL_REGNUM (gdbarch_tdep (current_gdbarch)->first_fpu_ctrl_regnum)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
|
|
|
#if !defined (LAST_FPU_CTRL_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define LAST_FPU_CTRL_REGNUM (FIRST_FPU_CTRL_REGNUM + 7)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
2001-09-21 14:15:15 +02:00
|
|
|
|
|
|
|
/* All of these control registers (except for FCOFF and FDOFF) are
|
|
|
|
sixteen bits long (at most) in the FPU, but are zero-extended to
|
|
|
|
thirty-two bits in GDB's register file. This makes it easier to
|
|
|
|
compute the size of the control register file, and somewhat easier
|
|
|
|
to convert to and from the FSAVE instruction's 32-bit format. */
|
|
|
|
/* FPU control word. */
|
2001-11-08 19:32:08 +01:00
|
|
|
#if !defined (FCTRL_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define FCTRL_REGNUM (FIRST_FPU_CTRL_REGNUM)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
2001-09-21 14:15:15 +02:00
|
|
|
/* FPU status word. */
|
2001-11-08 19:32:08 +01:00
|
|
|
#if !defined (FSTAT_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define FSTAT_REGNUM (FIRST_FPU_CTRL_REGNUM + 1)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
2001-09-21 14:15:15 +02:00
|
|
|
/* FPU register tag word. */
|
2001-11-08 19:32:08 +01:00
|
|
|
#if !defined (FTAG_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define FTAG_REGNUM (FIRST_FPU_CTRL_REGNUM + 2)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
2001-09-21 14:15:15 +02:00
|
|
|
/* FPU instruction's code segment selector 16 bits, called "FPU Instruction
|
|
|
|
Pointer Selector" in the x86 manuals. */
|
2001-11-08 19:32:08 +01:00
|
|
|
#if !defined (FCS_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define FCS_REGNUM (FIRST_FPU_CTRL_REGNUM + 3)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
2001-09-21 14:15:15 +02:00
|
|
|
/* FPU instruction's offset within segment ("Fpu Code OFFset"). */
|
2001-11-08 19:32:08 +01:00
|
|
|
#if !defined (FCOFF_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define FCOFF_REGNUM (FIRST_FPU_CTRL_REGNUM + 4)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
2001-09-21 14:15:15 +02:00
|
|
|
/* FPU operand's data segment. */
|
2001-11-08 19:32:08 +01:00
|
|
|
#if !defined (FDS_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define FDS_REGNUM (FIRST_FPU_CTRL_REGNUM + 5)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
2001-09-21 14:15:15 +02:00
|
|
|
/* FPU operand's offset within segment. */
|
2001-11-08 19:32:08 +01:00
|
|
|
#if !defined (FDOFF_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define FDOFF_REGNUM (FIRST_FPU_CTRL_REGNUM + 6)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
2001-09-21 14:15:15 +02:00
|
|
|
/* FPU opcode, bottom eleven bits. */
|
2001-11-08 19:32:08 +01:00
|
|
|
#if !defined (FOP_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define FOP_REGNUM (FIRST_FPU_CTRL_REGNUM + 7)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
2001-09-21 14:15:15 +02:00
|
|
|
|
|
|
|
/* i386 architecture specific information. */
|
|
|
|
struct gdbarch_tdep
|
|
|
|
{
|
|
|
|
int last_fpu_regnum;
|
|
|
|
int first_xmm_regnum;
|
|
|
|
int last_xmm_regnum;
|
|
|
|
int mxcsr_regnum; /* Streaming SIMD Extension control/status. */
|
|
|
|
int first_fpu_ctrl_regnum;
|
|
|
|
};
|
|
|
|
|
2001-11-08 19:32:08 +01:00
|
|
|
#if !defined (IS_FP_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define IS_FP_REGNUM(n) (FIRST_FPU_REGNUM <= (n) && (n) <= LAST_FPU_REGNUM)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
|
|
|
#if !defined (IS_FPU_CTRL_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define IS_FPU_CTRL_REGNUM(n) (FIRST_FPU_CTRL_REGNUM <= (n) && (n) <= LAST_FPU_CTRL_REGNUM)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
|
|
|
#if !defined (IS_SSE_REGNUM) || (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
|
2001-09-21 14:15:15 +02:00
|
|
|
#define IS_SSE_REGNUM(n) (FIRST_XMM_REGNUM <= (n) && (n) <= LAST_XMM_REGNUM)
|
2001-11-08 19:32:08 +01:00
|
|
|
#endif
|
2001-09-21 14:15:15 +02:00
|
|
|
|
|
|
|
#endif
|