Patchwork [043/111] m68k: on 0 bit shift, don't update X flag

login
register
mail settings
Submitter Bryce Lanham
Date Aug. 17, 2011, 8:46 p.m.
Message ID <1313614076-28878-44-git-send-email-blanham@gmail.com>
Download mbox | patch
Permalink /patch/110481/
State New
Headers show

Comments

Bryce Lanham - Aug. 17, 2011, 8:46 p.m.
From: Laurent Vivier <laurent@vivier.eu>

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target-m68k/helper.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index 451b02a..1c3dd72 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -660,7 +660,7 @@  uint32_t HELPER(glue(glue(shl, bits),_cc))(CPUState *env, uint32_t val, uint32_t
         cf = 0; \
     } \
     env->cc_src = cf; \
-    env->cc_x = (cf != 0); \
+    if (shift) env->cc_x = (cf != 0); \
     env->cc_dest = result; \
     return result; \
 }
@@ -689,7 +689,7 @@  uint32_t HELPER(glue(glue(shr, bits), _cc))(CPUState *env, uint32_t val, uint32_
         cf = 0; \
     } \
     env->cc_src = cf; \
-    env->cc_x = (cf != 0); \
+    if (shift) env->cc_x = (cf != 0); \
     env->cc_dest = result; \
     return result; \
 }
@@ -715,7 +715,7 @@  uint32_t HELPER(glue(glue(sar, bits), _cc))(CPUState *env, uint32_t val, uint32_
         cf = (type)val >> (bits - 1); \
     } \
     env->cc_src = cf; \
-    env->cc_x = cf; \
+    if (shift) env->cc_x = (cf != 0); \
     env->cc_dest = result; \
     return result; \
 }