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: 21042 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3D87F20D9F for ; Tue, 15 Oct 2013 15:09:25 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wp18sf2692387obc.11 for ; Tue, 15 Oct 2013 08:09:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=bHC6PLx86sNG5qOkPWShwET9WkBz4IAIiAAFJBAQKsI=; b=mDOC4JkTv7MOTsVyKtCC3ryvAlvL5enTCxYdjvYgAZhO6bXephU5ioJZ0OLMHLQv+c +ghnmtMu/KuBNkhV7liuT3mA8vEFhUeBkIVQ/tZH+Sl9AMsRe6GZsTHgRG74Txi2J6gf cjiPmSAThbFYkUlHr2QTJXv2R5xoqHckXdvmkJRhSKL89ReKGw8G3U4WyseIuGIGKKxl APPxMRC1TMq6N9blvEmB15DX4lltwPZNbRGUdOC3RzNsH8/ci4xoRbxHd3Ud8PqEnyjt 2R9tYx5Njj26xTo8r09SR6hc577iE0N3OCEbf1tV4Wnl1TTmhNgpov+VbOeZDMUxX/Kz MUsg== X-Received: by 10.50.3.40 with SMTP id 8mr1212308igz.1.1381849764262; Tue, 15 Oct 2013 08:09:24 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.35.10 with SMTP id d10ls148625qej.19.gmail; Tue, 15 Oct 2013 08:09:24 -0700 (PDT) X-Received: by 10.58.67.9 with SMTP id j9mr12195207vet.3.1381849764153; Tue, 15 Oct 2013 08:09:24 -0700 (PDT) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by mx.google.com with ESMTPS id zw10si22921331vdb.44.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Oct 2013 08:09:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.42 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.42; Received: by mail-vb0-f42.google.com with SMTP id e12so5352551vbg.29 for ; Tue, 15 Oct 2013 08:09:24 -0700 (PDT) X-Gm-Message-State: ALoCoQkRZy7Tq4iEAm/U0k5d8gF5PdZ+twhY1H5ZkptMUZcA/7tMUmFiC2SeLePy+vhSzaOddnVE X-Received: by 10.52.26.69 with SMTP id j5mr1806890vdg.21.1381849764042; Tue, 15 Oct 2013 08:09:24 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp306570vcz; Tue, 15 Oct 2013 08:09:23 -0700 (PDT) X-Received: by 10.14.204.5 with SMTP id g5mr17711eeo.110.1381849762261; Tue, 15 Oct 2013 08:09:22 -0700 (PDT) Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com [74.125.83.43]) by mx.google.com with ESMTPS id k49si57497232een.322.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Oct 2013 08:09:22 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.43 is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=74.125.83.43; Received: by mail-ee0-f43.google.com with SMTP id e52so4084741eek.30 for ; Tue, 15 Oct 2013 08:09:21 -0700 (PDT) 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 CC: Patch Tracking Subject: [PATCH v5 1/2] target-arm: Move call to disas_vfp_insn out of disas_coproc_insn. X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: will.newton@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.42 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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;