[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v4 03/15] target/ppc: introduce helper_update_ca_legac
From: |
Nikunj A Dadhania |
Subject: |
[Qemu-ppc] [PATCH v4 03/15] target/ppc: introduce helper_update_ca_legacy |
Date: |
Fri, 24 Feb 2017 01:26:28 +0530 |
Update the environment carry variable in the helper.
Signed-off-by: Nikunj A Dadhania <address@hidden>
---
target/ppc/int_helper.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c
index b376860..d7af671 100644
--- a/target/ppc/int_helper.c
+++ b/target/ppc/int_helper.c
@@ -37,6 +37,11 @@ static inline void helper_update_ov_legacy(CPUPPCState *env,
int ov)
}
}
+static inline void helper_update_ca(CPUPPCState *env, int ca)
+{
+ env->ca = ca;
+}
+
target_ulong helper_divweu(CPUPPCState *env, target_ulong ra, target_ulong rb,
uint32_t oe)
{
@@ -213,24 +218,26 @@ target_ulong helper_sraw(CPUPPCState *env, target_ulong
value,
target_ulong shift)
{
int32_t ret;
+ int ca;
if (likely(!(shift & 0x20))) {
if (likely((uint32_t)shift != 0)) {
shift &= 0x1f;
ret = (int32_t)value >> shift;
if (likely(ret >= 0 || (value & ((1 << shift) - 1)) == 0)) {
- env->ca = 0;
+ ca = 0;
} else {
- env->ca = 1;
+ ca = 1;
}
} else {
ret = (int32_t)value;
- env->ca = 0;
+ ca = 0;
}
} else {
ret = (int32_t)value >> 31;
- env->ca = (ret != 0);
+ ca = (ret != 0);
}
+ helper_update_ca(env, ca);
return (target_long)ret;
}
@@ -239,24 +246,26 @@ target_ulong helper_srad(CPUPPCState *env, target_ulong
value,
target_ulong shift)
{
int64_t ret;
+ int ca;
if (likely(!(shift & 0x40))) {
if (likely((uint64_t)shift != 0)) {
shift &= 0x3f;
ret = (int64_t)value >> shift;
if (likely(ret >= 0 || (value & ((1ULL << shift) - 1)) == 0)) {
- env->ca = 0;
+ ca = 0;
} else {
- env->ca = 1;
+ ca = 1;
}
} else {
ret = (int64_t)value;
- env->ca = 0;
+ ca = 0;
}
} else {
ret = (int64_t)value >> 63;
- env->ca = (ret != 0);
+ ca = (ret != 0);
}
+ helper_update_ca(env, ca);
return ret;
}
#endif
--
2.7.4
- [Qemu-ppc] [PATCH v4 00/15] POWER9 TCG enablements - part15, Nikunj A Dadhania, 2017/02/23
- [Qemu-ppc] [PATCH v4 02/15] target/ppc: update ov flag from remaining paths, Nikunj A Dadhania, 2017/02/23
- [Qemu-ppc] [PATCH v4 01/15] target/ppc: introduce helper_update_ov_legacy, Nikunj A Dadhania, 2017/02/23
- [Qemu-ppc] [PATCH v4 12/15] target/ppc: update OV/OV32 for divide operations, Nikunj A Dadhania, 2017/02/23
- [Qemu-ppc] [PATCH v4 11/15] target/ppc: update OV/OV32 for mull[d, w] insns, Nikunj A Dadhania, 2017/02/23
- [Qemu-ppc] [PATCH v4 13/15] target/ppc: update OV/OV32 flags for add/sub, Nikunj A Dadhania, 2017/02/23
- [Qemu-ppc] [PATCH v4 09/15] target/ppc: update ca32 in arithmetic substract, Nikunj A Dadhania, 2017/02/23
- [Qemu-ppc] [PATCH v4 03/15] target/ppc: introduce helper_update_ca_legacy,
Nikunj A Dadhania <=
- [Qemu-ppc] [PATCH v4 05/15] target/ppc: add gen_op_update_ov_legacy() helper, Nikunj A Dadhania, 2017/02/23
- [Qemu-ppc] [PATCH v4 08/15] target/ppc: update ca32 in arithmetic add, Nikunj A Dadhania, 2017/02/23
- [Qemu-ppc] [PATCH v4 07/15] target/ppc: support for 32-bit carry and overflow, Nikunj A Dadhania, 2017/02/23
- [Qemu-ppc] [PATCH v4 06/15] target/ppc: remove xer split-out flags(so, ov, ca), Nikunj A Dadhania, 2017/02/23
- Re: [Qemu-ppc] [PATCH v4 06/15] target/ppc: remove xer split-out flags(so, ov, ca), Richard Henderson, 2017/02/23
- Re: [Qemu-ppc] [PATCH v4 06/15] target/ppc: remove xer split-out flags(so, ov, ca), Nikunj A Dadhania, 2017/02/23
- Re: [Qemu-ppc] [PATCH v4 06/15] target/ppc: remove xer split-out flags(so, ov, ca), David Gibson, 2017/02/23
- Re: [Qemu-ppc] [PATCH v4 06/15] target/ppc: remove xer split-out flags(so, ov, ca), Richard Henderson, 2017/02/24
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v4 06/15] target/ppc: remove xer split-out flags(so, ov, ca), Nikunj A Dadhania, 2017/02/24
- Re: [Qemu-ppc] [Qemu-devel] [PATCH v4 06/15] target/ppc: remove xer split-out flags(so, ov, ca), Nikunj A Dadhania, 2017/02/24