Use unsigned 32-bit load for ld/lduw
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 7 Jul 2007 20:50:33 +0000 (20:50 +0000)
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 7 Jul 2007 20:50:33 +0000 (20:50 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3051 c046a42c-6fe2-441c-8c8c-71466251a162

target-sparc/op_mem.h
target-sparc/translate.c

index f5dbd2605f2de858093b4c3122eee23ffd9fcbcb..a175d0d591e4433ebf86eecd099c409f09d430cd 100644 (file)
@@ -103,6 +103,11 @@ void OPPROTO glue(op_casx, MEMSUFFIX)(void)
     T2 = tmp;
 }
 
+void OPPROTO glue(op_lduw, MEMSUFFIX)(void)
+{
+    T1 = (uint64_t)(glue(ldl, MEMSUFFIX)(T0) & 0xffffffff);
+}
+
 void OPPROTO glue(op_ldsw, MEMSUFFIX)(void)
 {
     T1 = (int64_t)(glue(ldl, MEMSUFFIX)(T0) & 0xffffffff);
index a2f3d5bd34d55577693296a862d88f2141fcc6e7..074ed21fdd698ae371d7e9b300f876d746fe0395 100644 (file)
@@ -470,6 +470,7 @@ OP_LD_TABLE(ldf);
 OP_LD_TABLE(lddf);
 
 #ifdef TARGET_SPARC64
+OP_LD_TABLE(lduw);
 OP_LD_TABLE(ldsw);
 OP_LD_TABLE(ldx);
 OP_LD_TABLE(stx);
@@ -2810,7 +2811,11 @@ static void disas_sparc_insn(DisasContext * dc)
                 (xop > 0x2c && xop <= 0x33) || xop == 0x1f || xop == 0x3d) {
                switch (xop) {
                case 0x0:       /* load word */
+#ifndef TARGET_SPARC64
                    gen_op_ldst(ld);
+#else
+                    gen_op_ldst(lduw);
+#endif
                    break;
                case 0x1:       /* load unsigned byte */
                    gen_op_ldst(ldub);
@@ -2844,8 +2849,10 @@ static void disas_sparc_insn(DisasContext * dc)
                        goto illegal_insn;
                    if (!supervisor(dc))
                        goto priv_insn;
-#endif
                    gen_op_lda(insn, 1, 4, 0);
+#else
+                    gen_op_lduwa(insn, 1, 4, 0);
+#endif
                    break;
                case 0x11:      /* load unsigned byte alternate */
 #ifndef TARGET_SPARC64
@@ -2926,6 +2933,7 @@ static void disas_sparc_insn(DisasContext * dc)
                     (void) &gen_op_ldfa;
                     (void) &gen_op_lddfa;
 #else
+                    (void) &gen_op_lda;
 #if !defined(CONFIG_USER_ONLY)
                    (void) &gen_op_cas;
                    (void) &gen_op_casx;