* [Patch, moxie, sim] Add new sign-extension instructions
@ 2014-04-03 4:08 Anthony Green
2014-04-07 16:48 ` Joel Brobecker
0 siblings, 1 reply; 3+ messages in thread
From: Anthony Green @ 2014-04-03 4:08 UTC (permalink / raw)
To: gdb-patches
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 */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch, moxie, sim] Add new sign-extension instructions
2014-04-03 4:08 [Patch, moxie, sim] Add new sign-extension instructions Anthony Green
@ 2014-04-07 16:48 ` Joel Brobecker
2014-04-08 23:15 ` Mike Frysinger
0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2014-04-07 16:48 UTC (permalink / raw)
To: Anthony Green; +Cc: gdb-patches
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch, moxie, sim] Add new sign-extension instructions
2014-04-07 16:48 ` Joel Brobecker
@ 2014-04-08 23:15 ` Mike Frysinger
0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2014-04-08 23:15 UTC (permalink / raw)
To: gdb-patches; +Cc: Joel Brobecker, Anthony Green
[-- Attachment #1: Type: text/plain, Size: 71 bytes --]
looks like Joel covered everything. lgtm after the style fixes.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-08 23:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-03 4:08 [Patch, moxie, sim] Add new sign-extension instructions Anthony Green
2014-04-07 16:48 ` Joel Brobecker
2014-04-08 23:15 ` Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox