From patchwork Tue Oct 25 14:50:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 9394795 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0442D60762 for ; Tue, 25 Oct 2016 15:13:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E85F729640 for ; Tue, 25 Oct 2016 15:13:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D5E2729653; Tue, 25 Oct 2016 15:13:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 393D829640 for ; Tue, 25 Oct 2016 15:13:39 +0000 (UTC) Received: from localhost ([::1]:55302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bz3Q2-0002Ak-IY for patchwork-qemu-devel@patchwork.kernel.org; Tue, 25 Oct 2016 11:13:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bz33s-0008Vl-U1 for qemu-devel@nongnu.org; Tue, 25 Oct 2016 10:50:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bz33o-00060k-Hc for qemu-devel@nongnu.org; Tue, 25 Oct 2016 10:50:45 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:60004) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bz33o-0005zJ-7X for qemu-devel@nongnu.org; Tue, 25 Oct 2016 10:50:40 -0400 Received: from Quad.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0M5c8C-1cs6c83Rto-00xbGD; Tue, 25 Oct 2016 16:50:37 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 25 Oct 2016 16:50:14 +0200 Message-Id: <1477407021-30755-17-git-send-email-laurent@vivier.eu> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477407021-30755-1-git-send-email-laurent@vivier.eu> References: <1477407021-30755-1-git-send-email-laurent@vivier.eu> X-Provags-ID: V03:K0:SOJVnAeZD2aGjCP66tAtv4YHWh4pQYOfAcVq/oRPERpzQAwsOSP LYO/4/W7I4iWEHKUrR68mboFiwVl/AAHWg79uzkicK92nrio5CS9XSkMsvNawaKtt/CptS5 BW62eFAG+Ng7yJIFK8ecqCV6pwGJRGCf+yqjwnSJ6ncSlgKVNO2yeW2i3U0723NAmglrK/M jWHxyXdMjL+HDmP3VCq+g== X-UI-Out-Filterresults: notjunk:1; V01:K0:Mg3kjojCJdU=:nfgfMFXNy9fh8FeYkZ+dN5 NkUvzdPs3YIsF+eyhocyuoTT6FoIHrlotY2aflshB6ypkVIZtCkFL70VnCF7r2WPGXDre9aN8 GasFJJ+kmTGoLN5u5DWioHEw58XJaWpAYMQmYzR0IcRcBicOZX+8ZL2HQ6pQTIZuRbOUcJd5d O1RM1tMuwrVlwsO6f7WTsHDXo2rSpgLOY9lWUfSdQYFnmEtmWkW0JNZYJQFVtmpuDUK1F3e0A eW0DQd2iRIB04mCkkGDUJ40tAbeZPBWgm55+9msKLow8JnXy7UZNyswYzg3+88OsbNJJkXDWx QwriH/Ky0ys5Q9m7rQk2B8gPpG38H5ffknT5qoSh2vgbFOUO4O+8RLna3jEwt3tTkRObKOFm6 KB2EhrLJgtJgA0mFcaEgpvGh6Bvbbabgr4Dfo3tjpRcqjP3rVZO2Tnro/tzr0Ik4B041dMLIE e9fXT9Ke9TX4k4yFGI9nTWpD6Fw0n8W3XJTUgEGJufvc/WiWmD13JHqamvnREsXNqJGPeGYkY L2lN4kuzPI8c4EeVd9m9EEDKqhJOPhqwtwqIwStr/S41vsuJiTU75byu87pRs18UJi6hgiCZ6 XpUaDRFNRzpRPXEajzoEWsOaHOZzhsN1GEZzvOVkzSJkKxVy5WxvwebFnaNNIwtqy/SO/RIBv MaGpWlZVjKVwX0blxH5Su/Tiiq4vkOsy+ZFH/HUjoWg0RHCCKcak0QvoT/d8tX9qqoBw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.134 Subject: [Qemu-devel] [PATCH 16/23] target-m68k: Print flags properly X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , gerg@uclinux.org, schwab@linux-m68k.org, agraf@suse.de, Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Laurent Vivier --- target-m68k/cpu.h | 1 + target-m68k/helper.c | 2 +- target-m68k/translate.c | 14 +++++++------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h index f0f670c..2f08a2c 100644 --- a/target-m68k/cpu.h +++ b/target-m68k/cpu.h @@ -158,6 +158,7 @@ M68kCPU *cpu_m68k_init(const char *cpu_model); is returned if the signal was handled by the virtual CPU. */ int cpu_m68k_signal_handler(int host_signum, void *pinfo, void *puc); +uint32_t cpu_m68k_flush_flags(CPUM68KState *env, int op); /* Instead of computing the condition codes after each m68k instruction, diff --git a/target-m68k/helper.c b/target-m68k/helper.c index 0a1ff11..d9ea830 100644 --- a/target-m68k/helper.c +++ b/target-m68k/helper.c @@ -132,7 +132,7 @@ void m68k_cpu_init_gdb(M68kCPU *cpu) /* TODO: Add [E]MAC registers. */ } -static uint32_t cpu_m68k_flush_flags(CPUM68KState *env, int op) +uint32_t cpu_m68k_flush_flags(CPUM68KState *env, int op) { int flags; uint32_t src; diff --git a/target-m68k/translate.c b/target-m68k/translate.c index edd8744..cecd12c 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -3140,15 +3140,15 @@ void m68k_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf, for (i = 0; i < 8; i++) { u.d = env->fregs[i]; - cpu_fprintf (f, "D%d = %08x A%d = %08x F%d = %08x%08x (%12g)\n", - i, env->dregs[i], i, env->aregs[i], - i, u.l.upper, u.l.lower, *(double *)&u.d); + cpu_fprintf(f, "D%d = %08x A%d = %08x F%d = %08x%08x (%12g)\n", + i, env->dregs[i], i, env->aregs[i], + i, u.l.upper, u.l.lower, *(double *)&u.d); } cpu_fprintf (f, "PC = %08x ", env->pc); - sr = env->sr; - cpu_fprintf (f, "SR = %04x %c%c%c%c%c ", sr, (sr & 0x10) ? 'X' : '-', - (sr & CCF_N) ? 'N' : '-', (sr & CCF_Z) ? 'Z' : '-', - (sr & CCF_V) ? 'V' : '-', (sr & CCF_C) ? 'C' : '-'); + sr = env->sr | cpu_m68k_flush_flags(env, env->cc_op) | env->cc_x * CCF_X; + cpu_fprintf(f, "SR = %04x %c%c%c%c%c ", sr, (sr & CCF_X) ? 'X' : '-', + (sr & CCF_N) ? 'N' : '-', (sr & CCF_Z) ? 'Z' : '-', + (sr & CCF_V) ? 'V' : '-', (sr & CCF_C) ? 'C' : '-'); cpu_fprintf (f, "FPRESULT = %12g\n", *(double *)&env->fp_result); }