Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Jon Beniston" <jon@beniston.com>
To: "'Tom Tromey'" <tromey@redhat.com>,
	"'Werner Almesberger'" <werner@almesberger.net>
Cc: <gdb-patches@sourceware.org>
Subject: RE: [PATCH] 32 bit-ism in lm32-tdep.c (and some sloppy macros)
Date: Mon, 14 Nov 2011 15:55:00 -0000	[thread overview]
Message-ID: <000001cca2e5$b4dfad30$1e9f0790$@beniston.com> (raw)
In-Reply-To: <m3ipmmso0v.fsf@fleche.redhat.com>

Hi Tom,

 
> Werner> -#define LM32_IMM16(insn)        ((((long)insn & 0xffff) << 16) >>
> 16)
> [...]
> Werner> +#define LM32_IMM16(insn)        ((long) (int16_t) (insn))
> 
> I was a little surprised to find out we already use int16_t in gdb.
> Anyway, it seems that the macro would be more obvious as:
> 
> #define LM32_IMM16(insn) ((long) ((insn) & 0xffff))
> 
> WDYT?

I'm not sure that sign-extends?

Jon


  reply	other threads:[~2011-11-14 15:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-11 23:38 Werner Almesberger
2011-11-14 15:49 ` Tom Tromey
2011-11-14 15:55   ` Jon Beniston [this message]
2011-11-14 15:58     ` Tom Tromey
2011-11-14 16:12   ` Pedro Alves
2011-11-14 16:21     ` Tom Tromey
2011-11-14 16:28       ` Pedro Alves
2011-11-14 16:41         ` Tom Tromey
2011-11-23 14:16       ` Mark Kettenis
2011-11-23 19:19       ` Mike Frysinger

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='000001cca2e5$b4dfad30$1e9f0790$@beniston.com' \
    --to=jon@beniston.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    --cc=werner@almesberger.net \
    /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