diff mbox

[8/8] target-ppc: Bug Fix: srad

Message ID 1407785009-6538-9-git-send-email-tommusta@gmail.com
State New
Headers show

Commit Message

Tom Musta Aug. 11, 2014, 7:23 p.m. UTC
Fix the check for carry in the srad helper to properly construct
the mask -- a "1ULL" must be used (instead of "1") in order to
get the desired result.

Signed-off-by: Tom Musta <tommusta@gmail.com>
---
 target-ppc/int_helper.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Richard Henderson Aug. 15, 2014, 8:17 p.m. UTC | #1
On 08/11/2014 09:23 AM, Tom Musta wrote:
> Fix the check for carry in the srad helper to properly construct
> the mask -- a "1ULL" must be used (instead of "1") in order to
> get the desired result.
> 
> Signed-off-by: Tom Musta <tommusta@gmail.com>
> ---
>  target-ppc/int_helper.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~
diff mbox

Patch

diff --git a/target-ppc/int_helper.c b/target-ppc/int_helper.c
index e83a25d..e5b103b 100644
--- a/target-ppc/int_helper.c
+++ b/target-ppc/int_helper.c
@@ -248,7 +248,7 @@  target_ulong helper_srad(CPUPPCState *env, target_ulong value,
         if (likely((uint64_t)shift != 0)) {
             shift &= 0x3f;
             ret = (int64_t)value >> shift;
-            if (likely(ret >= 0 || (value & ((1 << shift) - 1)) == 0)) {
+            if (likely(ret >= 0 || (value & ((1ULL << shift) - 1)) == 0)) {
                 env->ca = 0;
             } else {
                 env->ca = 1;