Skip to content

Commit

Permalink
target-alpha: Fix cvtlq.
Browse files Browse the repository at this point in the history
We were missing the 0xc0000000 mask, leading to incorrect results.

Signed-off-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
  • Loading branch information
rth7680 authored and aurel32 committed Dec 17, 2009
1 parent 0644524 commit 68bd052
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion target-alpha/op_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 68bd052

Please sign in to comment.