From patchwork Thu Jun 11 14:45:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 187801 Delivered-To: patch@linaro.org Received: by 2002:a92:cf06:0:0:0:0:0 with SMTP id c6csp1471502ilo; Thu, 11 Jun 2020 07:49:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5X9pnchJLCs5nTmiAnnmeyTqbx1NQxqCoiPx4JHbf483k8dZqbZ+NugdXrxCPjJj32klY X-Received: by 2002:a25:7086:: with SMTP id l128mr14778584ybc.34.1591886978215; Thu, 11 Jun 2020 07:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591886978; cv=none; d=google.com; s=arc-20160816; b=ZlgP/+qYp9q2MBnggY1Xk8fEx/3dBWn6DbFhAK94WSvaubT0Rk6TLURaJfSUNd6/fx 83AmFPkdalR7mpqY2Az2TnMhGUSoqWUMwpyrigTVGUpvO3gR+J2SF5cq8ZEUhBXUxF8P tVbrES3PeMq+dzUFX9jMcuejiLYSmaeoYnTYEtKNGq2Tlc0VLUY1GU0+lEt1YPzxf/EJ 3W8hsi4Sx9fmgPatXSupG1XPBYkBqwiJllYhFh3XK+Tdy7epW8Q7Zmj0/3Odib+Cntuo oXrc5N21tfZaFJg8u9RRFMDDKue17zfO7TnQiHK3MYJDvcKLL6O02/6Fz9ZF2bWyfHLk GgmQ== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ha29nD9STSEXti9LVVGKrzWg/TQORlHiDcjPJW4gwWc=; b=jdbeSyimNy50rUx5CJ1ZO10iRmwZZKD4MB2Z5IRbxGjlhUB4U4J6RD/zXXcA/Lhy+P dlHzFXUYElJ+MwgxuEEaxDB1r4lnZmIXFcppSgvvGyw7HpXfSrkKLNRvioORD8+wJhd3 GEUYur+UF14blz7g508PP8TJbT0DqD0KaW7ZVgea7uxe4y6Rc1+ttqfNjgVmAEgKbYlV iO98bytlkklsRCwPr6+dJgoHJr3SMn7ua7/69mkYf8UxxFQkiGb3x5+/0KrCMuz3GQPr ZwuIBjVtQBe8AWYTcou2agYTyIpR5cxYwIBXHGam+dbg/Gqth66qzilIX/h/Mqy/13Mx heAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SKbVUUSL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x1si2657607ybs.237.2020.06.11.07.49.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jun 2020 07:49:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SKbVUUSL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jjOWP-0005yi-L7 for patch@linaro.org; Thu, 11 Jun 2020 10:49:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jjOSl-0001Uc-QH for qemu-devel@nongnu.org; Thu, 11 Jun 2020 10:45:51 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:34111) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jjOSk-0003rZ-1x for qemu-devel@nongnu.org; Thu, 11 Jun 2020 10:45:51 -0400 Received: by mail-wm1-x341.google.com with SMTP id u26so7115528wmn.1 for ; Thu, 11 Jun 2020 07:45:41 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=ha29nD9STSEXti9LVVGKrzWg/TQORlHiDcjPJW4gwWc=; b=SKbVUUSLxltVE1kVP5JQZdR+xZp/xWRCGF+fI7AM9scIoy4Hs7zxBIDk9KC4uHxb9t U8RLImzXrj2uU0263XbTMjYXI55154XeLxnaU5R4ZIfTIUcv+pRswF+BbU1zhYhNSyD+ Bs28jsd2cl0dLbKm0kHGV5TdSjRF8ut4BlWbvW3+uNkMQLd6fmzQ9PzBpcB4r4xIhtMZ XR8/g3W3k6hJVsYfcUzTq2goeRcQ70utI1BqSfcBSUmE9GAOB467SoGL8gqZcSSVefYE 3eGYD4iXYUg3TyA3c38QHavoid83JDoP4EMsefB5f6AJ9xlgr8HwJpxVmrAVwV1fFXGh Ns+Q== 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:mime-version:content-transfer-encoding; bh=ha29nD9STSEXti9LVVGKrzWg/TQORlHiDcjPJW4gwWc=; b=GloLe1mhVE2EQ/uvM0AlYAqDNV+I4aLqx+ZLuEFxOdCZjra8dV1bGY+aeKr4hdHwb/ dHS/MmFmGERQCqDmls21oQI13koy7MEhs9KbxBVIIPW6o9HFPuwfLw+GOAmq7fK8SM3H 7Hw7B4t2sjQxx7mS7gVJQRpP4+E7MInwj363AgqK02RXcuYGGschlIneBzbvZ/VkO35M 2ajMR2DLgVpKi3vYfSyPR6hdvVaSpHkY1ksoMGnfR+3fvZXooW8Ghe1fjEg4Q+KVCN9Y POJRq84HbCtpMPwH1JL+WMS2+rotjTmJhdOtVmil4ibYd5+JyU6Yna4UNYb41cw2rg4L 3aug== X-Gm-Message-State: AOAM531He60Ozu+xKBN8KAENbgk2m2qJ0XcbQBXRIlGzhnY3MFJdDrva yUWG0HPegbZqIHPgN67ZQPwlXTiGC8L6vw== X-Received: by 2002:a7b:c1d4:: with SMTP id a20mr8254325wmj.153.1591886740327; Thu, 11 Jun 2020 07:45:40 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id h18sm5271658wru.7.2020.06.11.07.45.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2020 07:45:39 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 06/10] target/arm: Convert Neon 2-reg-scalar VQRDMLAH, VQRDMLSH to decodetree Date: Thu, 11 Jun 2020 15:45:25 +0100 Message-Id: <20200611144529.8873-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200611144529.8873-1-peter.maydell@linaro.org> References: <20200611144529.8873-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Convert the VQRDMLAH and VQRDMLSH insns in the 2-reg-scalar group to decodetree. Signed-off-by: Peter Maydell --- target/arm/neon-dp.decode | 3 ++ target/arm/translate-neon.inc.c | 74 +++++++++++++++++++++++++++++++++ target/arm/translate.c | 38 +---------------- 3 files changed, 79 insertions(+), 36 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/target/arm/neon-dp.decode b/target/arm/neon-dp.decode index 105cf2b2db3..7b069abe628 100644 --- a/target/arm/neon-dp.decode +++ b/target/arm/neon-dp.decode @@ -488,5 +488,8 @@ Vimm_1r 1111 001 . 1 . 000 ... .... cmode:4 0 . op:1 1 .... @1reg_imm VQDMULH_2sc 1111 001 . 1 . .. .... .... 1100 . 1 . 0 .... @2scalar VQRDMULH_2sc 1111 001 . 1 . .. .... .... 1101 . 1 . 0 .... @2scalar + + VQRDMLAH_2sc 1111 001 . 1 . .. .... .... 1110 . 1 . 0 .... @2scalar + VQRDMLSH_2sc 1111 001 . 1 . .. .... .... 1111 . 1 . 0 .... @2scalar ] } diff --git a/target/arm/translate-neon.inc.c b/target/arm/translate-neon.inc.c index 6301016d5cf..19344ac331d 100644 --- a/target/arm/translate-neon.inc.c +++ b/target/arm/translate-neon.inc.c @@ -2575,3 +2575,77 @@ static bool trans_VQRDMULH_2sc(DisasContext *s, arg_2scalar *a) return do_2scalar(s, a, opfn[a->size], NULL); } + +static bool do_vqrdmlah_2sc(DisasContext *s, arg_2scalar *a, + NeonGenThreeOpEnvFn *opfn) +{ + /* + * VQRDMLAH/VQRDMLSH: this is like do_2scalar, but the opfn + * performs a kind of fused op-then-accumulate using a helper + * function that takes all of rd, rn and the scalar at once. + */ + TCGv_i32 scalar; + int pass; + + if (!arm_dc_feature(s, ARM_FEATURE_NEON)) { + return false; + } + + if (!dc_isar_feature(aa32_rdm, s)) { + return 1; + } + + /* UNDEF accesses to D16-D31 if they don't exist. */ + if (!dc_isar_feature(aa32_simd_r32, s) && + ((a->vd | a->vn | a->vm) & 0x10)) { + return false; + } + + if (!opfn) { + /* Bad size (including size == 3, which is a different insn group) */ + return false; + } + + if (a->q && ((a->vd | a->vn) & 1)) { + return false; + } + + if (!vfp_access_check(s)) { + return true; + } + + scalar = neon_get_scalar(a->size, a->vm); + + for (pass = 0; pass < (a->q ? 4 : 2); pass++) { + TCGv_i32 rn = neon_load_reg(a->vn, pass); + TCGv_i32 rd = neon_load_reg(a->vd, pass); + opfn(rd, cpu_env, rn, scalar, rd); + tcg_temp_free_i32(rn); + neon_store_reg(a->vd, pass, rd); + } + tcg_temp_free_i32(scalar); + + return true; +} + +static bool trans_VQRDMLAH_2sc(DisasContext *s, arg_2scalar *a) +{ + static NeonGenThreeOpEnvFn *opfn[] = { + NULL, + gen_helper_neon_qrdmlah_s16, + gen_helper_neon_qrdmlah_s32, + NULL, + }; + return do_vqrdmlah_2sc(s, a, opfn[a->size]); +} + +static bool trans_VQRDMLSH_2sc(DisasContext *s, arg_2scalar *a) +{ + static NeonGenThreeOpEnvFn *opfn[] = { + NULL, + gen_helper_neon_qrdmlsh_s16, + gen_helper_neon_qrdmlsh_s32, + NULL, + }; + return do_vqrdmlah_2sc(s, a, opfn[a->size]); +} diff --git a/target/arm/translate.c b/target/arm/translate.c index 5d0e00f92e0..f0db029f66d 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -5179,6 +5179,8 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) case 9: /* Floating point VMUL scalar */ case 12: /* VQDMULH scalar */ case 13: /* VQRDMULH scalar */ + case 14: /* VQRDMLAH scalar */ + case 15: /* VQRDMLSH scalar */ return 1; /* handled by decodetree */ case 3: /* VQDMLAL scalar */ @@ -5238,42 +5240,6 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) neon_store_reg64(cpu_V0, rd + pass); } break; - case 14: /* VQRDMLAH scalar */ - case 15: /* VQRDMLSH scalar */ - { - NeonGenThreeOpEnvFn *fn; - - if (!dc_isar_feature(aa32_rdm, s)) { - return 1; - } - if (u && ((rd | rn) & 1)) { - return 1; - } - if (op == 14) { - if (size == 1) { - fn = gen_helper_neon_qrdmlah_s16; - } else { - fn = gen_helper_neon_qrdmlah_s32; - } - } else { - if (size == 1) { - fn = gen_helper_neon_qrdmlsh_s16; - } else { - fn = gen_helper_neon_qrdmlsh_s32; - } - } - - tmp2 = neon_get_scalar(size, rm); - for (pass = 0; pass < (u ? 4 : 2); pass++) { - tmp = neon_load_reg(rn, pass); - tmp3 = neon_load_reg(rd, pass); - fn(tmp, cpu_env, tmp, tmp2, tmp3); - tcg_temp_free_i32(tmp3); - neon_store_reg(rd, pass, tmp); - } - tcg_temp_free_i32(tmp2); - } - break; default: g_assert_not_reached(); }