From patchwork Wed Feb 28 19:31:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 130066 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp141421lja; Wed, 28 Feb 2018 11:47:46 -0800 (PST) X-Google-Smtp-Source: AG47ELu+Cx8Z9rnOoT8Q9aUN2Z0zmx64Ee+xT8d810mzgV3YntIV1UxG55D8skNcFdPw53Z0moIP X-Received: by 2002:a25:9185:: with SMTP id w5-v6mr12924018ybl.352.1519847266397; Wed, 28 Feb 2018 11:47:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519847266; cv=none; d=google.com; s=arc-20160816; b=oTSryETTc+2+4Vyw/Ayzgerq2nH0yVlgehGEhQREwhogwrjkmlpFgfTmyhYxjqQmQs stpgPlw0UXvdh1OmKW+iEayF77lIuOnFIQhr1jI/fNtuPNHEDOGcSOCA268HI4tcOLnU 9yfeTJxDFlMJrSmPYQ/sPGXyLxvm7hLbkXdCnrMv33QFijABO00/3K9bcDK6pV6pfu75 YQT8oSXvc5JW+AWNvf3bQQmubdUW6JzV+xZUFU6IAZZERd1icbcE/iQEnaqXJvRPZxjm uCRU+JGTgSQnysoHc4rA+wBMLfWCDHjkM+YJfK2vJPrxYZOJbAdtiidfExpD8jB+x82o 1hSQ== 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=MR0QyCTB5IcqskwTEuIEWG45RpBZgoQ7B3ACJOcXyLw=; b=q9guZe6dHvw5NumJ8XaWwlykbZW7y3o4+AXvAjNHcwWxdS0WBp3rquCLvWW6CyoCz1 GfhKEghemfA5mBQNz0QcRTkpnaF0b5bTLtIqTCL/cnmfwlIFlcP9Gd5RT2lTGVSOfo2X 9rxFr8h45SQ+EwmrrsUdSfZozoBHfGysPEzhISySxwmKZirntfFlm0jVw8/EY636nkuY Lbh8h30BBaE9D8WopTNzoXeD3w/4ZEgeeFmZpCOz4Yw37u/zqsbDXfKmns8ZlXGzrFxm sejFLcVbA2/vhlTzRV6+R9pL2kjrOQQbaDBzTtiZ0o1XBtHyy2C8gN/XRO1wQUqNL89a 8GSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=arH32oIb; 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 o6si379629ywc.412.2018.02.28.11.47.46 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 28 Feb 2018 11:47:46 -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=arH32oIb; 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]:46516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1er7hZ-0007tj-Os for patch@linaro.org; Wed, 28 Feb 2018 14:47:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1er7SB-0003Yd-Np for qemu-devel@nongnu.org; Wed, 28 Feb 2018 14:31:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1er7S9-0006UI-KT for qemu-devel@nongnu.org; Wed, 28 Feb 2018 14:31:51 -0500 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]:39551) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1er7S9-0006Te-F5 for qemu-devel@nongnu.org; Wed, 28 Feb 2018 14:31:49 -0500 Received: by mail-pl0-x244.google.com with SMTP id s13-v6so2119396plq.6 for ; Wed, 28 Feb 2018 11:31:49 -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=MR0QyCTB5IcqskwTEuIEWG45RpBZgoQ7B3ACJOcXyLw=; b=arH32oIbspbm54RggbZKolyK/Cqk/EWOY/wLgTsmOPYS/lp4d8mVtGqVoksaRRQ7J/ gWNXq6Y7p0xYsUtQmxAMTdVpnZXOZMzrJqMgdOIuD02scACN5r1jtuOBS9n6maiVaT9u Xz2rXn7GokZKuKCueDcwW0Vvcp8EN4nm3oUKE= 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=MR0QyCTB5IcqskwTEuIEWG45RpBZgoQ7B3ACJOcXyLw=; b=EFG+HX+Rm4Dj9yJO8+P2nvgEfzBDmawoeZKa9/M7s0FBGAPfKc7/iQyD9aEnBAHiOj +C8Hht6FSQF1dQ5ElnBF5eAtifXFNYmtkRegfjCFgPQzB1dGF2mHeEiDEGX9JvekhFmv S6jpGyxM01v9Y+aL6eay2UiaHK55zTnm851gK7fBgZSB6s0qVbPyz0vuqUFo5OJi3I0x ku9eLbvuzQFR0r+iVAr4dGTkNyq4CZ6v0GumWWLWkhWdvDE4gWREqGtELWwsnWDe4LEy xAHoSbtAaAK/xCz3z6i3kV/bx8jiQdATXN4z2J6G/pBIWGA07fR0dU2xssEg9G/1zljY MEHg== X-Gm-Message-State: APf1xPBJHVAXqOZFEeU7rsSezsB325oLl2ml5q+qlkOapT4ekObNJVsR b/lSNS+cvXLzQET9heVpfYwUFGzX4zA= X-Received: by 2002:a17:902:1763:: with SMTP id i90-v6mr2804459pli.309.1519846308154; Wed, 28 Feb 2018 11:31:48 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-169-147.tukw.qwest.net. [97.113.169.147]) by smtp.gmail.com with ESMTPSA id k185sm4200212pgk.94.2018.02.28.11.31.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Feb 2018 11:31:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 28 Feb 2018 11:31:23 -0800 Message-Id: <20180228193125.20577-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180228193125.20577-1-richard.henderson@linaro.org> References: <20180228193125.20577-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:c01::244 Subject: [Qemu-devel] [PATCH v3 14/16] 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: 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 | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) -- 2.14.3 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.c b/target/arm/translate.c index 45513c9d86..3ad8b4031c 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -7742,6 +7742,61 @@ static int disas_neon_insn_3same_ext(DisasContext *s, uint32_t insn) return 0; } +/* Advanced SIMD two registers and a scalar extension. + * 31 24 23 22 20 16 12 11 10 9 8 3 0 + * +-----------------+----+---+----+----+----+---+----+---+----+---------+----+ + * | 1 1 1 1 1 1 1 0 | o1 | D | o2 | Vn | Vd | 1 | o3 | 0 | o4 | N Q M U | Vm | + * +-----------------+----+---+----+----+----+---+----+---+----+---------+----+ + * + */ + +static int disas_neon_insn_2reg_scalar_ext(DisasContext *s, uint32_t insn) +{ + int rd, rn, rm, rot, size, opr_sz; + TCGv_ptr fpst; + bool q; + + q = extract32(insn, 6, 1); + VFP_DREG_D(rd, insn); + VFP_DREG_N(rn, insn); + VFP_DREG_M(rm, insn); + if ((rd | rn) & q) { + return 1; + } + + if ((insn & 0xff000f10) == 0xfe000800) { + /* VCMLA (indexed) -- 1111 1110 S.RR .... .... 1000 ...0 .... */ + rot = extract32(insn, 20, 2); + size = extract32(insn, 23, 1); + if (!arm_dc_feature(s, ARM_FEATURE_V8_FCMA) + || (!size && !arm_dc_feature(s, ARM_FEATURE_V8_FP16))) { + return 1; + } + } else { + return 1; + } + + 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) { + return 1; + } + + 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; @@ -8492,6 +8547,12 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) goto illegal_op; } return; + } else if ((insn & 0x0f000a00) == 0x0e000800 + && arm_dc_feature(s, ARM_FEATURE_V8)) { + if (disas_neon_insn_2reg_scalar_ext(s, insn)) { + goto illegal_op; + } + return; } else if ((insn & 0x0fe00000) == 0x0c400000) { /* Coprocessor double register transfer. */ ARCH(5TE);