This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Patch, moxie, sim] Add new sign-extension instructions
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Anthony Green <green at moxielogic dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 7 Apr 2014 09:48:40 -0700
- Subject: Re: [Patch, moxie, sim] Add new sign-extension instructions
- Authentication-results: sourceware.org; auth=none
- References: <87ppkzjbsd dot fsf at moxielogic dot com>
> I'm committing the following patch that adds support for two new
> sign-extension instructions to the moxie simulator. Binutils and GCC
> changes have already been committed.
>
> Thanks,
>
> AG
>
> 2014-04-02 Anthony Green <green@moxielogic.com>
>
> * interp.c (sim_resume): Add new sign-extend instructions.
Small comment: Would you mind adding an empty line between the local
variable declarations and the first statement after that? This is
part of the GDB Coding Style and the sim code is part of GDB. Eg:
> - case 0x10: /* bad */
> - case 0x11: /* bad */
> + case 0x10: /* sex.b */
> + {
> + int a = (inst >> 4) & 0xf;
> + int b = inst & 0xf;
> + signed char bv = cpu.asregs.regs[b];
Add an empty line here.
> + TRACE("sex.b");
> + cpu.asregs.regs[a] = (int) bv;
> + }
> + break;
> + case 0x11: /* sex.s */
> + {
> + int a = (inst >> 4) & 0xf;
> + int b = inst & 0xf;
> + signed short bv = cpu.asregs.regs[b];
And here as well.
> + TRACE("sex.s");
> + cpu.asregs.regs[a] = (int) bv;
> + }
> + break;
> case 0x12: /* bad */
> case 0x13: /* bad */
> case 0x14: /* bad */
Thank you!
--
Joel