From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11221 invoked by alias); 23 Nov 2006 19:59:25 -0000 Received: (qmail 11208 invoked by uid 22791); 23 Nov 2006 19:59:24 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-vbr15.xs4all.nl (HELO smtp-vbr15.xs4all.nl) (194.109.24.35) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 23 Nov 2006 19:59:19 +0000 Received: from webmail.xs4all.nl (dovemail2.xs4all.nl [194.109.26.4]) by smtp-vbr15.xs4all.nl (8.13.8/8.13.8) with ESMTP id kANJx4wi048157; Thu, 23 Nov 2006 20:59:04 +0100 (CET) (envelope-from mark.kettenis@xs4all.nl) Received: from 82.92.89.47 (SquirrelMail authenticated user sibelius) by webmail.xs4all.nl with HTTP; Thu, 23 Nov 2006 20:59:08 +0100 (CET) Message-ID: <5032.82.92.89.47.1164311948.squirrel@webmail.xs4all.nl> In-Reply-To: <200611231755.kANHt6g2013138@d12av02.megacenter.de.ibm.com> References: <200611231755.kANHt6g2013138@d12av02.megacenter.de.ibm.com> Date: Thu, 23 Nov 2006 19:59:00 -0000 Subject: Re: [RFA][2/5] New port: Cell BE SPU (valops.c fix) From: "Mark Kettenis" To: "Ulrich Weigand" Cc: "Daniel Jacobowitz" , gdb-patches@sourceware.org User-Agent: SquirrelMail/1.4.8 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-11/txt/msg00281.txt.bz2 > Daniel Jacobowitz wrote: > > > I suppose there's times we want to destroy the rest of the register, > > so knowing where it is in the register isn't enough? > > The problem is, we don't *know* where it is in the register. > > For example, on the SPU "char" values are placed in byte 3 of > the 16 bytes of a general purpose register, "short" values are > placed in bytes 2 and 3, and "int" values are placed in bytes > 0 .. 3. ("long long" is placed in 0 .. 7.) > > However, structs are placed into registers starting from > byte 0 always. Which is the same way as structs are stored in memory isn't it? > So if we have > > struct { char x; char y; char z; char w; } s; > char t; > > and both s and t reside in registers, then a value to access > t would look exactly the same as a value to access s.x (i.e. > type "char", lval_regnum, value_offset == 0), but to access > them requires using different bytes of the register. I actually think the problem is that you're thinking that s.x lives in a register where it is actually s itself that lives in that register. So VALUE_TO_REGISTER should be called for the struct itself, not its char member. Mark