summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/drcuml.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-07-24 06:26:47 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-07-24 06:26:47 +0000
commit0b77a69691d6c7ef7117f9c141bd1301d083011c (patch)
tree44a4d7c1042bd2941364ccad406c9e72bfabc3ff /src/emu/cpu/drcuml.c
parent9b63c422030b302154ad57541ccc5375cdc7e215 (diff)
From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] Conditional code cleanup resubmit Hi mamedev, This is a resubmit of a previous patch. The earlier version would not compile with 32-bit MSVC, due to the fact that its linker required external dependencies in dead code to be met before dead code elimination was done, causing linker errors. The proper fix for this would be to add the necessary dependencies, so I instead simply left the conditional code in place in winalloc.c and chd.c. ~aa Original submission email below: ---- Conditionally compiled code tends to bitrot, so MAME should try to avoid it as much as possible. I sent a patch six months ago to eliminate conditional code associated with logging, here's another patch that does more of this. Some notes: 1. drc_ops.c: I couldn't find a LOG_CODE anywhere, so I used if (0). 2. romload.c: I converted all the users of debugload to use LOG((...)) instead, following the traditional conditional logging pattern. 3. windows/sound.c: I eliminated the separate sound log and directed the few outputs to the error log. ~aa
Diffstat (limited to 'src/emu/cpu/drcuml.c')
-rw-r--r--src/emu/cpu/drcuml.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/emu/cpu/drcuml.c b/src/emu/cpu/drcuml.c
index a3e46bfbcf9..1a85d93f0e9 100644
--- a/src/emu/cpu/drcuml.c
+++ b/src/emu/cpu/drcuml.c
@@ -1369,9 +1369,7 @@ static void simplify_instruction_with_no_flags(drcuml_block *block, drcuml_instr
static const UINT64 instsizemask[] = { 0, 0, 0, 0, 0xffffffff, 0, 0, 0, U64(0xffffffffffffffff) };
static const UINT64 paramsizemask[] = { 0xff, 0xffff, 0xffffffff, U64(0xffffffffffffffff) };
drcuml_opcode origop = inst->opcode;
-#if LOG_SIMPLIFICATIONS
drcuml_instruction orig = *inst;
-#endif
switch (inst->opcode)
{
@@ -1688,15 +1686,13 @@ static void simplify_instruction_with_no_flags(drcuml_block *block, drcuml_instr
break;
}
-#if LOG_SIMPLIFICATIONS
- if (memcmp(&orig, inst, sizeof(orig)) != 0)
+ if (LOG_SIMPLIFICATIONS && memcmp(&orig, inst, sizeof(orig)) != 0)
{
char disasm1[256], disasm2[256];
drcuml_disasm(&orig, disasm1, block->drcuml);
drcuml_disasm(inst, disasm2, block->drcuml);
mame_printf_debug("Simplified: %-50.50s -> %s\n", disasm1, disasm2);
}
-#endif
/* if the opcode changed, validate and reoptimize */
if (inst->opcode != origop)