From patchwork Mon Dec 18 17:24:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 122283 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3143612qgn; Mon, 18 Dec 2017 10:01:52 -0800 (PST) X-Google-Smtp-Source: ACJfBouIWKnzi9L+kLrOM7N39JhETqaAic5fwQj3SFKpzH6G0uq6y6Wya7APlUm3MDSW92GKXnqI X-Received: by 10.37.38.75 with SMTP id m72mr519417ybm.155.1513620112575; Mon, 18 Dec 2017 10:01:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513620112; cv=none; d=google.com; s=arc-20160816; b=fJMFk4YSmo3GPKYcgAfa6qfjXjQ0bGjoOqaKizjgdPrbWO4FOkmzciBcc6b6ZNzqdf CMlxQGep8SBLITzqFS4JuGUzfQCYVNSP7m5+auzxJFeyKQG59Loe7BkoDNUxI9tXE5lg ErDklw8szEr4dh8xgGOevDusns7Mohowyz5/CxeLYrQFm9TDAVcqzc7NHu90Tgf6+Qma u+wwtzF9E4dJx32wznM4Yov4qwV/A82PSrHXWjC0q/zLSDDa1GI0hRLZZ30nkI6W3+lx V2QccJcoypUSRCyUZjdnrTQPU6TPJN7jT8RXZul3mN7WBeYIc607ptl93b4l5yOT6/dr rx5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=gAw2GU1hArBTBiaBmC/mbH2LgFYCyNViMQ9q1WhHXJ0=; b=HIKZ4xYFuw8STcjRwXP0ftMopPmggLyAiKkebRfHDf+/30sVROYey3W0OZaFIGCsKl FGclvDAkjlpReoVAhJzw9UVZdIMmY5gcJu4nTU2ILE8t03eE6C3j7x4/jnpCr+Wn7y25 5K+nYg5ZE577m57VZkzsWwdNx2u4zDQy7w5Ytr24r5vqErW7SN1BI1ogrQFISD9qORYa Fa9LWRP10Rlv6ZYfGGKWZVKDXIB4cnnqh2xXKo+3PMskxGcefDVe2KIzuyTuGd5V2DYg Elq1ctmGE2B8UF0M//vWWU3CyxK86HS0Kr1H59wNtPEMP5aiVjBYZi4TimsfMZ14l1yb XXoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iok9JsDG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g9si2536718ybc.19.2017.12.18.10.01.52 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Dec 2017 10:01:52 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iok9JsDG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQzjc-0004V4-40 for patch@linaro.org; Mon, 18 Dec 2017 13:01:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQz9i-00066h-0b for qemu-devel@nongnu.org; Mon, 18 Dec 2017 12:24:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQz9h-0008Md-5d for qemu-devel@nongnu.org; Mon, 18 Dec 2017 12:24:45 -0500 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:44916) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eQz9h-0008LW-0f for qemu-devel@nongnu.org; Mon, 18 Dec 2017 12:24:45 -0500 Received: by mail-pf0-x244.google.com with SMTP id m26so9933894pfj.11 for ; Mon, 18 Dec 2017 09:24:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gAw2GU1hArBTBiaBmC/mbH2LgFYCyNViMQ9q1WhHXJ0=; b=iok9JsDGp2a8Z3xdVJZ4/LUedqb1GdV6BREM1Fi1oToE+ihvLYcRhehXef71U6mTI0 y3ugiwWy2ubaECutob6q2yQrs4fG4/NoINmSaKLZGTASmI2R8kjDwmtErdbZvNmxb4OJ clHUxSX2HqdKWgNZwikHzYiuhRvZO2RHeffGA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gAw2GU1hArBTBiaBmC/mbH2LgFYCyNViMQ9q1WhHXJ0=; b=pr1KF6hy4HS6cm06//QaecYZ6TqQmp2AHvXosf0RZDQTJ1LRQO1Y90Z2L/bpTyZqAY azS30zCYOdkQNfdKUahc75ZTfRCrHa9rcmTXsGp3tC5C3zYFgAFw6tKcHNBGCX9EuX7s s9JF8dEXEsQmk77lU5WvaiboQgBW4DbY/2JHqD20AdBkJo/E+fDRbySrd0Mjw5ILwsDc Zxhfw4kdQKvCG6eEQ8y4Q3k06gjYshzjAaLZIBIYNrUVijLHcqs9B2A7VTt0wGpQ39P6 anGaJQVcbaTjrjXAisR7pqwL0Zr5Msmwujl1IVRbTEXCW9YoQSwdR5mjjy8szvuNxodl hmsw== X-Gm-Message-State: AKGB3mLcPKKS85+20hQb8GotCek69R+EE0Kj4zafYlPe9UwDtq/bjDgz x7T4sRs2TyTOI6PjaKpRfjEyhorI+J8= X-Received: by 10.99.176.76 with SMTP id z12mr376467pgo.358.1513617883767; Mon, 18 Dec 2017 09:24:43 -0800 (PST) Received: from cloudburst.twiddle.net (174-21-7-63.tukw.qwest.net. [174.21.7.63]) by smtp.gmail.com with ESMTPSA id m10sm9260469pgs.4.2017.12.18.09.24.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Dec 2017 09:24:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 18 Dec 2017 09:24:25 -0800 Message-Id: <20171218172425.18200-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171218172425.18200-1-richard.henderson@linaro.org> References: <20171218172425.18200-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PATCH v2 11/11] target/arm: Decode aa32 armv8.3 2-reg-index 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: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/arm/translate.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) -- 2.14.3 diff --git a/target/arm/translate.c b/target/arm/translate.c index e57844c019..490e120b0b 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -7721,6 +7721,51 @@ static int disas_neon_insn_cp8_3same(DisasContext *s, uint32_t insn) return 0; } +/* ARMv8.3 reclaims a portion of the CDP2 coprocessor 8 space. */ + +static int disas_neon_insn_cp8_index(DisasContext *s, uint32_t insn) +{ + int rd, rn, rm, rot, size, opr_sz; + TCGv_ptr fpst; + bool q; + + /* FIXME: this access check should not take precedence over UNDEF + * for invalid encodings; we will generate incorrect syndrome information + * for attempts to execute invalid vfp/neon encodings with FP disabled. + */ + if (s->fp_excp_el) { + gen_exception_insn(s, 4, EXCP_UDEF, + syn_fp_access_trap(1, 0xe, false), s->fp_excp_el); + return 0; + } + if (!s->vfp_enabled || !arm_dc_feature(s, ARM_FEATURE_V8_FCMA)) { + return 1; + } + + q = extract32(insn, 6, 1); + size = extract32(insn, 23, 1); + + VFP_DREG_D(rd, insn); + VFP_DREG_N(rn, insn); + VFP_DREG_M(rm, insn); + if ((rd | rn) & q) { + return 1; + } + + /* This entire space is VCMLA (indexed). */ + rot = extract32(insn, 20, 2); + opr_sz = (1 + q) * 8; + fpst = get_fpstatus_ptr(1); + tcg_gen_gvec_3_ptr(vfp_reg_offset(1, rd), + vfp_reg_offset(1, rn), + vfp_reg_offset(1, rm), fpst, + opr_sz, opr_sz, rot, + size ? gen_helper_gvec_fcmlas_idx + : gen_helper_gvec_fcmlah_idx); + tcg_temp_free_ptr(fpst); + return 0; +} + static int disas_coproc_insn(DisasContext *s, uint32_t insn) { int cpnum, is64, crn, crm, opc1, opc2, isread, rt, rt2; @@ -8471,6 +8516,12 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) goto illegal_op; } return; + } else if ((insn & 0x0f000f10) == 0x0e000800) { + /* ARMv8.3 neon cdp2 coprocessor 8 extension. */ + if (disas_neon_insn_cp8_index(s, insn)) { + goto illegal_op; + } + return; } else if ((insn & 0x0fe00000) == 0x0c400000) { /* Coprocessor double register transfer. */ ARCH(5TE);