From 68bd052ee124d127bb8b39cda23ae71a8e526825 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sun, 13 Dec 2009 17:48:55 -0800 Subject: [PATCH] target-alpha: Fix cvtlq. We were missing the 0xc0000000 mask, leading to incorrect results. Signed-off-by: Richard Henderson Signed-off-by: Aurelien Jarno --- target-alpha/op_helper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c index 8eba5ec94..ff120ade3 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) -- 2.39.5