64-bit clean-up in mn10300 disassembler

Alexandre Oliva aoliva@cygnus.com
Wed May 24 07:36:00 GMT 2000


On May 24, 2000, Alan Modra <alan@linuxcare.com.au> wrote:

> On 24 May 2000, Alexandre Oliva wrote:
> +                 && (value & (1 << (operand->bits - 1))))
> +               value |= (((unsigned long)0) - 1) << (operand->bits - 1);

> value = ((value ^ ((unsigned long)1 << (operand->bits - 1)))
>          - ((unsigned long)1 << (operand->bits - 1)))

> should compile better.  Also, you forgot to cast 1 to unsigned long.

Indeed, thanks.  Here's a revised patch.  Ok to install?

> On another issue, what about MN10300_OPERAND_SPLIT?  Does this need
> to be sign extended in some cases?

Nope, it's always 32-bits wide.  Well, it could be argued that we
should sign-extend it to 64-bits when appropriate, but I haven't
encountered any failure related with the lack of sign-extension.
Probably because value (which is unsigned long) is printed with "%d",
which is a problem in itself.



More information about the Gdb-patches mailing list