From patchwork Thu Sep 6 10:41:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 11209 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9700323FA9 for ; Thu, 6 Sep 2012 10:41:47 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 51704A18574 for ; Thu, 6 Sep 2012 10:40:51 +0000 (UTC) Received: by ieak11 with SMTP id k11so2531685iea.11 for ; Thu, 06 Sep 2012 03:41:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=FZiPnYU4C2FjFeBAyTwkSxGO3ZBy80BbRcKRzdiDY+s=; b=lgwAMKEFQenB6MLYtjj0s2WCIchiJJ3GN4B7sqGsyClVboJPP0/71WYUVdw1x0jkjd ahio1pX7x1CHerJmp6sbvgmyUV5CUMaTmRNMZXOElMlo/NX2CWx0pmNfab9z7NpzRDQY yDu9MN7z9+AjDXatVejTFv7BiOC7nnp2SFOYNlY5ePVHn8brfdHH0K1wNSh99npEZtq+ y23xttfF4wYlRtaBZPCVsUf24+MA4Am3bwEek3qYt28HfMhhjfHOptsZ9Cfg7utaI3YC lqDjEY7W7MhmByNOzhvyomBr+rtM+ObI/opC/AS6SzZiy1cMhZrqJy0vtfuJT1SLIpfK 9UCA== Received: by 10.50.7.212 with SMTP id l20mr2082936iga.43.1346928106625; Thu, 06 Sep 2012 03:41:46 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp310120igc; Thu, 6 Sep 2012 03:41:45 -0700 (PDT) Received: by 10.216.209.87 with SMTP id r65mr950944weo.42.1346928103671; Thu, 06 Sep 2012 03:41:43 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id l8si4463689wie.36.2012.09.06.03.41.42 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Sep 2012 03:41:43 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1T9ZWn-0003NV-UT; Thu, 06 Sep 2012 11:41:41 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH v2 2/2] target-arm: Reinstate display of VFP registers in cpu_dump_state Date: Thu, 6 Sep 2012 11:41:41 +0100 Message-Id: <1346928101-12958-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1346928101-12958-1-git-send-email-peter.maydell@linaro.org> References: <1346928101-12958-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQmWpCivl/DKwLvrPsu2Po/1f+l5Y+KJ3D+qiyVJyVjxP2oLrGQQa38kBDJxGUUIwoICVpV4 Reinstate the display of VFP registers in cpu_dump_state(), if the CPU has them (this code had been #if 0'd out a for a long time). We drop the attempt ot display the values as floating point, since this makes assumptions about the host 'float' and 'double' formats and is not done by eg the i386 cpu_dump_state(). This display is gated on the CPU_DUMP_FPU flag, as for x86. Signed-off-by: Peter Maydell --- target-arm/translate.c | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index edef79a..2c13af2 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -9970,19 +9970,6 @@ void cpu_dump_state(CPUARMState *env, FILE *f, fprintf_function cpu_fprintf, int flags) { int i; -#if 0 - union { - uint32_t i; - float s; - } s0, s1; - CPU_DoubleU d; - /* ??? This assumes float64 and double have the same layout. - Oh well, it's only debug dumps. */ - union { - float64 f64; - double d; - } d0; -#endif uint32_t psr; for(i=0;i<16;i++) { @@ -10002,20 +9989,23 @@ void cpu_dump_state(CPUARMState *env, FILE *f, fprintf_function cpu_fprintf, psr & CPSR_T ? 'T' : 'A', cpu_mode_names[psr & 0xf], (psr & 0x10) ? 32 : 26); -#if 0 - for (i = 0; i < 16; i++) { - d.d = env->vfp.regs[i]; - s0.i = d.l.lower; - s1.i = d.l.upper; - d0.f64 = d.d; - cpu_fprintf(f, "s%02d=%08x(%8g) s%02d=%08x(%8g) d%02d=%08x%08x(%8g)\n", - i * 2, (int)s0.i, s0.s, - i * 2 + 1, (int)s1.i, s1.s, - i, (int)(uint32_t)d.l.upper, (int)(uint32_t)d.l.lower, - d0.d); + if (flags & CPU_DUMP_FPU) { + int numvfpregs = 0; + if (arm_feature(env, ARM_FEATURE_VFP)) { + numvfpregs += 16; + } + if (arm_feature(env, ARM_FEATURE_VFP3)) { + numvfpregs += 16; + } + for (i = 0; i < numvfpregs; i++) { + uint64_t v = float64_val(env->vfp.regs[i]); + cpu_fprintf(f, "s%02d=%08x s%02d=%08x d%02d=%016" PRIx64 "\n", + i * 2, (uint32_t)v, + i * 2 + 1, (uint32_t)(v >> 32), + i, v); + } + cpu_fprintf(f, "FPSCR: %08x\n", (int)env->vfp.xregs[ARM_VFP_FPSCR]); } - cpu_fprintf(f, "FPSCR: %08x\n", (int)env->vfp.xregs[ARM_VFP_FPSCR]); -#endif } void restore_state_to_opc(CPUARMState *env, TranslationBlock *tb, int pc_pos)