aboutsummaryrefslogtreecommitdiff
path: root/sim/v850
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1996-08-29 19:53:37 +0000
committerJeff Law <law@redhat.com>1996-08-29 19:53:37 +0000
commit1fe983dcdfa028f072cccfd9f8566bb437d7bb99 (patch)
tree89f60e776b19ad5e1cb559dddb701eea20123e93 /sim/v850
parente7f3e5fbbfa3908a8573ec24bf17e9a4abff8bba (diff)
downloadgdb-1fe983dcdfa028f072cccfd9f8566bb437d7bb99.zip
gdb-1fe983dcdfa028f072cccfd9f8566bb437d7bb99.tar.gz
gdb-1fe983dcdfa028f072cccfd9f8566bb437d7bb99.tar.bz2
* simops.c: Add logicals, mov, movhi, movea, add, addi, sub
and subr. No condition codes yet.
Diffstat (limited to 'sim/v850')
-rw-r--r--sim/v850/ChangeLog5
-rw-r--r--sim/v850/simops.c182
2 files changed, 147 insertions, 40 deletions
diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog
index 2265550..bfb9946 100644
--- a/sim/v850/ChangeLog
+++ b/sim/v850/ChangeLog
@@ -1,3 +1,8 @@
+Thu Aug 29 13:53:29 1996 Jeffrey A Law (law@cygnus.com)
+
+ * simops.c: Add logicals, mov, movhi, movea, add, addi, sub
+ and subr. No condition codes yet.
+
Wed Aug 28 13:53:22 1996 Jeffrey A Law (law@cygnus.com)
* ChangeLog, Makefile.in, configure, configure.in, v850_sim.h,
diff --git a/sim/v850/simops.c b/sim/v850/simops.c
index 0eb54d8..f286e70 100644
--- a/sim/v850/simops.c
+++ b/sim/v850/simops.c
@@ -3,11 +3,6 @@
#include "simops.h"
void
-OP_1A0 ()
-{
-}
-
-void
OP_280 ()
{
}
@@ -33,11 +28,6 @@ OP_760 ()
}
void
-OP_6A0 ()
-{
-}
-
-void
OP_580 ()
{
}
@@ -148,72 +138,100 @@ OP_660 ()
}
void
-OP_100 ()
+OP_E0 ()
{
}
void
-OP_E0 ()
+OP_16087E0 ()
{
}
void
-OP_16087E0 ()
+OP_16007E0 ()
{
}
+/* add reg, reg
+
+ XXX condition codes. */
void
-OP_16007E0 ()
+OP_1C0 ()
{
+ State.regs[OP[1]] += State.regs[OP[0]];
}
+/* add sign_extend(imm5), reg
+
+ XXX condition codes. */
void
-OP_600 ()
+OP_240 ()
{
+ int value = OP[0];
+
+ value = (value << 27) >> 27;
+
+ State.regs[OP[1]] += value;
}
+/* addi sign_extend(imm16), reg, reg
+
+ XXX condition codes. */
void
-OP_1C0 ()
+OP_600 ()
{
+ int value = OP[0];
+
+ value = (value << 16) >> 16;
+
+ State.regs[OP[2]] = State.regs[OP[1]] + value;
}
+/* sub reg1, reg2
+
+ XXX condition codes */
void
-OP_8007E0 ()
+OP_1A0 ()
{
+ State.regs[OP[1]] -= State.regs[OP[0]];
}
+/* subr reg1, reg2
+
+ XXX condition codes */
void
-OP_C007E0 ()
+OP_180 ()
{
+ State.regs[OP[1]] = State.regs[OP[0]] - State.regs[OP[1]];
}
void
-OP_12007E0 ()
+OP_8007E0 ()
{
}
void
-OP_240 ()
+OP_C007E0 ()
{
}
void
-OP_4007E0 ()
+OP_12007E0 ()
{
}
void
-OP_10720 ()
+OP_4007E0 ()
{
}
void
-OP_780 ()
+OP_10720 ()
{
}
void
-OP_6C0 ()
+OP_780 ()
{
}
@@ -238,42 +256,57 @@ OP_87C0 ()
}
void
-OP_180 ()
-{
-}
-
-void
OP_300 ()
{
}
+/* mov reg, reg */
void
OP_0 ()
{
+ State.regs[OP[1]] = State.regs[OP[0]];
}
+/* mov sign_extend(imm5), reg */
void
-OP_680 ()
+OP_200 ()
{
+ int value = OP[0];
+
+ value = (value << 27) >> 27;
+ State.regs[OP[1]] = value;
}
+/* movea sign_extend(imm16), reg, reg */
+
void
-OP_7C0 ()
+OP_620 ()
{
+ int value = OP[0];
+
+ value = (value << 16) >> 16;
+
+ State.regs[OP[2]] = State.regs[OP[1]] + value;
}
+/* movhi imm16, reg, reg */
void
-OP_120 ()
+OP_640 ()
{
+ int value = OP[0];
+
+ value = (value & 0xffff) << 16;
+
+ State.regs[OP[2]] = State.regs[OP[1]] + value;
}
void
-OP_1687E0 ()
+OP_7C0 ()
{
}
void
-OP_620 ()
+OP_1687E0 ()
{
}
@@ -293,11 +326,6 @@ OP_260 ()
}
void
-OP_200 ()
-{
-}
-
-void
OP_6E0 ()
{
}
@@ -317,9 +345,13 @@ OP_14007E0 ()
{
}
+/* not reg1, reg2
+
+ XXX condition codes */
void
OP_20 ()
{
+ State.regs[OP[1]] = ~State.regs[OP[0]];
}
void
@@ -357,14 +389,70 @@ OP_7E0 ()
{
}
+/* or reg, reg
+
+ XXX condition codes. */
+void
+OP_100 ()
+{
+ State.regs[OP[1]] |= State.regs[OP[0]];
+}
+
+/* ori zero_extend(imm16), reg, reg
+
+ XXX condition codes */
+void
+OP_680 ()
+{
+ int value = OP[0];
+
+ value &= 0xffff;
+
+ State.regs[OP[2]] = State.regs[OP[1]] | value;
+}
+
+/* and reg, reg
+
+ XXX condition codes. */
void
OP_140 ()
{
+ State.regs[OP[1]] &= State.regs[OP[0]];
}
+/* andi zero_extend(imm16), reg, reg
+
+ XXX condition codes. */
void
-OP_640 ()
+OP_6C0 ()
+{
+ int value = OP[0];
+
+ value &= 0xffff;
+
+ State.regs[OP[2]] = State.regs[OP[1]] & value;
+}
+
+/* xor reg, reg
+
+ XXX condition codes. */
+void
+OP_120 ()
{
+ State.regs[OP[1]] ^= State.regs[OP[0]];
+}
+
+/* xori zero_extend(imm16), reg, reg
+
+ XXX condition codes. */
+void
+OP_6A0 ()
+{
+ int value = OP[0];
+
+ value &= 0xffff;
+
+ State.regs[OP[2]] = State.regs[OP[1]] ^ value;
}
void
@@ -372,3 +460,17 @@ OP_C0 ()
{
}
+void
+OP_480 ()
+{
+}
+
+void
+OP_380 ()
+{
+}
+
+void
+OP_501 ()
+{
+}