aboutsummaryrefslogtreecommitdiff
path: root/target-sparc/op_mem.h
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-09-30 21:55:55 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-09-30 21:55:55 +0000
commite8af50a30e89e5cfdc1b2a2fa8fab3ce463a4790 (patch)
tree76f103d3b64b539327039c409c254948b8121cfc /target-sparc/op_mem.h
parent525d67bcc81f34e5d9fe1ac89e9b065b891a1b97 (diff)
downloadqemu-e8af50a30e89e5cfdc1b2a2fa8fab3ce463a4790.zip
qemu-e8af50a30e89e5cfdc1b2a2fa8fab3ce463a4790.tar.gz
qemu-e8af50a30e89e5cfdc1b2a2fa8fab3ce463a4790.tar.bz2
full system SPARC emulation (Blue Swirl)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1083 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sparc/op_mem.h')
-rw-r--r--target-sparc/op_mem.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/target-sparc/op_mem.h b/target-sparc/op_mem.h
new file mode 100644
index 0000000..9c839a0
--- /dev/null
+++ b/target-sparc/op_mem.h
@@ -0,0 +1,71 @@
+/*** Integer load ***/
+#define SPARC_LD_OP(name, qp) \
+void OPPROTO glue(glue(op_, name), MEMSUFFIX)(void) \
+{ \
+ T1 = glue(qp, MEMSUFFIX)((void *)T0); \
+}
+
+#define SPARC_ST_OP(name, op) \
+void OPPROTO glue(glue(op_, name), MEMSUFFIX)(void) \
+{ \
+ glue(op, MEMSUFFIX)((void *)T0, T1); \
+}
+
+SPARC_LD_OP(ld, ldl);
+SPARC_LD_OP(ldub, ldub);
+SPARC_LD_OP(lduh, lduw);
+SPARC_LD_OP(ldsb, ldsb);
+SPARC_LD_OP(ldsh, ldsw);
+
+/*** Integer store ***/
+SPARC_ST_OP(st, stl);
+SPARC_ST_OP(stb, stb);
+SPARC_ST_OP(sth, stw);
+
+void OPPROTO glue(op_std, MEMSUFFIX)(void)
+{
+ glue(stl, MEMSUFFIX)((void *) T0, T1);
+ glue(stl, MEMSUFFIX)((void *) (T0 + 4), T2);
+}
+
+void OPPROTO glue(op_ldstub, MEMSUFFIX)(void)
+{
+ T1 = glue(ldub, MEMSUFFIX)((void *) T0);
+ glue(stb, MEMSUFFIX)((void *) T0, 0xff); /* XXX: Should be Atomically */
+}
+
+void OPPROTO glue(op_swap, MEMSUFFIX)(void)
+{
+ unsigned int tmp = glue(ldl, MEMSUFFIX)((void *) T0);
+ glue(stl, MEMSUFFIX)((void *) T0, T1); /* XXX: Should be Atomically */
+ T1 = tmp;
+}
+
+void OPPROTO glue(op_ldd, MEMSUFFIX)(void)
+{
+ T1 = glue(ldl, MEMSUFFIX)((void *) T0);
+ T0 = glue(ldl, MEMSUFFIX)((void *) (T0 + 4));
+}
+
+/*** Floating-point store ***/
+void OPPROTO glue(op_stf, MEMSUFFIX) (void)
+{
+ glue(stfl, MEMSUFFIX)((void *) T0, FT0);
+}
+
+void OPPROTO glue(op_stdf, MEMSUFFIX) (void)
+{
+ glue(stfq, MEMSUFFIX)((void *) T0, DT0);
+}
+
+/*** Floating-point load ***/
+void OPPROTO glue(op_ldf, MEMSUFFIX) (void)
+{
+ FT0 = glue(ldfl, MEMSUFFIX)((void *) T0);
+}
+
+void OPPROTO glue(op_lddf, MEMSUFFIX) (void)
+{
+ DT0 = glue(ldfq, MEMSUFFIX)((void *) T0);
+}
+#undef MEMSUFFIX