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: Wed, 22 Nov 2006 22:13:00 -0000	[thread overview]
Message-ID: <200611222213.kAMMD9YS008267@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <20061122205727.GA15718@nevyn.them.org> from "Daniel Jacobowitz" at Nov 22, 2006 03:57:27 PM

Daniel Jacobowitz wrote:

> Does the same thing happen for struct { char w, x, y, z; }?

For some reason I seem unable to convince GCC to place such
a struct into a register.

However, when attempting to manipulate a register directly
using its type structure, I'm seeing the same problem:

(gdb) print $r3
$1 = {uint128 = 0x00000001000000000000000000000000, v4_float = {1.40129846e-45, 0, 0, 0}, v4_int32 = {1, 0, 0, 0},
  v8_int16 = {0, 1, 0, 0, 0, 0, 0, 0}, v16_int8 = "\000\000\000\001", '\0' <repeats 11 times>}
(gdb) print $r3.v4_int32
$2 = {1, 0, 0, 0}
(gdb) print $r3.v4_int32[2]
$3 = 0
(gdb) set variable $r3.v4_int32[2] = 5
(gdb) print $r3.v4_int32
$4 = {5, 0, 0, 0}


For registers without special conversion function, value_assign
performs a read-modify-write cycle: it reads the old contents 
of the register(s), modify the bits denoted by value_offset,
value_bitsize and value_bitpos, and writes the full register
contents back.

Maybe we need to do a similar cycle of REGISTER_TO_VALUE,
modify selected bits, VALUE_TO_REGISTER for the registers with
special conversion function?

As an aside, what is this code in value_assign supposed to do:

            /* Locate the first register that falls in the value that
               needs to be transfered.  Compute the offset of the
               value in that register.  */
            {
              int offset;
              for (reg_offset = value_reg, offset = 0;
                   offset + register_size (current_gdbarch, reg_offset) <= value_offset (toval);
                   reg_offset++);
              byte_offset = value_offset (toval) - offset;
            }

It seems clearly broken (offset remains constant 0), but I'm not
quite sure what the intent was.

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-22 22:13 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 [this message]
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
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=200611222213.kAMMD9YS008267@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