Use unsigned 32-bit load for ld/lduw

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3051 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
blueswir1 2007-07-07 20:50:33 +00:00
parent 6ef905f69c
commit dc011987f2
2 changed files with 14 additions and 1 deletions

View 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);

View 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;