aboutsummaryrefslogtreecommitdiff
path: root/sim/v850
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1996-08-30 03:48:13 +0000
committerJeff Law <law@redhat.com>1996-08-30 03:48:13 +0000
commit2108e86459a49eae5349f69f9021afe47e8691a1 (patch)
tree061e274329b35ad2e454ef15d014c7327d46847c /sim/v850
parent35404c7d070c8d5ca4ef8669a7b7ffe5c2023b45 (diff)
downloadgdb-2108e86459a49eae5349f69f9021afe47e8691a1.zip
gdb-2108e86459a49eae5349f69f9021afe47e8691a1.tar.gz
gdb-2108e86459a49eae5349f69f9021afe47e8691a1.tar.bz2
* interp.c (do_format_3): Get operands correctly and call
the target function. * simops.c: Handle bCC instructions.
Diffstat (limited to 'sim/v850')
-rw-r--r--sim/v850/ChangeLog4
-rw-r--r--sim/v850/interp.c5
-rw-r--r--sim/v850/simops.c215
3 files changed, 211 insertions, 13 deletions
diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog
index a026e1f..969cf6a 100644
--- a/sim/v850/ChangeLog
+++ b/sim/v850/ChangeLog
@@ -1,5 +1,9 @@
Thu Aug 29 13:53:29 1996 Jeffrey A Law (law@cygnus.com)
+ * interp.c (do_format_3): Get operands correctly and call
+ the target function.
+ * simops.c: Handle bCC instructions.
+
* simops.c: Add condition code handling to shift insns.
Fix minor typos in condition code handling for other insns.
diff --git a/sim/v850/interp.c b/sim/v850/interp.c
index bcbb982..1cd990e 100644
--- a/sim/v850/interp.c
+++ b/sim/v850/interp.c
@@ -167,7 +167,12 @@ static void
do_format_3 (insn)
uint32 insn;
{
+ struct hash_entry *h;
printf("format 3 0x%x\n", insn);
+
+ h = lookup_hash (insn);
+ OP[0] = (((insn & 0x70) >> 4) | ((insn & 0xf800) >> 8)) << 1;
+ (h->ops->func) ();
}
static void
diff --git a/sim/v850/simops.c b/sim/v850/simops.c
index b06c124..9eac939 100644
--- a/sim/v850/simops.c
+++ b/sim/v850/simops.c
@@ -22,99 +22,273 @@ OP_760 ()
{
}
+/* bv disp9 */
void
OP_580 ()
{
-}
+ unsigned int op0, psw;
+ int temp;
-void
-OP_700 ()
-{
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ psw = State.psw;
+
+ if ((psw & PSW_OV) != 0)
+ State.pc += op0;
+ else
+ State.pc += 2;
}
+/* bl disp9 */
void
OP_581 ()
{
+ unsigned int op0, psw;
+ int temp;
+
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ psw = State.psw;
+
+ if ((psw & PSW_CY) != 0)
+ State.pc += op0;
+ else
+ State.pc += 2;
}
+/* be disp9 */
void
OP_582 ()
{
+ unsigned int op0, psw;
+ int temp;
+
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ psw = State.psw;
+
+ if ((psw & PSW_Z) != 0)
+ State.pc += op0;
+ else
+ State.pc += 2;
}
+/* bnh disp 9*/
void
OP_583 ()
{
+ unsigned int op0, psw;
+ int temp;
+
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ psw = State.psw;
+
+ if ((((psw & PSW_CY) != 0) | ((psw & PSW_Z) != 0)) != 0)
+ State.pc += op0;
+ else
+ State.pc += 2;
}
+/* bn disp9 */
void
OP_584 ()
{
+ unsigned int op0, psw;
+ int temp;
+
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ psw = State.psw;
+
+ if ((psw & PSW_S) != 0)
+ State.pc += op0;
+ else
+ State.pc += 2;
}
+/* br disp9 */
void
OP_585 ()
{
+ unsigned int op0;
+ int temp;
+
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ State.pc += op0;
}
+/* blt disp9 */
void
OP_586 ()
{
+ unsigned int op0, psw;
+ int temp;
+
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ psw = State.psw;
+
+ if ((((psw & PSW_S) != 0) ^ ((psw & PSW_OV) != 0)) != 0)
+ State.pc += op0;
+ else
+ State.pc += 2;
}
+/* ble disp9 */
void
OP_587 ()
{
+ unsigned int op0, psw;
+ int temp;
+
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ psw = State.psw;
+
+ if ((((psw & PSW_Z) != 0)
+ || (((psw & PSW_S) != 0) ^ ((psw & PSW_OV) != 0))) != 0)
+ State.pc += op0;
+ else
+ State.pc += 2;
}
+/* bnv disp9 */
void
OP_588 ()
{
+ unsigned int op0, psw;
+ int temp;
+
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ psw = State.psw;
+
+ if ((psw & PSW_OV) == 0)
+ State.pc += op0;
+ else
+ State.pc += 2;
}
+/* bnl disp9 */
void
OP_589 ()
{
+ unsigned int op0, psw;
+ int temp;
+
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ psw = State.psw;
+
+ if ((psw & PSW_CY) == 0)
+ State.pc += op0;
+ else
+ State.pc += 2;
}
+/* bne disp9 */
void
OP_58A ()
{
+ unsigned int op0, psw;
+ int temp;
+
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ psw = State.psw;
+
+ if ((psw & PSW_Z) == 0)
+ State.pc += op0;
+ else
+ State.pc += 2;
}
+/* bh disp9 */
void
OP_58B ()
{
-}
+ unsigned int op0, psw;
+ int temp;
-void
-OP_58C ()
-{
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ psw = State.psw;
+
+ if ((((psw & PSW_CY) != 0) | ((psw & PSW_Z) != 0)) == 0)
+ State.pc += op0;
+ else
+ State.pc += 2;
}
+/* bp disp9 */
void
-OP_400 ()
+OP_58C ()
{
-}
+ unsigned int op0, psw;
+ int temp;
-void
-OP_160 ()
-{
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ psw = State.psw;
+
+ if ((psw & PSW_S) == 0)
+ State.pc += op0;
+ else
+ State.pc += 2;
}
+/* bsa disp9 */
void
OP_58D ()
{
+ unsigned int op0, psw;
+ int temp;
+
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ psw = State.psw;
+
+ if ((psw & PSW_SAT) != 0)
+ State.pc += op0;
+ else
+ State.pc += 2;
}
+/* bge disp9 */
void
OP_58E ()
{
+ unsigned int op0, psw;
+ int temp;
+
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ psw = State.psw;
+
+ if ((((psw & PSW_S) != 0) ^ ((psw & PSW_OV) != 0)) == 0)
+ State.pc += op0;
+ else
+ State.pc += 2;
}
+/* bgt disp9 */
void
OP_58F ()
{
+ unsigned int op0, psw;
+ int temp;
+
+ temp = (State.regs[OP[0]] << 23) >> 23;
+ op0 = temp;
+ psw = State.psw;
+
+ if ((((psw & PSW_Z) != 0)
+ || (((psw & PSW_S) != 0) ^ ((psw & PSW_OV) != 0))) == 0)
+ State.pc += op0;
+ else
+ State.pc += 2;
}
void
@@ -787,3 +961,18 @@ OP_4007E0 ()
abort ();
}
+void
+OP_400 ()
+{
+}
+
+void
+OP_160 ()
+{
+}
+
+void
+OP_700 ()
+{
+}
+