diff options
author | Mark Kettenis <kettenis@gnu.org> | 2003-04-19 14:30:33 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2003-04-19 14:30:33 +0000 |
commit | c86c27affba272a27c9034db9448546ed1cac296 (patch) | |
tree | 287fdc367379cf869bbe9725aac2342aaacd3521 | |
parent | f9d3c2a8add970641c8c508ab8cd71b433f8ee93 (diff) | |
download | gdb-c86c27affba272a27c9034db9448546ed1cac296.zip gdb-c86c27affba272a27c9034db9448546ed1cac296.tar.gz gdb-c86c27affba272a27c9034db9448546ed1cac296.tar.bz2 |
* i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Renamed from
mmx_regnum_to_fp_regnum. Adjust all callers.
-rw-r--r-- | gdb/ChangeLog | 3 | ||||
-rw-r--r-- | gdb/i386-tdep.c | 14 |
2 files changed, 12 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 700bdba..2caa790 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ 2003-04-19 Mark Kettenis <kettenis@gnu.org> + * i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Renamed from + mmx_regnum_to_fp_regnum. Adjust all callers. + * i386-tdep.c (i386_get_longjmp_target): Use TYPE_LENGTH(builtin_type_void_func_ptr) instead of TARGET_PTR_BIT and TARGET_CHAR_BIT. Use extract_typed_address instead of diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index dde3b25..071c132 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -1141,19 +1141,21 @@ i386_register_type (struct gdbarch *gdbarch, int regnum) } /* Map a cooked register onto a raw register or memory. For the i386, - the MMX registers need to be mapped onto floating point registers. */ + the MMX registers need to be mapped onto floating-point registers. */ static int -mmx_regnum_to_fp_regnum (struct regcache *regcache, int regnum) +i386_mmx_regnum_to_fp_regnum (struct regcache *regcache, int regnum) { int mmxi; ULONGEST fstat; int tos; int fpi; + mmxi = regnum - MM0_REGNUM; regcache_raw_read_unsigned (regcache, FSTAT_REGNUM, &fstat); tos = (fstat >> 11) & 0x7; fpi = (mmxi + tos) % 8; + return (FP0_REGNUM + fpi); } @@ -1164,9 +1166,10 @@ i386_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, if (i386_mmx_regnum_p (regnum)) { char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE); - int fpnum = mmx_regnum_to_fp_regnum (regcache, regnum); - regcache_raw_read (regcache, fpnum, mmx_buf); + int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum); + /* Extract (always little endian). */ + regcache_raw_read (regcache, fpnum, mmx_buf); memcpy (buf, mmx_buf, REGISTER_RAW_SIZE (regnum)); } else @@ -1180,7 +1183,8 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, if (i386_mmx_regnum_p (regnum)) { char *mmx_buf = alloca (MAX_REGISTER_RAW_SIZE); - int fpnum = mmx_regnum_to_fp_regnum (regcache, regnum); + int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum); + /* Read ... */ regcache_raw_read (regcache, fpnum, mmx_buf); /* ... Modify ... (always little endian). */ |