From patchwork Sat Aug 15 01:31:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247760 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1265784ilo; Sat, 15 Aug 2020 09:11:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfiAULJvB5+f1WoH7M8VtAPjOtMJqXqN2Qs8z3HfaxU0Y8Jf7lUQxbCnwJsmpJs9ESx/ry X-Received: by 2002:a25:d8c3:: with SMTP id p186mr11417930ybg.50.1597507877036; Sat, 15 Aug 2020 09:11:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597507877; cv=none; d=google.com; s=arc-20160816; b=A1DvcWgBW6DmbUrtkIRYMgUEi+NO/zSkeFORsXnrFguY1mz0WyjtayW0zxNMUYSLST 2bzgLQYuOvWK8guPrKRO2lhUsPvZh/5nP6B0Ewx1uuk4xGpCQ8zEypdECj6DbV4GY9m/ vbdI3EevaszRWnFw++36x/THJmfCSNX/KQLB+Hwtf+UbwUbSS2AS6R7qoqV8Q2nuQHd1 xBWb/Gc1irotpVKfpdGa7BUz4Yz22svTfszIV0gAHuoMdPVcQDaXFMliBm53QGv/GlYs HXNiBXRQggJTu5WIlviBXUhHam/MfxvnSuFhFVIGJ1TqnXJMVQO3N1sRCgWMk/AL1qyH GtFg== 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=o2sKGEby6/++OxhF3tijZoQWTqB0BkWs415h6IKC4gs=; b=uLj5FCpx6eqwvyxXrbnJAzu84gEoDqQ1DifK8yM0p5Szd2O928ixhHVbh1ivpwfZc+ 0zP5nlEu3Zomzg0FFtE9jexcrt01DOd7YOD3uOxic6uq0hQ1c+H7uCWywoBPQ/4x25GT wK373o3ObGuapuvjGjZIvgNCQ5df3G0qtEBVdcgpvG3IqFtaLk5kawt+5vePHSm13UJK 2TlPJCKFD2x85tTWaDE6xXf5J4cxBkPb0X9ZqaNjzQ0s85i/9RJ6Rzp+gckymjsRzrhy Ov0Z8fyxennnUV+TkdWVcu3qWh7vD5VuUqvzIPlHR93QonqsYXj8utL/elWg6od1bL3p eAJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e1Bkj8Zi; 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 g34si11451515ybe.393.2020.08.15.09.11.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 09:11:17 -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=e1Bkj8Zi; 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]:56660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6ym4-0003SL-GW for patch@linaro.org; Sat, 15 Aug 2020 12:11:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6yla-0003Qg-T0 for qemu-devel@nongnu.org; Sat, 15 Aug 2020 12:10:47 -0400 Received: from mail-vs1-xe42.google.com ([2607:f8b0:4864:20::e42]:39723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6ylY-0002nd-K3 for qemu-devel@nongnu.org; Sat, 15 Aug 2020 12:10:46 -0400 Received: by mail-vs1-xe42.google.com with SMTP id n25so6174399vsq.6 for ; Sat, 15 Aug 2020 09:10:44 -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=o2sKGEby6/++OxhF3tijZoQWTqB0BkWs415h6IKC4gs=; b=e1Bkj8ZiuJXDakOROrU4mKxdMB6iW14Bz+nFnPYTXJoxAlWbF5gim1khLYYJOAwgHa Rb4+UfKjb2KAP73kGsukvIdSxZV/rWMTH40ZwnLskNKNOG2r75Yz0RunFcuWij2o2xy/ v56j5t9eyaaWv6kzxt1KO2/DenkjbzMFysfG8H1b/VLACx0NhxA+5st/w7CJwHxZL4Q2 nVhCLl8GJ5erW18ccJPbxsCeOE6e39HE635DOad30zrF+uAhPnIMyIofkBiGvmn+s3NH DZFHQBoPsH6/N1NOzJc2J9yf6czHmhnrd0Vtpdb1XrKYOKlyvy2e+xUTZblj5mdtb6JO 1obQ== 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=o2sKGEby6/++OxhF3tijZoQWTqB0BkWs415h6IKC4gs=; b=V/vSgE8CmsRb7z41EYuogqKHn4zdYoqMn4Vh5NZP14tMMAKZJXUikzYWRCj9TY9KDw ERZbFEFcY59Vc/dyDm9+2ZebKvqJR/3+f6Kq3LF+B0wc7H1Y0rsajQ3Yl3Qo6gbnecvi x/g//j2K0mplQfHOxfC5txvTBR1+p8ZtZ9fUPR3Pq6iQeb1kQEiqSkzqLA0z0j6Mou3I yvhcY2x468IQK9vzCC8KCzoAterR/c9TMMwpnJjZjxDHj5gxdJ0GtslxOsjwDBIezpeo 1tAZanfHpTEszQWoUwgO18HJVvz3jRHGPVs+NM4Xe+7Tsnuax+94Mx6FXKCDyt+3kfdV sO2g== X-Gm-Message-State: AOAM531AuiwUK1IM6+rz0XbmMRgRc/OODO86hsmWI2OISRCgAeVTgGps WBHmyRNN0/KmWZgXM1puZfCAW8jdPAdgIg== X-Received: by 2002:a62:3641:: with SMTP id d62mr2843375pfa.82.1597455133107; Fri, 14 Aug 2020 18:32:13 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.32.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:32:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 19/20] target/arm: Convert integer multiply-add (indexed) to gvec for aa64 advsimd Date: Fri, 14 Aug 2020 18:31:44 -0700 Message-Id: <20200815013145.539409-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200815013145.539409-1-richard.henderson@linaro.org> References: <20200815013145.539409-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::e42; envelope-from=richard.henderson@linaro.org; helo=mail-vs1-xe42.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=ham autolearn_force=no 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: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/arm/helper.h | 14 ++++++++++++++ target/arm/translate-a64.c | 34 ++++++++++++++++++++++++++++++++++ target/arm/vec_helper.c | 25 +++++++++++++++++++++++++ 3 files changed, 73 insertions(+) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/helper.h b/target/arm/helper.h index d0573a53c8..378bb1898b 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -762,6 +762,20 @@ DEF_HELPER_FLAGS_4(gvec_mul_idx_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_mul_idx_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_mul_idx_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(gvec_mla_idx_h, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(gvec_mla_idx_s, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(gvec_mla_idx_d, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) + +DEF_HELPER_FLAGS_5(gvec_mls_idx_h, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(gvec_mls_idx_s, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(gvec_mls_idx_d, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) + #ifdef TARGET_AARCH64 #include "helper-a64.h" #include "helper-sve.h" diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index d08960a1c8..c74c6e854c 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -13523,6 +13523,40 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) return; } break; + + case 0x10: /* MLA */ + if (!is_long && !is_scalar) { + static gen_helper_gvec_4 * const fns[3] = { + gen_helper_gvec_mla_idx_h, + gen_helper_gvec_mla_idx_s, + gen_helper_gvec_mla_idx_d, + }; + tcg_gen_gvec_4_ool(vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + vec_full_reg_offset(s, rm), + vec_full_reg_offset(s, rd), + is_q ? 16 : 8, vec_full_reg_size(s), + index, fns[size - 1]); + return; + } + break; + + case 0x14: /* MLS */ + if (!is_long && !is_scalar) { + static gen_helper_gvec_4 * const fns[3] = { + gen_helper_gvec_mls_idx_h, + gen_helper_gvec_mls_idx_s, + gen_helper_gvec_mls_idx_d, + }; + tcg_gen_gvec_4_ool(vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + vec_full_reg_offset(s, rm), + vec_full_reg_offset(s, rd), + is_q ? 16 : 8, vec_full_reg_size(s), + index, fns[size - 1]); + return; + } + break; } if (size == 3) { diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c index aa1de36921..fb53684ce3 100644 --- a/target/arm/vec_helper.c +++ b/target/arm/vec_helper.c @@ -731,6 +731,31 @@ DO_MUL_IDX(gvec_mul_idx_d, uint64_t, ) #undef DO_MUL_IDX +#define DO_MLA_IDX(NAME, TYPE, OP, H) \ +void HELPER(NAME)(void *vd, void *vn, void *vm, void *va, uint32_t desc) \ +{ \ + intptr_t i, j, oprsz = simd_oprsz(desc), segment = 16 / sizeof(TYPE); \ + intptr_t idx = simd_data(desc); \ + TYPE *d = vd, *n = vn, *m = vm, *a = va; \ + for (i = 0; i < oprsz / sizeof(TYPE); i += segment) { \ + TYPE mm = m[H(i + idx)]; \ + for (j = 0; j < segment; j++) { \ + d[i + j] = a[i + j] OP n[i + j] * mm; \ + } \ + } \ + clear_tail(d, oprsz, simd_maxsz(desc)); \ +} + +DO_MLA_IDX(gvec_mla_idx_h, uint16_t, +, H2) +DO_MLA_IDX(gvec_mla_idx_s, uint32_t, +, H4) +DO_MLA_IDX(gvec_mla_idx_d, uint64_t, +, ) + +DO_MLA_IDX(gvec_mls_idx_h, uint16_t, -, H2) +DO_MLA_IDX(gvec_mls_idx_s, uint32_t, -, H4) +DO_MLA_IDX(gvec_mls_idx_d, uint64_t, -, ) + +#undef DO_MLA_IDX + #define DO_FMUL_IDX(NAME, TYPE, H) \ void HELPER(NAME)(void *vd, void *vn, void *vm, void *stat, uint32_t desc) \ { \