aboutsummaryrefslogtreecommitdiff
path: root/target-sparc/op.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-04-01 15:38:17 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2007-04-01 15:38:17 +0000
commit8a08f9a809f8613bb7d6c3e9389812f1b043c846 (patch)
tree6602817c7ff252385be4b2e4dced27a5f7503488 /target-sparc/op.c
parentd4218d996d2274f4136b8bd22e946bf56f050c9e (diff)
downloadqemu-8a08f9a809f8613bb7d6c3e9389812f1b043c846.zip
qemu-8a08f9a809f8613bb7d6c3e9389812f1b043c846.tar.gz
qemu-8a08f9a809f8613bb7d6c3e9389812f1b043c846.tar.bz2
Fix Sparc shift ops (Aurelien Jarno)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2569 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sparc/op.c')
-rw-r--r--target-sparc/op.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/target-sparc/op.c b/target-sparc/op.c
index 5c6e539..2c89490 100644
--- a/target-sparc/op.c
+++ b/target-sparc/op.c
@@ -965,38 +965,43 @@ void OPPROTO op_logic_T0_cc(void)
void OPPROTO op_sll(void)
{
- T0 <<= T1;
+ T0 <<= (T1 & 0x1f);
}
#ifdef TARGET_SPARC64
+void OPPROTO op_sllx(void)
+{
+ T0 <<= (T1 & 0x3f);
+}
+
void OPPROTO op_srl(void)
{
- T0 = (T0 & 0xffffffff) >> T1;
+ T0 = (T0 & 0xffffffff) >> (T1 & 0x1f);
}
void OPPROTO op_srlx(void)
{
- T0 >>= T1;
+ T0 >>= (T1 & 0x3f);
}
void OPPROTO op_sra(void)
{
- T0 = ((int32_t) (T0 & 0xffffffff)) >> T1;
+ T0 = ((int32_t) (T0 & 0xffffffff)) >> (T1 & 0x1f);
}
void OPPROTO op_srax(void)
{
- T0 = ((int64_t) T0) >> T1;
+ T0 = ((int64_t) T0) >> (T1 & 0x3f);
}
#else
void OPPROTO op_srl(void)
{
- T0 >>= T1;
+ T0 >>= (T1 & 0x1f);
}
void OPPROTO op_sra(void)
{
- T0 = ((int32_t) T0) >> T1;
+ T0 = ((int32_t) T0) >> (T1 & 0x1f);
}
#endif