aboutsummaryrefslogtreecommitdiff
path: root/target-sparc/op_helper.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-04 11:58:45 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-04 11:58:45 +0000
commit7fa76c0bf3b4d6d2d189587aa118fc5fbbef1238 (patch)
tree380e29f42170db4dfe0a8b2ab2dbdef835c03ebd /target-sparc/op_helper.c
parentdb502b6126a66b8a6cbb7bf6294e5b6bd361aa55 (diff)
Complete the TCG conversion
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4323 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sparc/op_helper.c')
-rw-r--r--target-sparc/op_helper.c103
1 files changed, 103 insertions, 0 deletions
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index bc9bb179d6..70e72bb50c 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -2217,6 +2217,109 @@ uint64_t helper_pack64(target_ulong high, target_ulong low)
return ((uint64_t)high << 32) | (uint64_t)(low & 0xffffffff);
}
+#ifdef TARGET_ABI32
+#define ADDR(x) ((x) & 0xffffffff)
+#else
+#define ADDR(x) (x)
+#endif
+
+#ifdef __i386__
+void helper_std_i386(target_ulong addr, int mem_idx)
+{
+ uint64_t tmp = ((uint64_t)env->t1 << 32) | (uint64_t)(env->t2 & 0xffffffff);
+
+#if !defined(CONFIG_USER_ONLY)
+ switch (mem_idx) {
+ case 0:
+ stq_user(ADDR(addr), tmp);
+ break;
+ case 1:
+ stq_kernel(ADDR(addr), tmp);
+ break;
+#ifdef TARGET_SPARC64
+ case 2:
+ stq_hypv(ADDR(addr), tmp);
+ break;
+#endif
+ default:
+ break;
+ }
+#else
+ stq_raw(ADDR(addr), tmp);
+#endif
+}
+#endif /* __i386__ */
+
+void helper_stdf(target_ulong addr, int mem_idx)
+{
+#if !defined(CONFIG_USER_ONLY)
+ switch (mem_idx) {
+ case 0:
+ stfq_user(ADDR(addr), DT0);
+ break;
+ case 1:
+ stfq_kernel(ADDR(addr), DT0);
+ break;
+#ifdef TARGET_SPARC64
+ case 2:
+ stfq_hypv(ADDR(addr), DT0);
+ break;
+#endif
+ default:
+ break;
+ }
+#else
+ stfq_raw(ADDR(addr), DT0);
+#endif
+}
+
+void helper_lddf(target_ulong addr, int mem_idx)
+{
+#if !defined(CONFIG_USER_ONLY)
+ switch (mem_idx) {
+ case 0:
+ DT0 = ldfq_user(ADDR(addr));
+ break;
+ case 1:
+ DT0 = ldfq_kernel(ADDR(addr));
+ break;
+#ifdef TARGET_SPARC64
+ case 2:
+ DT0 = ldfq_hypv(ADDR(addr));
+ break;
+#endif
+ default:
+ break;
+ }
+#else
+ DT0 = ldfq_raw(ADDR(addr));
+#endif
+}
+
+#if defined(CONFIG_USER_ONLY)
+void helper_ldqf(target_ulong addr)
+{
+ // XXX add 128 bit load
+ CPU_QuadU u;
+
+ u.ll.upper = ldq_raw(ADDR(addr));
+ u.ll.lower = ldq_raw(ADDR(addr + 8));
+ QT0 = u.q;
+}
+
+void helper_stqf(target_ulong addr)
+{
+ // XXX add 128 bit store
+ CPU_QuadU u;
+
+ u.q = QT0;
+ stq_raw(ADDR(addr), u.ll.upper);
+ stq_raw(ADDR(addr + 8), u.ll.lower);
+}
+#endif
+
+#undef ADDR
+
void helper_ldfsr(void)
{
int rnd_mode;