aboutsummaryrefslogtreecommitdiff
path: root/target-m68k/cpu.h
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2015-08-14 07:59:20 -0700
committerLaurent Vivier <laurent@vivier.eu>2016-10-25 20:54:47 +0200
commit620c6cf66584bfbee90db84a7e87a6eabf230ca9 (patch)
tree681936c50972ff25b385e52507b374dfd0240646 /target-m68k/cpu.h
parent18dd87f26bed46f22bb1b9536329c02de500f407 (diff)
target-m68k: Reorg flags handling
Separate all ccr bits. Continue to batch updates via cc_op. Signed-off-by: Richard Henderson <rth@twiddle.net> Fix gen_logic_cc() to really extend the size of the result. Fix gen_get_ccr(): update cc_op as it is used by the helper. Factorize flags computing and src/ccr cleanup Signed-off-by: Laurent Vivier <laurent@vivier.eu> target-m68k: sr/ccr cleanup Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'target-m68k/cpu.h')
-rw-r--r--target-m68k/cpu.h46
1 files changed, 22 insertions, 24 deletions
diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h
index c0de97826d..48c5b811f3 100644
--- a/target-m68k/cpu.h
+++ b/target-m68k/cpu.h
@@ -75,9 +75,11 @@ typedef struct CPUM68KState {
/* Condition flags. */
uint32_t cc_op;
- uint32_t cc_dest;
- uint32_t cc_src;
- uint32_t cc_x;
+ uint32_t cc_x; /* always 0/1 */
+ uint32_t cc_n; /* in bit 31 (i.e. negative) */
+ uint32_t cc_v; /* in bit 31, unused, or computed from cc_n and cc_v */
+ uint32_t cc_c; /* either 0/1, unused, or computed from cc_n and cc_v */
+ uint32_t cc_z; /* == 0 or unused */
float64 fregs[8];
float64 fp_result;
@@ -170,27 +172,23 @@ void cpu_m68k_set_ccr(CPUM68KState *env, uint32_t);
* are only needed for conditional branches.
*/
typedef enum {
- CC_OP_DYNAMIC, /* Use env->cc_op */
- CC_OP_FLAGS, /* CC_DEST = CVZN, CC_SRC = unused */
- CC_OP_LOGICB, /* CC_DEST = result, CC_SRC = unused */
- CC_OP_LOGICW, /* CC_DEST = result, CC_SRC = unused */
- CC_OP_LOGIC, /* CC_DEST = result, CC_SRC = unused */
- CC_OP_ADDB, /* CC_DEST = result, CC_SRC = source */
- CC_OP_ADDW, /* CC_DEST = result, CC_SRC = source */
- CC_OP_ADD, /* CC_DEST = result, CC_SRC = source */
- CC_OP_SUBB, /* CC_DEST = result, CC_SRC = source */
- CC_OP_SUBW, /* CC_DEST = result, CC_SRC = source */
- CC_OP_SUB, /* CC_DEST = result, CC_SRC = source */
- CC_OP_ADDXB, /* CC_DEST = result, CC_SRC = source */
- CC_OP_ADDXW, /* CC_DEST = result, CC_SRC = source */
- CC_OP_ADDX, /* CC_DEST = result, CC_SRC = source */
- CC_OP_SUBXB, /* CC_DEST = result, CC_SRC = source */
- CC_OP_SUBXW, /* CC_DEST = result, CC_SRC = source */
- CC_OP_SUBX, /* CC_DEST = result, CC_SRC = source */
- CC_OP_SHIFTB, /* CC_DEST = result, CC_SRC = carry */
- CC_OP_SHIFTW, /* CC_DEST = result, CC_SRC = carry */
- CC_OP_SHIFT, /* CC_DEST = result, CC_SRC = carry */
- CC_OP_NB,
+ /* Translator only -- use env->cc_op. */
+ CC_OP_DYNAMIC = -1,
+
+ /* Each flag bit computed into cc_[xcnvz]. */
+ CC_OP_FLAGS,
+
+ /* X in cc_x, C = X, N in cc_n, Z in cc_n, V via cc_n/cc_v. */
+ CC_OP_ADD,
+ CC_OP_SUB,
+
+ /* X in cc_x, {N,Z,C,V} via cc_n/cc_v. */
+ CC_OP_CMP,
+
+ /* X in cc_x, C = 0, V = 0, N in cc_n, Z in cc_n. */
+ CC_OP_LOGIC,
+
+ CC_OP_NB
} CCOp;
#define CCF_C 0x01