Thu Aug 29 13:53:29 1996 Jeffrey A Law (law@cygnus.com)
+ * simops.c: Add multiply & divide support. Abort for system
+ instructions.
+
* simops.c: Add logicals, mov, movhi, movea, add, addi, sub
and subr. No condition codes yet.
{
}
-void
-OP_40 ()
-{
-}
-
void
OP_582 ()
{
{
}
-void
-OP_2E0 ()
-{
-}
-
void
OP_160 ()
{
{
}
-void
-OP_E0 ()
-{
-}
-
-void
-OP_16087E0 ()
-{
-}
-
-void
-OP_16007E0 ()
-{
-}
/* add reg, reg
State.regs[OP[1]] = State.regs[OP[0]] - State.regs[OP[1]];
}
+/* mulh reg1, reg2
+
+ XXX condition codes */
void
-OP_8007E0 ()
+OP_E0 ()
{
+ State.regs[OP[1]] = ((State.regs[OP[1]] & 0xffff)
+ * (State.regs[OP[2]] & 0xffff));
}
+/* mulh sign_extend(imm5), reg2
+
+ Condition codes */
void
-OP_C007E0 ()
+OP_2E0 ()
{
+ int value = OP[0];
+
+ value = (value << 27) >> 27;
+
+ State.regs[OP[1]] = (State.regs[OP[1]] & 0xffff) * value;
}
+/* mulhi imm16, reg1, reg2
+
+ XXX condition codes */
void
-OP_12007E0 ()
+OP_6E0 ()
+{
+ int value = OP[0];
+
+ value = value & 0xffff;
+
+ State.regs[OP[1]] = (State.regs[OP[1]] & 0xffff) * value;
+}
+
+/* divh reg1, reg2
+
+ XXX condition codes.
+ XXX Is this signed or unsigned? */
+void
+OP_40 ()
{
+ State.regs[OP[1]] /= (State.regs[OP[1]] & 0xffff);
}
void
-OP_4007E0 ()
+OP_8007E0 ()
+{
+}
+
+void
+OP_C007E0 ()
{
}
{
}
-void
-OP_6E0 ()
-{
-}
-
void
OP_740 ()
{
{
}
-void
-OP_14007E0 ()
-{
-}
-
/* not reg1, reg2
XXX condition codes */
{
}
-void
-OP_10007E0 ()
-{
-}
-
void
OP_47C0 ()
{
}
-void
-OP_2007E0 ()
-{
-}
-
void
OP_7E0 ()
{
OP_501 ()
{
}
+
+/* di, not supported */
+void
+OP_16007E0 ()
+{
+ abort ();
+}
+
+/* ei, not supported */
+void
+OP_16087E0 ()
+{
+ abort ();
+}
+
+/* halt, not supported */
+void
+OP_12007E0 ()
+{
+ abort ();
+}
+
+/* reti, not supported */
+void
+OP_14007E0 ()
+{
+ abort ();
+}
+
+/* trap, not supportd */
+void
+OP_10007E0 ()
+{
+ abort ();
+}
+
+/* ldsr, not supported */
+void
+OP_2007E0 ()
+{
+ abort ();
+}
+
+/* stsr, not supported */
+void
+OP_4007E0 ()
+{
+ abort ();
+}
+