This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[Patch, moxie, sim] Add new sign-extension instructions
- From: Anthony Green <green at moxielogic dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 03 Apr 2014 00:07:46 -0400
- Subject: [Patch, moxie, sim] Add new sign-extension instructions
- Authentication-results: sourceware.org; auth=none
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.
diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c
index a3f238a..4362c66 100644
--- a/sim/moxie/interp.c
+++ b/sim/moxie/interp.c
@@ -586,8 +586,24 @@ sim_resume (sd, step, siggnal)
break;
case 0x0f: /* nop */
break;
- 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];
+ 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];
+ TRACE("sex.s");
+ cpu.asregs.regs[a] = (int) bv;
+ }
+ break;
case 0x12: /* bad */
case 0x13: /* bad */
case 0x14: /* bad */