This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] 32 bit-ism in lm32-tdep.c (and some sloppy macros)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]