From patchwork Wed Dec 4 11:54:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 22009 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 2956A202E0 for ; Wed, 4 Dec 2013 11:55:09 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wm4sf50243994obc.3 for ; Wed, 04 Dec 2013 03:55:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=U1Sl2MEJvoEbXHJuchbnUQD4XIQHRt3IIEuVbKGoxcE=; b=cAL5Y+g/Ow5HRUIfANhNZw2+pG+PVn6p93VsaZ3P6OEpWofKhBopjErQbjTA1BJjeX vj6mcbTdkswYwsMqmSB9JUKaCFt9fKNI2R54sUeYlHxdO7fpWKRJisIH7eOhhfxflgGQ V5GTXUiakpD7ABZSbmNIDonyXyla5nTYdkcDSQQ5O/iIfwqWBhfDqeRG3nsZQOaLSxKT WrVNpj35/afo7QRp2uT9TgICFSxkGISBihJSkcASt8RqIWgljqLRgqBYsDZF6C43CKFE kuj2rCAU+8iFWzWGLvu27Sqj80GW0YDl+6p9XpLScywWOEq4CC56H0F1hxkTgSI7VJDM KWwQ== X-Gm-Message-State: ALoCoQmT25FEkp1Xn8MhadF9bPVU+HQNqKaL5cRoBEOJdsDUDamCYp3XM8vySuvLlV/CBUm6cT/U X-Received: by 10.50.114.66 with SMTP id je2mr221311igb.5.1386158108295; Wed, 04 Dec 2013 03:55:08 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.116.42 with SMTP id jt10ls215336qeb.66.gmail; Wed, 04 Dec 2013 03:55:08 -0800 (PST) X-Received: by 10.52.78.193 with SMTP id d1mr266873vdx.57.1386158108177; Wed, 04 Dec 2013 03:55:08 -0800 (PST) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id sl9si18006664vdc.73.2013.12.04.03.55.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Dec 2013 03:55:08 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id oy12so12051957veb.12 for ; Wed, 04 Dec 2013 03:55:08 -0800 (PST) X-Received: by 10.58.146.71 with SMTP id ta7mr9182834veb.23.1386158107973; Wed, 04 Dec 2013 03:55:07 -0800 (PST) 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 u4csp285946vcz; Wed, 4 Dec 2013 03:55:07 -0800 (PST) X-Received: by 10.180.36.40 with SMTP id n8mr3630582wij.54.1386158106637; Wed, 04 Dec 2013 03:55:06 -0800 (PST) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by mx.google.com with ESMTPS id bj10si32605591wjb.141.2013.12.04.03.55.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Dec 2013 03:55:06 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.177 is neither permitted nor denied by best guess record for domain of will.newton@linaro.org) client-ip=209.85.212.177; Received: by mail-wi0-f177.google.com with SMTP id cc10so8027321wib.10 for ; Wed, 04 Dec 2013 03:55:06 -0800 (PST) X-Received: by 10.180.187.175 with SMTP id ft15mr6957579wic.20.1386158106091; Wed, 04 Dec 2013 03:55:06 -0800 (PST) Received: from localhost.localdomain (cpc6-seac21-2-0-cust453.7-2.cable.virginm.net. [82.1.113.198]) by mx.google.com with ESMTPSA id qc10sm6258318wic.9.2013.12.04.03.55.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Dec 2013 03:55:05 -0800 (PST) From: Will Newton To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH v8 1/6] target-arm: Move call to disas_vfp_insn out of disas_coproc_insn. Date: Wed, 4 Dec 2013 11:54:54 +0000 Message-Id: <1386158099-9239-2-git-send-email-will.newton@linaro.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1386158099-9239-1-git-send-email-will.newton@linaro.org> References: <1386158099-9239-1-git-send-email-will.newton@linaro.org> 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.128.181 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 Reviewed-by: Peter Maydell --- target-arm/translate.c | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/target-arm/translate.c b/target-arm/translate.c index 5f003e7..f63e89d 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -2636,6 +2636,14 @@ 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 +6304,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 +6758,13 @@ 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; + } + return; + } if (((insn & 0x0f30f000) == 0x0510f000) || ((insn & 0x0f30f010) == 0x0710f000)) { if ((insn & (1 << 22)) == 0) { @@ -8033,9 +8045,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 +8783,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;