summaryrefslogtreecommitdiff
path: root/target-mips/op.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-04-05 23:20:05 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-04-05 23:20:05 +0000
commit5a63bcb2d27675a3fc2c5bc8a8c323e5c756e749 (patch)
treef25e4c5339ff58b3b475676dfd1341ed3b2dd7b7 /target-mips/op.c
parentacd858d91f73fe310627e2b92a8fdd529ec06ade (diff)
downloadqemu-5a63bcb2d27675a3fc2c5bc8a8c323e5c756e749.tar.gz
Fix rotr immediate ops, mask shift/rotate arguments to their allowed
size. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2614 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips/op.c')
-rw-r--r--target-mips/op.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/target-mips/op.c b/target-mips/op.c
index d09b8da2df..d440896f32 100644
--- a/target-mips/op.c
+++ b/target-mips/op.c
@@ -493,19 +493,19 @@ void op_xor (void)
void op_sll (void)
{
- T0 = (int32_t)((uint32_t)T0 << (uint32_t)T1);
+ T0 = (int32_t)((uint32_t)T0 << T1);
RETURN();
}
void op_sra (void)
{
- T0 = (int32_t)((int32_t)T0 >> (uint32_t)T1);
+ T0 = (int32_t)((int32_t)T0 >> T1);
RETURN();
}
void op_srl (void)
{
- T0 = (int32_t)((uint32_t)T0 >> (uint32_t)T1);
+ T0 = (int32_t)((uint32_t)T0 >> T1);
RETURN();
}
@@ -514,10 +514,9 @@ void op_rotr (void)
target_ulong tmp;
if (T1) {
- tmp = (int32_t)((uint32_t)T0 << (0x20 - (uint32_t)T1));
- T0 = (int32_t)((uint32_t)T0 >> (uint32_t)T1) | tmp;
- } else
- T0 = T1;
+ tmp = (int32_t)((uint32_t)T0 << (0x20 - T1));
+ T0 = (int32_t)((uint32_t)T0 >> T1) | tmp;
+ }
RETURN();
}
@@ -707,8 +706,7 @@ void op_drotr (void)
if (T1) {
tmp = T0 << (0x40 - T1);
T0 = (T0 >> T1) | tmp;
- } else
- T0 = T1;
+ }
RETURN();
}
@@ -719,8 +717,7 @@ void op_drotr32 (void)
if (T1) {
tmp = T0 << (0x40 - (32 + T1));
T0 = (T0 >> (32 + T1)) | tmp;
- } else
- T0 = T1;
+ }
RETURN();
}