From patchwork Tue Oct 15 15:09:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 283685 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BB8C72C00E9 for ; Wed, 16 Oct 2013 02:10:04 +1100 (EST) Received: from localhost ([::1]:42481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW6G2-0000OW-6D for incoming@patchwork.ozlabs.org; Tue, 15 Oct 2013 11:10:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW6FU-0000Eu-TB for qemu-devel@nongnu.org; Tue, 15 Oct 2013 11:09:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VW6FP-0006wC-2W for qemu-devel@nongnu.org; Tue, 15 Oct 2013 11:09:28 -0400 Received: from mail-ee0-f54.google.com ([74.125.83.54]:61096) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW6FO-0006w4-SG for qemu-devel@nongnu.org; Tue, 15 Oct 2013 11:09:22 -0400 Received: by mail-ee0-f54.google.com with SMTP id e53so4113561eek.27 for ; Tue, 15 Oct 2013 08:09:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=bHC6PLx86sNG5qOkPWShwET9WkBz4IAIiAAFJBAQKsI=; b=UO5qgQtY03Phkgiu5rK+UHt/CRjPjm9Qi2dT5pWHYslf7W68bgm36zOOYdSDwUnrcE WMjIou18ajazvtLLW5DSHSLCzsJOroG6ZZIeXOV8J2p0bL72cR1JU1s+f7pDeiD8Wbx6 JnfOwehG41JJxMiRzicdaiw7v0ax8jiQLy3y5mQOfXXNkT2jQ6zCfH3+re7WW28vUEJm c5LKLi2VaK3PShCVRswNKkHZUD3SSGUZqLzWcNk+ZpAf+HyoYiSFHVNLNxJIGTmNz6bi HAP8h0e3VyZC82+nxfQUSxLPYm65aM436f5gBF+LHPKZDi25V8S6qYjw6rFCVNJCCh2/ kX7Q== X-Gm-Message-State: ALoCoQl5am3LA8PO2ev93VknwY5yemMEiyNQ+Braj8gaKwSFyY6NFBUW/W55kWuJrxpCvdjh5Rxc X-Received: by 10.14.183.130 with SMTP id q2mr1329418eem.64.1381849761831; Tue, 15 Oct 2013 08:09:21 -0700 (PDT) Received: from localhost.localdomain (cpc6-seac21-2-0-cust453.7-2.cable.virginmedia.com. [82.1.113.198]) by mx.google.com with ESMTPSA id a1sm167592226eem.1.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 15 Oct 2013 08:09:20 -0700 (PDT) Message-ID: <525D5A9F.9030003@linaro.org> Date: Tue, 15 Oct 2013 16:09:19 +0100 From: Will Newton User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 MIME-Version: 1.0 To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.83.54 Cc: Patch Tracking Subject: [Qemu-devel] [PATCH v5 1/2] target-arm: Move call to disas_vfp_insn out of disas_coproc_insn. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Floating point is an extension to the instruction set rather than a coprocessor, so call it directly from the ARM and Thumb decode functions. Signed-off-by: Will Newton --- target-arm/translate.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) Changes in v5: - Check for high bits set in disas_vfp_insn diff --git a/target-arm/translate.c b/target-arm/translate.c index 5f003e7..c04d2cf 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -2636,6 +2636,13 @@ static int disas_vfp_insn(CPUARMState * env, DisasContext *s, uint32_t insn) && rn != ARM_VFP_MVFR1 && rn != ARM_VFP_MVFR0) return 1; } + + if (extract32(insn, 28, 4) == 0xf) { + /* Encodings with T=1 (Thumb) or unconditional (ARM): + only used in v8 and above. */ + return 1; + } + dp = ((insn & 0xf00) == 0xb00); switch ((insn >> 24) & 0xf) { case 0xe: @@ -6296,9 +6303,6 @@ static int disas_coproc_insn(CPUARMState * env, DisasContext *s, uint32_t insn) return disas_dsp_insn(env, s, insn); } return 1; - case 10: - case 11: - return disas_vfp_insn (env, s, insn); default: break; } @@ -6753,6 +6757,11 @@ static void disas_arm_insn(CPUARMState * env, DisasContext *s) goto illegal_op; return; } + if ((insn & 0x0f000e10) == 0x0e000a00) { + /* VFP. */ + if (disas_vfp_insn(env, s, insn)) + goto illegal_op; + } if (((insn & 0x0f30f000) == 0x0510f000) || ((insn & 0x0f30f010) == 0x0710f000)) { if ((insn & (1 << 22)) == 0) { @@ -8033,9 +8042,15 @@ static void disas_arm_insn(CPUARMState * env, DisasContext *s) case 0xc: case 0xd: case 0xe: - /* Coprocessor. */ - if (disas_coproc_insn(env, s, insn)) + if (((insn >> 8) & 0xe) == 10) { + /* VFP. */ + if (disas_vfp_insn(env, s, insn)) { + goto illegal_op; + } + } else if (disas_coproc_insn(env, s, insn)) { + /* Coprocessor. */ goto illegal_op; + } break; case 0xf: /* swi */ @@ -8765,6 +8780,10 @@ static int disas_thumb2_insn(CPUARMState *env, DisasContext *s, uint16_t insn_hw insn = (insn & 0xe2ffffff) | ((insn & (1 << 28)) >> 4) | (1 << 28); if (disas_neon_data_insn(env, s, insn)) goto illegal_op; + } else if (((insn >> 8) & 0xe) == 10) { + if (disas_vfp_insn(env, s, insn)) { + goto illegal_op; + } } else { if (insn & (1 << 28)) goto illegal_op;