From: "H.J. Lu" <hjl.tools@gmail.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: PATCH: Add regcache_raw_supply_part/regcache_raw_collect_part
Date: Wed, 03 Feb 2010 13:46:00 -0000 [thread overview]
Message-ID: <6dc9ffc81002030546vf0aed60x307ce782133335f4@mail.gmail.com> (raw)
In-Reply-To: <201002030914.o139E4Ti027331@glazunov.sibelius.xs4all.nl>
On Wed, Feb 3, 2010 at 1:14 AM, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>> Date: Tue, 2 Feb 2010 19:31:31 -0800
>> From: "H.J. Lu" <hongjiu.lu@intel.com>
>>
>> Hi,
>>
>> Intel AVX saves a 256bit YMM register in lower 128bit and upper 128bit
>> separately. This patch adds regcache_raw_supply_part and
>> regcache_raw_collect_part. They will be used in AVX gdb patches . OK
>> to install?
>
> I think introducing these functions would be a mistake. If you're not
> careful, you'll end up with a register cache where part of some
> registers is filled with garbage.
They are used
if ((clear_bv & bit_XSTATE_SSE))
regcache_raw_supply_part (regcache, i, NULL,
0, 16, 0);
else
regcache_raw_supply_part (regcache, i,
XSAVE_SSE_ADDR (tdep, regs, i),
0, 16, 0);
if ((clear_bv & bit_XSTATE_AVX))
regcache_raw_supply_part (regcache, i, NULL,
16, 16, 1);
else
regcache_raw_supply_part (regcache, i,
XSAVE_AVXH_ADDR (tdep, regs, i),
16, 16, 1);
I mark regcache as valid after full register is updated. If we get garbage in
regcache, it is a bug.
> I think it is better for the code that fills the register cache, to
> collect the pieces and build the full 256-bit value, and then use
> regcache_raw_supply() to fill the register cache.
>
I can do that with extra memory copy.
--
H.J.
next prev parent reply other threads:[~2010-02-03 13:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-03 3:31 H.J. Lu
2010-02-03 9:14 ` Mark Kettenis
2010-02-03 13:46 ` H.J. Lu [this message]
2010-02-03 14:00 ` Daniel Jacobowitz
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=6dc9ffc81002030546vf0aed60x307ce782133335f4@mail.gmail.com \
--to=hjl.tools@gmail.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