diff options
author | Richard Henderson <rth@twiddle.net> | 2009-12-13 17:48:55 -0800 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2009-12-17 18:12:04 +0100 |
commit | 81ab83fcd3fa8bfd6d255680533364551e7584ed (patch) | |
tree | edbf3a6830bfcc2ce5092d493b356a2be4ff1bf0 /target-alpha | |
parent | 9a931b95c0ddaa1c183ba06410190bf82b539478 (diff) | |
download | qemu-81ab83fcd3fa8bfd6d255680533364551e7584ed.tar.gz qemu-81ab83fcd3fa8bfd6d255680533364551e7584ed.tar.bz2 qemu-81ab83fcd3fa8bfd6d255680533364551e7584ed.zip |
target-alpha: Fix cvtlq.
We were missing the 0xc0000000 mask, leading to incorrect results.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'target-alpha')
-rw-r--r-- | target-alpha/op_helper.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c index 8eba5ec94e..ff120ade3b 100644 --- a/target-alpha/op_helper.c +++ b/target-alpha/op_helper.c @@ -954,7 +954,9 @@ uint64_t helper_cvtqg (uint64_t a) uint64_t helper_cvtlq (uint64_t a) { - return (int64_t)((int32_t)((a >> 32) | ((a >> 29) & 0x3FFFFFFF))); + int32_t lo = a >> 29; + int32_t hi = a >> 32; + return (lo & 0x3FFFFFFF) | (hi & 0xc0000000); } static inline uint64_t __helper_cvtql(uint64_t a, int s, int v) |