[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [V2 PATCH 8/8] target-ppc: Bug Fix: srad
From: |
Tom Musta |
Subject: |
[Qemu-ppc] [V2 PATCH 8/8] target-ppc: Bug Fix: srad |
Date: |
Tue, 12 Aug 2014 08:45:10 -0500 |
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.
Example:
R3 8000000000000000
R4 F3511AD4A2CD4C38
srad 3,3,4
Should *not* set XER[CA] but does without this patch.
Signed-off-by: Tom Musta <address@hidden>
---
target-ppc/int_helper.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
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;
--
1.7.1
- Re: [Qemu-ppc] [Qemu-devel] [V2 PATCH 1/8] target-ppc: Bug Fix: rlwinm, (continued)
- [Qemu-ppc] [V2 PATCH 2/8] target-ppc: Bug Fix: rlwnm, Tom Musta, 2014/08/12
- [Qemu-ppc] [V2 PATCH 3/8] target-ppc: Bug Fix: rlwimi, Tom Musta, 2014/08/12
- [Qemu-ppc] [V2 PATCH 4/8] target-ppc: Bug Fix: mullw, Tom Musta, 2014/08/12
- [Qemu-ppc] [V2 PATCH 5/8] target-ppc: Bug Fix: mullwo, Tom Musta, 2014/08/12
- [Qemu-ppc] [V2 PATCH 6/8] target-ppc: Bug Fix: mulldo OV Detection, Tom Musta, 2014/08/12
- [Qemu-ppc] [V2 PATCH 7/8] target-ppc: Bug Fix: srawi, Tom Musta, 2014/08/12
- [Qemu-ppc] [V2 PATCH 8/8] target-ppc: Bug Fix: srad,
Tom Musta <=
- Re: [Qemu-ppc] [V2 PATCH 0/8] target-ppc: Bug Fixes for 64 Bit FXU Instructions, Alexander Graf, 2014/08/12