Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: "Mark Kettenis" <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org, dan@codesourcery.com
Subject: Re: PATCH: Extend gdb remote protocol for AVX
Date: Sat, 04 Oct 2008 22:22:00 -0000	[thread overview]
Message-ID: <6dc9ffc80810041522t41bc2f8ao1e9da436c2978219@mail.gmail.com> (raw)
In-Reply-To: <200810042049.m94Kn3k8015088@brahms.sibelius.xs4all.nl>

On Sat, Oct 4, 2008 at 1:49 PM, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>> >> 1. Only display YMM registers, no XMM registers if the execution
>> >> environment supports AVX, independent of executables.
>> >
>> > is wrong.  People should still be able to debug traditional SSE code
>> > even if the execution environment supports AVX.  Since the following
>> > goals follow from #1:
>>
>> You can still debug SSE code with my proposal.
>
> Sure, but statements like "print $xmm0" won't work anymore.  And I'm

That is true. We can solve it the same way as al/ax/eax.

> also not sure that debug info that refers to the %xmm registers will
> continue to work.

It works the same way as al/ax/eax/rax. Gdb sees the same register
number for al/ax/eax/rax. We tell them apart by their sizes. There are
not many differences in the way how we deal with xmm/ymm.

>> >> 2. Native:
>> >>    a. Check native AVX support at run-time.
>> >>    b. Use AVX registers only if native environment supports AVX.
>> >>    Otherwise use XMM registers.
>> >> 3. Remote:
>> >>    a. Check remote AVX support when setting up connection.
>> >>    b. Use AVX registers only if remote environment supports AVX.
>> >>    Otherwise use XMM registers.
>> >
>> > I disagree with those as well.
>> >
>> > We probably need to play pseudo-register tricks to make sure %xmm and
>> > %ymm share the data for the lower 128 bits in the register cache, and
>> > perhaps some option to choose between showing %xmm, %ymm or both in
>> > the "info registers" output.
>> >
>>
>> The relationship between xmm and ymm is similar to eax and rax.
>
> Not really.  We treat amd64 and i386 as different ISA's much in the
> same way as we treat sparc and sparc64 as different ISA's.  I can
> understand that Intel would like to position AVX as something
> radically different, but essentially it is just another extensions to
> the amd64 and i386 ISA's.
>
> If there would be a desire on amd64 to be able to refer to the 32-bit
> parts of the general-purpose registers we would implement them in much
> the same way as I propose for %xmm/%ymm, as pseudo registers.
>
>> My proposal only deals with how to access xmm/ymm registers and
>> doesn't affect other aspects. What does your suggestion will buy us
>> beyond my proposal?
>
> I have no objection to the changes you proposed for the remote
> protocol.  But your diff also touches the core register stuff, and

I only increased MAX_REGISTER_SIZE to 32. All other changes
are limited to x86. A big part of my change is to auto-detect packet size.

> that needs a bit more thought to make sure we don't surprise our

Only "print %xmm" won't work on AVX.  It is easy to support "print %xmm"
on AVX if gdb supports "print %al/%ax". But I see it as a separate
issue which is orthogonal to my AVX proposal.

> users.  At that point, it may be easier to use the same model for the
> remote protocol, where you transfer the top 128 bits of the %ymm
> registers in addition to the %xmm registers.  Adter all this is how
> the hardware does it too (xsave is just an extension of fxsave).
>

Ymm register is 256bit. Transfer top 128 bits of the ymm registers
separately will require bigger changes without much benefit.


-- 
H.J.


      parent reply	other threads:[~2008-10-04 22:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-18 17:28 H.J. Lu
2008-09-18 17:51 ` Mark Kettenis
2008-09-18 18:20   ` Mark Kettenis
2008-09-18 18:31     ` H.J. Lu
2008-09-18 18:34 ` Daniel Jacobowitz
2008-09-18 19:03   ` H.J. Lu
2008-09-18 19:39     ` Daniel Jacobowitz
2008-09-18 20:13       ` H.J. Lu
2008-09-18 20:24         ` Daniel Jacobowitz
2008-10-02 10:29 ` Mark Kettenis
2008-10-02 14:16   ` H.J. Lu
2008-10-04 20:52     ` Mark Kettenis
2008-10-04 22:14       ` Daniel Jacobowitz
2008-10-05 14:37         ` H.J. Lu
2008-10-06 21:35           ` Mark Kettenis
2008-10-07 19:22             ` H.J. Lu
2008-10-12 13:39               ` Mark Kettenis
2008-10-12 22:18                 ` H.J. Lu
2008-10-28 14:11                   ` H.J. Lu
2008-10-28 14:18                     ` Daniel Jacobowitz
2008-10-28 17:29                       ` Mark Kettenis
2008-10-29  7:41                         ` H.J. Lu
2008-10-29 16:45                           ` Mark Kettenis
2008-10-29  2:00                       ` H.J. Lu
2008-10-29  2:16                         ` Daniel Jacobowitz
2008-10-04 22:22       ` H.J. Lu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6dc9ffc80810041522t41bc2f8ao1e9da436c2978219@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=dan@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox