Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: deuling@de.ibm.com (Markus Deuling)
Cc: gdb-patches@sourceware.org (GDB Patches)
Subject: Re: [rfc] [05/05] Get rid of current_gdbarch in xtensa
Date: Thu, 08 Nov 2007 21:55:00 -0000	[thread overview]
Message-ID: <200711082155.lA8LtPjO001820@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <47319D50.50709@de.ibm.com> from "Markus Deuling" at Nov 07, 2007 12:11:12 PM

Markus Deuling wrote:

> -#define AREG_NUMBER(r, wb) \
> -  ((((r) - (gdbarch_tdep (current_gdbarch)->a0_base + 0) + (((wb) \
> -  & ((gdbarch_tdep (current_gdbarch)->num_aregs - 1) >> 2)) << WB_SHIFT)) & \
> -  (gdbarch_tdep (current_gdbarch)->num_aregs - 1)) \
> -  + gdbarch_tdep (current_gdbarch)->ar_base)


> +/* Convert a live Ax register number to the corresponding Areg number.  */
> +static int
> +areg_number (struct gdbarch *gdbarch, int regnum, ULONGEST wb)
> +{
> +  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
> +  int areg;
> +
> +  areg = regnum - tdep->a0_base + tdep->ar_base;
> +  areg += (wb & ((tdep->num_aregs - 1) >> 2)) << WB_SHIFT;
> +  areg &= tdep->num_aregs - 1;
> +
> +  return areg;
> +}

The function does not look equivalent to the macro, that should be

  areg = regnum - tdep->a0_base;
  areg += (wb & ((tdep->num_aregs - 1) >> 2)) << WB_SHIFT;
  areg &= tdep->num_aregs - 1;

  return areg + tdep->ar_base;


> +      regnum = areg_number(gdbarch, regnum, extract_unsigned_integer (buf, 4));
Space before '('.


Otherwise, I didn't see anything wrong.  But I agree that it would
be good to test a change of this complexity; can you set up a simulator
test environment for xtensa?

Bye,
Ulrich

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


  reply	other threads:[~2007-11-08 21:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07 11:13 Markus Deuling
2007-11-08 21:55 ` Ulrich Weigand [this message]
2007-11-08 22:18   ` Daniel Jacobowitz
2007-11-08 22:30     ` Maxim Grigoriev
2007-11-09  2:12   ` Maxim Grigoriev
2007-11-09  5:59     ` Markus Deuling
2007-11-09  7:47       ` Maxim Grigoriev
2007-11-09 13:13     ` Ulrich Weigand
2007-11-12  6:44       ` Markus Deuling

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=200711082155.lA8LtPjO001820@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=deuling@de.ibm.com \
    --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