Commit 06057e6f6ce06b92d552a851a91f9d6ca250970c
1 parent
43e9e742
Fix faligndata (Vince Weaver)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4992 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
4 additions
and
1 deletions
target-sparc/op_helper.c
... | ... | @@ -234,7 +234,10 @@ void helper_faligndata(void) |
234 | 234 | uint64_t tmp; |
235 | 235 | |
236 | 236 | tmp = (*((uint64_t *)&DT0)) << ((env->gsr & 7) * 8); |
237 | - tmp |= (*((uint64_t *)&DT1)) >> (64 - (env->gsr & 7) * 8); | |
237 | + /* on many architectures a shift of 64 does nothing */ | |
238 | + if ((env->gsr & 7) != 0) { | |
239 | + tmp |= (*((uint64_t *)&DT1)) >> (64 - (env->gsr & 7) * 8); | |
240 | + } | |
238 | 241 | *((uint64_t *)&DT0) = tmp; |
239 | 242 | } |
240 | 243 | ... | ... |