* discuss: How to print XMM registers on i386/x86-64
@ 2002-04-04 7:16 Michal Ludvig
2002-04-04 7:25 ` Andreas Jaeger
0 siblings, 1 reply; 4+ messages in thread
From: Michal Ludvig @ 2002-04-04 7:16 UTC (permalink / raw)
To: gdb
Hi all,
current gdb has a problem with printing xmm registers on i386/x86-64
architectures. XMM regsters are of type builtin_type_v4sf. In 5.1.1 the
output of 'comand info registers xmm0' was as follows:
xmm0 0x00102030405060708090a0b0c0d0e0f0
Now in current mainline it's completely broken (with the same type):
xmm0 {f = {0x0, 0x0, 0x0, 0x0}} \
{f = {5.82303983e-10, 2.77686634e+29, -1.16826016e-09, \
-5.56616044e+29}}
If I change the type to builtin_type_v4si I get a more useful output:
xmm0 {f = {0x30201000, 0x70605040, 0xb0a09080, 0xf0e0d0c0}} \
{f = {807407616, 1885360192, -1331654528, -253701952}}
So my question is how to print it? We shouldn't treat XMM registers as
4xFP, because it can contain 1) two double precision floats, 2) four
single precision floats, 3) from 16 bytes, 8 words, 4 double words, 2
quadwords or 1 double quadword (128b).
For now gcc won't store more than one FP variable into each register,
ie. we don't need to convert all parts to float.
I propose to provide an output like it was in 5.1 and create a new
command for exploring these registers from different type's point of
view. For example 'show register xmm0 dw' would print each quarter in a
decimal form (dw stands for doubleword), while 'show register xmm0 dfp'
would print both halves of the register as double precision floats.
We need a working XMM debugging on x86-64 arch, because there it is the
default for FP. Thus I'd like to change the type of xmm registers to
builtin_type_v4si for gdb-5.2 so that it would be at least somehow
useful. In the current state it is not.
What do you think about these propositions?
Michal Ludvig
--
* SuSE CR, s.r.o * mludvig@suse.cz
* +420 2 9654 5373 * http://www.suse.cz
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: discuss: How to print XMM registers on i386/x86-64
2002-04-04 7:16 discuss: How to print XMM registers on i386/x86-64 Michal Ludvig
@ 2002-04-04 7:25 ` Andreas Jaeger
2002-04-04 9:21 ` Andrew Cagney
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Jaeger @ 2002-04-04 7:25 UTC (permalink / raw)
To: Michal Ludvig; +Cc: gdb
Michal Ludvig <mludvig@suse.cz> writes:
> Hi all,
> current gdb has a problem with printing xmm registers on i386/x86-64
> architectures. XMM regsters are of type builtin_type_v4sf. In 5.1.1
> the output of 'comand info registers xmm0' was as follows:
>
> xmm0 0x00102030405060708090a0b0c0d0e0f0
>
> Now in current mainline it's completely broken (with the same type):
>
> xmm0 {f = {0x0, 0x0, 0x0, 0x0}} \
> {f = {5.82303983e-10, 2.77686634e+29, -1.16826016e-09, \
> -5.56616044e+29}}
>
> If I change the type to builtin_type_v4si I get a more useful output:
>
> xmm0 {f = {0x30201000, 0x70605040, 0xb0a09080, 0xf0e0d0c0}} \
> {f = {807407616, 1885360192, -1331654528, -253701952}}
>
> So my question is how to print it? We shouldn't treat XMM registers as
> 4xFP, because it can contain 1) two double precision floats, 2) four
> single precision floats, 3) from 16 bytes, 8 words, 4 double words, 2
> quadwords or 1 double quadword (128b).
> For now gcc won't store more than one FP variable into each register,
> ie. we don't need to convert all parts to float.
>
> I propose to provide an output like it was in 5.1 and create a new
> command for exploring these registers from different type's point of
> view. For example 'show register xmm0 dw' would print each quarter in
> a decimal form (dw stands for doubleword), while 'show register xmm0
> dfp' would print both halves of the register as double precision
> floats.
That's the way I would go. I'm not sure whether I'd like to see "dw"
there but we should use some flag for this.
My first thought was extending the print /FMT argument but I'm not
sure whether this works.
>
> We need a working XMM debugging on x86-64 arch, because there it is
> the default for FP. Thus I'd like to change the type of xmm registers
> to builtin_type_v4si for gdb-5.2 so that it would be at least somehow
> useful. In the current state it is not.
>
> What do you think about these propositions?
Thanks for looking into this!
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: discuss: How to print XMM registers on i386/x86-64
2002-04-04 7:25 ` Andreas Jaeger
@ 2002-04-04 9:21 ` Andrew Cagney
2002-04-04 10:03 ` Elena Zannoni
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2002-04-04 9:21 UTC (permalink / raw)
To: Andreas Jaeger; +Cc: Michal Ludvig, gdb
> Michal Ludvig <mludvig@suse.cz> writes:
>
>
>> Hi all,
>> current gdb has a problem with printing xmm registers on i386/x86-64
>> architectures. XMM regsters are of type builtin_type_v4sf. In 5.1.1
>> the output of 'comand info registers xmm0' was as follows:
>>
>> xmm0 0x00102030405060708090a0b0c0d0e0f0
>> Now in current mainline it's completely broken (with the same type):
>>
>> xmm0 {f = {0x0, 0x0, 0x0, 0x0}} \
>> {f = {5.82303983e-10, 2.77686634e+29, -1.16826016e-09, \
>> -5.56616044e+29}}
When you say broken, you mean the output or the values?
>> If I change the type to builtin_type_v4si I get a more useful output:
>>
>> xmm0 {f = {0x30201000, 0x70605040, 0xb0a09080, 0xf0e0d0c0}} \
>> {f = {807407616, 1885360192, -1331654528, -253701952}}
>>
>> So my question is how to print it? We shouldn't treat XMM registers as
>> 4xFP, because it can contain 1) two double precision floats, 2) four
>> single precision floats, 3) from 16 bytes, 8 words, 4 double words, 2
>> quadwords or 1 double quadword (128b).
The idea behind the registers having struct/union types was to make it
possible for the user to ``explore'' (and access) sub fields and the
composite vis:
$xmm0.v4si[1]
$xmm0.v2di[0]
(don't quote me on the syntax). It sounds like the current type isn't
sufficient - a union of types is needed?
Can I suggest treating how ``info registers'' displays registers as a
separate problem - the code is free to display the registers in what
ever format it sees fit.
>> For now gcc won't store more than one FP variable into each register,
>> ie. we don't need to convert all parts to float.
I think the full register contents should be displayed - we can't assume
that the user is using GCC.
Ok, one MMX patch comming right up ...
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: discuss: How to print XMM registers on i386/x86-64
2002-04-04 9:21 ` Andrew Cagney
@ 2002-04-04 10:03 ` Elena Zannoni
0 siblings, 0 replies; 4+ messages in thread
From: Elena Zannoni @ 2002-04-04 10:03 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Andreas Jaeger, Michal Ludvig, gdb
Andrew Cagney writes:
> > Michal Ludvig <mludvig@suse.cz> writes:
> >
> >
> >> Hi all,
> >> current gdb has a problem with printing xmm registers on i386/x86-64
> >> architectures. XMM regsters are of type builtin_type_v4sf. In 5.1.1
> >> the output of 'comand info registers xmm0' was as follows:
> >>
> >> xmm0 0x00102030405060708090a0b0c0d0e0f0
> >> Now in current mainline it's completely broken (with the same type):
> >>
> >> xmm0 {f = {0x0, 0x0, 0x0, 0x0}} \
> >> {f = {5.82303983e-10, 2.77686634e+29, -1.16826016e-09, \
> >> -5.56616044e+29}}
>
> When you say broken, you mean the output or the values?
>
> >> If I change the type to builtin_type_v4si I get a more useful output:
> >>
> >> xmm0 {f = {0x30201000, 0x70605040, 0xb0a09080, 0xf0e0d0c0}} \
> >> {f = {807407616, 1885360192, -1331654528, -253701952}}
> >>
> >> So my question is how to print it? We shouldn't treat XMM registers as
> >> 4xFP, because it can contain 1) two double precision floats, 2) four
> >> single precision floats, 3) from 16 bytes, 8 words, 4 double words, 2
> >> quadwords or 1 double quadword (128b).
>
>
> The idea behind the registers having struct/union types was to make it
> possible for the user to ``explore'' (and access) sub fields and the
> composite vis:
>
> $xmm0.v4si[1]
> $xmm0.v2di[0]
>
> (don't quote me on the syntax). It sounds like the current type isn't
> sufficient - a union of types is needed?
>
> Can I suggest treating how ``info registers'' displays registers as a
> separate problem - the code is free to display the registers in what
> ever format it sees fit.
>
> >> For now gcc won't store more than one FP variable into each register,
> >> ie. we don't need to convert all parts to float.
>
> I think the full register contents should be displayed - we can't assume
> that the user is using GCC.
>
> Ok, one MMX patch comming right up ...
>
> Andrew
>
>
Another example to look at is the printing of the AltiVec registers.
The code for this is in rs6000-tdep.c.
Elena
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-04-04 18:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-04 7:16 discuss: How to print XMM registers on i386/x86-64 Michal Ludvig
2002-04-04 7:25 ` Andreas Jaeger
2002-04-04 9:21 ` Andrew Cagney
2002-04-04 10:03 ` Elena Zannoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox