This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [committed] MIPS/BFD: Correct register index calculation in BZ16_REG
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: "Maciej W. Rozycki" <macro at imgtec dot com>
- Cc: Tristan Gingold <gingold at adacore dot com>, <binutils at sourceware dot org>
- Date: Sun, 24 Jan 2016 09:34:48 +0100
- Subject: Re: [committed] MIPS/BFD: Correct register index calculation in BZ16_REG
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 00 dot 1601240102110 dot 5958 at tp dot orcam dot me dot uk>
"Maciej W. Rozycki" <macro@imgtec.com> writes:
> diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
> index 4ece819..176970a 100644
> --- a/bfd/elfxx-mips.c
> +++ b/bfd/elfxx-mips.c
> @@ -13110,7 +13110,7 @@ static const struct opcode_descriptor bz_insns_16[] = {
>
> /* Switch between a 5-bit register index and its 3-bit shorthand. */
>
> -#define BZ16_REG(opcode) ((((((opcode) >> 7) & 7) + 0x1e) & 0x17) + 2)
> +#define BZ16_REG(opcode) ((((((opcode) >> 7) & 7) + 0x1e) & 0xf) + 2)
It doesn't make sense to add 0x1e if you mask off 0x10 afterwards.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."