From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31126 invoked by alias); 4 Apr 2002 18:03:00 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 31113 invoked from network); 4 Apr 2002 18:02:57 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 4 Apr 2002 18:02:57 -0000 Received: from localhost.redhat.com (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id KAA03990; Thu, 4 Apr 2002 10:01:02 -0800 (PST) Received: by localhost.redhat.com (Postfix, from userid 469) id 1B591112E4; Thu, 4 Apr 2002 12:57:00 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15532.37867.707838.943203@localhost.redhat.com> Date: Thu, 04 Apr 2002 10:03:00 -0000 To: Andrew Cagney Cc: Andreas Jaeger , Michal Ludvig , gdb Subject: Re: discuss: How to print XMM registers on i386/x86-64 In-Reply-To: <3CAC8B94.7020904@cygnus.com> References: <3CAC6E35.8050302@suse.cz> <3CAC8B94.7020904@cygnus.com> X-SW-Source: 2002-04/txt/msg00059.txt.bz2 Andrew Cagney writes: > > Michal Ludvig 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