diff options
author | Anthony Green <green@moxielogic.com> | 2014-04-02 23:55:57 -0400 |
---|---|---|
committer | Anthony Green <green@moxielogic.com> | 2014-04-02 23:58:01 -0400 |
commit | 048ea17465ce5effe702895cd644fa3d9dd94680 (patch) | |
tree | 65b35c66b79726315b596779feb26717cc79e283 /sim/moxie | |
parent | 2493504aa84aceffcdb5f3febddca03e7c3d8176 (diff) | |
download | gdb-048ea17465ce5effe702895cd644fa3d9dd94680.zip gdb-048ea17465ce5effe702895cd644fa3d9dd94680.tar.gz gdb-048ea17465ce5effe702895cd644fa3d9dd94680.tar.bz2 |
Add support for two new moxie sign-extension instructions
Diffstat (limited to 'sim/moxie')
-rw-r--r-- | sim/moxie/ChangeLog | 4 | ||||
-rw-r--r-- | sim/moxie/interp.c | 20 |
2 files changed, 22 insertions, 2 deletions
diff --git a/sim/moxie/ChangeLog b/sim/moxie/ChangeLog index 691d41a..2831c94 100644 --- a/sim/moxie/ChangeLog +++ b/sim/moxie/ChangeLog @@ -1,3 +1,7 @@ +2014-04-02 Anthony Green <green@moxielogic.com> + + * interp.c (sim_resume): Add new sign-extend instructions. + 2014-03-10 Mike Frysinger <vapier@gentoo.org> * interp.c (sim_do_command): Add const to cmd. 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 */ |