Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA/i386]: Enable default support for SSE registers
@ 2003-07-22 18:43 Kevin Buettner
  2003-07-29 15:49 ` Kevin Buettner
  0 siblings, 1 reply; 6+ messages in thread
From: Kevin Buettner @ 2003-07-22 18:43 UTC (permalink / raw)
  To: gdb-patches

I recently proposed enabling default support for SSE registers:

    http://sources.redhat.com/ml/gdb/2003-07/msg00159.html

No one raised any issues, so here's a patch.

Okay?

	* i386-tdep.c (i386_gdbarch_init): Enable default support for
	SSE registers.

Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.162
diff -u -p -r1.162 i386-tdep.c
--- i386-tdep.c	18 Jul 2003 21:31:50 -0000	1.162
+++ i386-tdep.c	22 Jul 2003 18:31:28 -0000
@@ -1716,10 +1716,23 @@ i386_gdbarch_init (struct gdbarch_info i
   tdep = XMALLOC (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
 
-  /* The i386 default settings don't include the SSE registers.
+  /* The i386 default settings now include the SSE registers.
+     I386_NUM_XREGS includes mxcsr, and we don't want to count
+     this as one of the xmm regs -- which is why we subtract one.
+
+     Note: kevinb/2003-07-14: Whatever Mark's concerns are about the
+     FPU registers in the FIXME below apply to the SSE registers as well.
+     The only problem that I see is that these registers will show up
+     in "info all-registers" even on CPUs where they don't exist.  IMO,
+     however, if it's a choice between printing them always (even when
+     they don't exist) or never showing them to the user (even when they
+     do exist), I prefer the former over the latter.  Ideally, of course,
+     we'd somehow autodetect that we have them (or not) and display them
+     when we have them and suppress them when we don't.
+
      FIXME: kettenis/20020614: They do include the FPU registers for
      now, which probably is not quite right.  */
-  tdep->num_xmm_regs = 0;
+  tdep->num_xmm_regs = I386_NUM_XREGS - 1;
 
   tdep->jb_pc_offset = -1;
   tdep->struct_return = pcc_struct_return;
@@ -1741,9 +1754,9 @@ i386_gdbarch_init (struct gdbarch_info i
      alignment.  */
   set_gdbarch_long_double_bit (gdbarch, 96);
 
-  /* The default ABI includes general-purpose registers and
-     floating-point registers.  */
-  set_gdbarch_num_regs (gdbarch, I386_NUM_GREGS + I386_NUM_FREGS);
+  /* The default ABI includes general-purpose registers, 
+     floating-point registers, and the SSE registers.  */
+  set_gdbarch_num_regs (gdbarch, I386_SSE_NUM_REGS);
   set_gdbarch_register_name (gdbarch, i386_register_name);
   set_gdbarch_register_type (gdbarch, i386_register_type);
 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-08-12 17:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-22 18:43 [RFA/i386]: Enable default support for SSE registers Kevin Buettner
2003-07-29 15:49 ` Kevin Buettner
2003-08-12 15:36   ` Mark Kettenis
2003-08-12 16:39     ` Kevin Buettner
2003-08-12 17:06       ` Mark Kettenis
2003-08-12 17:39         ` Kevin Buettner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox