Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: drow@false.org (Daniel Jacobowitz)
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA][2/5] New port: Cell BE SPU (valops.c fix)
Date: Thu, 23 Nov 2006 17:55:00 -0000	[thread overview]
Message-ID: <200611231755.kANHt6g2013138@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <20061123161641.GA11679@nevyn.them.org> from "Daniel Jacobowitz" at Nov 23, 2006 11:16:41 AM

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.

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.

We might be able to fix this particular problem by having
value_from_register somehow set the value_offset to 3 when
retrieving a value of type "char" from a register.  However,
even though there is a comment saying "The assumption is that
REGISTER_TO_VALUE populates the entire value including the
location.", that isn't actually possible with the current
interface since REGISTER_TO_VALUE doesn't actually *get*
the value itself.

So maybe we can extend REGISTER_TO_VALUE by an argument to
return the byte offset of the original value in the register,
and extend VALUE_TO_REGISTER by an argument to pass the 
requested byte offset (which might point to a subobject of
the whole object), this could work ...

We'd still have to solve the bitfield problem, but that might
be possible in common code later on.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2006-11-23 17:55 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-11 18:38 Ulrich Weigand
2006-11-22 14:15 ` [PING] " Ulrich Weigand
2006-11-22 14:23 ` Daniel Jacobowitz
2006-11-22 19:25   ` Jim Blandy
2006-11-22 19:28     ` Daniel Jacobowitz
2006-11-22 19:55       ` Ulrich Weigand
2006-11-22 20:30         ` Daniel Jacobowitz
2006-11-22 20:43           ` Ulrich Weigand
2006-11-22 20:57             ` Daniel Jacobowitz
2006-11-22 22:13               ` Ulrich Weigand
2006-11-22 22:48                 ` Daniel Jacobowitz
2006-11-23 13:57                   ` Ulrich Weigand
2006-11-23 16:16                     ` Daniel Jacobowitz
2006-11-23 17:55                       ` Ulrich Weigand [this message]
2006-11-23 19:59                         ` Mark Kettenis
2006-11-24  2:08                           ` Daniel Jacobowitz
2006-11-24 15:51                             ` Ulrich Weigand
2006-11-28 14:56                               ` Daniel Jacobowitz
2006-11-27 19:31                         ` Jim Blandy
2006-11-27 22:06                           ` Ulrich Weigand
2006-11-27 22:31                             ` Jim Blandy
2006-11-27 23:23                               ` Ulrich Weigand
2006-11-27 23:59                                 ` Jim Blandy
2006-11-28  0:01                                 ` Daniel Jacobowitz
2006-12-06 16:29                                   ` Ulrich Weigand
2006-12-06 16:43                                     ` Daniel Jacobowitz
2006-12-06 17:10                                       ` Ulrich Weigand
2006-12-06 17:12                                         ` Daniel Jacobowitz
2006-12-07  6:34                                           ` Vladimir Prus
2006-12-06 21:21                                     ` Jim Blandy
2006-12-06 22:02                                       ` Daniel Jacobowitz
2006-12-06 23:24                                         ` Jim Blandy
2006-12-06 23:16                                       ` Ulrich Weigand
2006-12-06 23:39                                         ` Jim Blandy
2006-12-08 15:50                                           ` Ulrich Weigand

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=200611231755.kANHt6g2013138@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    /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