From patchwork Sat Aug 15 01:31:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247753 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1240265ilo; Sat, 15 Aug 2020 08:28:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjgUcbCJ6nYdMTWckIxkRuma1q5DkI0nPZfVb7Y6DML3flc7CFNjiJ43AOFWlAF8GPiGM+ X-Received: by 2002:a25:40cb:: with SMTP id n194mr10342761yba.380.1597505317823; Sat, 15 Aug 2020 08:28:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597505317; cv=none; d=google.com; s=arc-20160816; b=C7DyYtEATjMSxfapyEEs3CnA98F6uxCCTCycqsmTEZ7+c/B0hQyolqpLvM/+c1YrXy Lkt1YQHCfDJS/VhdhE+dNHNKL8ec4A2IPJmxmvYjnFjnsol/a+2Y7yMxBLRoplLitkgp MgYwZORyH1PRhTnVnqaBbr9rnSZRhg5Gpmwk195aDwqgwc+4amTC8gCe3CnGWRUbwsyo 2/OSwjLv5K9VVPzDlwFZCmkJxz+kSdj1TJZyM6XZ+oRS8jr+txVyiaOKx0JHE30upFYi KYl0fhXiqPm2mMVSoxw/DdwRQwLo/9RDE/+jT0a4dFzUOUlc3DYxU3WOp0qad1VILfJz wYDA== 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=SYhTH7/NoKSZMnkGd9mMb4nrqyxVnLFVoR2e/Dwfxy0=; b=v7pfnQFyZvlIq4TVaaQrlRhrOXCw5J/43VgiJTNB5sQkL9WlLDDsoTZaq2TFiIyz5u 5hkbVCj4aPxGPbXWnJcT4jXvjN5+KdZMN9XL7tbbHQDIYIOisSADdLjYzKkxk2HAQroj 3n0uCA1DHNEVL6+VF5i8G6lqX5euBGZ3zlDZ5Yx+ByP9joWEKaZ1BUFhHbh3Ovre3T3h a1SAbZJYFzmmeJIIUu1pmUyWeYTquphP0n1S/IjX+067TjShvO/77mRTvo9G+NHvYxL7 Hhx749H0t2UEYgEUHNfYP49wGnHES1gZHRHTfCrbCx6fb7rAuMB+c2/uqkilxlx0Nn5x 6tqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YebU2m56; 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 o128si11822860ybg.8.2020.08.15.08.28.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 08:28:37 -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=YebU2m56; 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]:40428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6y6n-00025r-9e for patch@linaro.org; Sat, 15 Aug 2020 11:28:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6y53-0007vk-6Q for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:26:49 -0400 Received: from mail-vs1-xe41.google.com ([2607:f8b0:4864:20::e41]:42417) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6y51-0003gM-Bc for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:26:48 -0400 Received: by mail-vs1-xe41.google.com with SMTP id q13so6126273vsn.9 for ; Sat, 15 Aug 2020 08:26:46 -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=SYhTH7/NoKSZMnkGd9mMb4nrqyxVnLFVoR2e/Dwfxy0=; b=YebU2m56OOBYOl+xeB0Xu+Cg4A9AkuO8hy4+NFP+uKIwYR0wepCJJ7XSpJwsRvrn+8 kiP6OCUsbEqkz5wjbkFQ4L6+/Qzv3iQ+1IejuISOvYUvAyqbfEoE034TlFciSCUtualk c0lnPWRlwWsGbIvaOEBRRFbFaXO72919u4Z2bTDs8vT89sarlQm7hOZ6g/v+bZQwiyOZ MzFof9KfbCAR7194J0vTMmBXYvb1a+a+2gHAxJs+o7l+i63VMn1eTxjKCudzzhKen6Eu 83ZukN/gANdnHwdZWAeCe/hOdHAvS/sV7VLUllkJ1s0MlLohLWf1rYAKL2Z20vExarm2 yJ9w== 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=SYhTH7/NoKSZMnkGd9mMb4nrqyxVnLFVoR2e/Dwfxy0=; b=HoYlJYPN/1ANkNlUMezT3O/WerMGjlWThJ6t19ur/XCWWv396QIqepxrbBE62CakHe CvksUQ+0YQH7crBEDCRmmzv5rTz5AwaYdx8P9V+pQyxoxiuztJ7h9WKl83aTuHG5fE32 MELJWVrRCb2qa+UbI86M8jhVwDePKyqMhrfp/aXTcLvl+95L9D9fKqlGtdB3Rn/yx93k HpohniIZ09G3IW5RH4UfSYUlXyntaYKACa6KQ4KWilDDOAt5GvhMpn2rl/691mAa5iJ+ Ti2VjNEoPLFyFyJM9NE0JLhQsJdui0V9niP6whiGUsd6yRFDVUgZ6OdPVnwCBC8Omlcf MDRw== X-Gm-Message-State: AOAM530HMGCMCb59rXDGI14iAQqgcAaeZqtspDFuzQuwgSn29zwn2MrA jvgOjEoMAjHfnGkIh6jNRZViFNEoODt/8w== X-Received: by 2002:a17:902:bd09:: with SMTP id p9mr4005177pls.322.1597455109367; Fri, 14 Aug 2020 18:31:49 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.31.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:31:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 01/20] qemu/int128: Add int128_lshift Date: Fri, 14 Aug 2020 18:31:26 -0700 Message-Id: <20200815013145.539409-2-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::e41; envelope-from=richard.henderson@linaro.org; helo=mail-vs1-xe41.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" Add left-shift to match the existing right-shift. Signed-off-by: Richard Henderson --- include/qemu/int128.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/include/qemu/int128.h b/include/qemu/int128.h index 5c9890db8b..76ea405922 100644 --- a/include/qemu/int128.h +++ b/include/qemu/int128.h @@ -63,6 +63,11 @@ static inline Int128 int128_rshift(Int128 a, int n) return a >> n; } +static inline Int128 int128_lshift(Int128 a, int n) +{ + return a << n; +} + static inline Int128 int128_add(Int128 a, Int128 b) { return a + b; @@ -217,6 +222,17 @@ static inline Int128 int128_rshift(Int128 a, int n) } } +static inline Int128 int128_lshift(Int128 a, int n) +{ + uint64_t l = a.lo << (n & 63); + if (n >= 64) { + return int128_make128(0, l); + } else if (n > 0) { + return int128_make128(l, (a.hi << n) | (a.lo >> (64 - n))); + } + return a; +} + static inline Int128 int128_add(Int128 a, Int128 b) { uint64_t lo = a.lo + b.lo; From patchwork Sat Aug 15 01:31:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247750 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1229136ilo; Sat, 15 Aug 2020 08:09:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmlqDjKH4j782t7+6zN4JR/oG9ynIFqlx4VMOmns6H/42lrEd+E0lNRLAqTExRgrQa5z4E X-Received: by 2002:a25:dc4b:: with SMTP id y72mr10174892ybe.197.1597504197638; Sat, 15 Aug 2020 08:09:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597504197; cv=none; d=google.com; s=arc-20160816; b=YgeZmaeSuAzeOFnFiQuiE7fYXmCH3c/vjNhHcuJ3mTqsz3WDdYLxRR7FgNk9D647RW 6ZgR4mFS4ixepG07jHM00Ce1Abq0al4UcYXT6yND0VBATlxuwqODm+WVKzHPO+PiuL/w E/iIKsEragxvsp7qSXtuhYKs0wsVbhPQkdlNgZT8rx9Zo0Zb6kYenlksP7wVzi0kdOOc Y+rdduqogx7mtBogM/6ova2xdy4qUceCi2NdAJTcs0Bdgv6PC64RphlHg2wbKI9Z0cp8 IqOQwstk5ZFiDKZOnsrkErM5J1nAYCfnJHJdnMSLl5S5QgcpbTGOn8xZhja4lWSdUgz9 ou1A== 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=dBiawe791lYoIBQCs7QK6giwbxNTYFLKTnDb5R8dqS0=; b=bs9jfTH0L9RDIJbNRCNBHucyx2UYnuhRJbJHsYBj05QEJZGUfQhdfAJ48oWWpgT1La 0NisiMdTCXyt9ksT0j4vWHKK1VI/tDBsps+GvH5ArncW5BvX4KFvqKAOHGxnV5kjPK4e Qm28oC3k57w/5R8lKLkrKuQRHtMyIWzTNQpVT8NjPsTHX7IiIfMJ6Vz75kqM0h3KI8Sr Z9In1OF5gUcKbBaiq2XoqCVxlzhNykh4kXD26YcyAO1PnyNrONIoosGsDGVKR88WoC21 OOTA8UYdOmSUn8BAGqNS0NVH6jWCnrdgnLUlf8woAwOD0X6yqUW6tihRsPa9NEJAvENX tZMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y0OZ8All; 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 w141si12580199ybg.104.2020.08.15.08.09.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 08:09:57 -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=Y0OZ8All; 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]:56534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6xoj-00078f-4w for patch@linaro.org; Sat, 15 Aug 2020 11:09:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6xjr-0000Ce-O9 for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:04:55 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:41004) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6xjq-00070q-2Y for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:04:55 -0400 Received: by mail-pf1-x443.google.com with SMTP id a79so5956340pfa.8 for ; Sat, 15 Aug 2020 08:04:52 -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=dBiawe791lYoIBQCs7QK6giwbxNTYFLKTnDb5R8dqS0=; b=Y0OZ8AllOD5DujnIV1vAfAMUQ+nhueZA2VLFJ7lFAqqwprfXOJ3CMGbLgVJm1KYndn RB0QLVMaNMcYtErlMaDlWSCeUutVOH5UPT3C0UmYaqMejq3UoBV4S0SlOxvKe0OiqMoW BG36Y4smEucuvgfSeQFzUFh4kk6wMMFKFpV/c9RfGnk7X5CsQdyjAXAds27zC0WAYJwI l9tdVKMM1KP5XWY4O4n7/dn51kaTAt3o9WBVOR7xUYCHsLwRAIuqlruY+RlbMkLA/zz7 1pwvLMZlxiosFl0cbBFA/T1BQ66CfC81ZbsC3bKXIcmm5kJovYwVMcVWxfPZ/W7+m5ex U9rw== 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=dBiawe791lYoIBQCs7QK6giwbxNTYFLKTnDb5R8dqS0=; b=HODZmntwTbtPT92wKI10f78cDM2IMyvAWPNYUoUhIYPBXB3YndYb7+Hr2a+c6S/1P2 9E6JSzYkqY3+OjPtp/QpQ1mGwwsBqMIvI/vkKBRGY/2la3scNz3eHutDfmFC4ySeCe6w 3ZcqbRfgG/T9qjLJbtEQ5HjFfmDr/1ItJNjts9mhiWfdeFchaf03n8L2lv/xukcCNvJh lfSpCsDqGWmfGBSo00U6hv00N3U672fsoH9eFy45IHXtUlyJhoxPqjljoJR7ky9IxZmg 6V79RDwARqcXBboALiDp7h6wefh9sKuvQB3Z8fZOHtqzH+gZMOhJTqvVdaPIWFizLkCa A4XA== X-Gm-Message-State: AOAM531EU2NLDNOTofUGwRKmDq46svszAOg/TOoA3DEmSf+WunXqrsCt 33oAikPl1JGrCMD0PO2DwOznMW4O+4IpOg== X-Received: by 2002:aa7:8f0d:: with SMTP id x13mr3684359pfr.193.1597455110749; Fri, 14 Aug 2020 18:31:50 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.31.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:31:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 02/20] target/arm: Split out gen_gvec_fn_zz Date: Fri, 14 Aug 2020 18:31:27 -0700 Message-Id: <20200815013145.539409-3-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::443; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x443.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" Model the new function on gen_gvec_fn2 in translate-a64.c, but indicating which kind of register and in which order. Since there is only one user of do_vector2_z, fold it into do_mov_z. Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 88a2fb271d..28e27c55b5 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -143,15 +143,13 @@ static int pred_gvec_reg_size(DisasContext *s) } /* Invoke a vector expander on two Zregs. */ -static bool do_vector2_z(DisasContext *s, GVecGen2Fn *gvec_fn, - int esz, int rd, int rn) + +static void gen_gvec_fn_zz(DisasContext *s, GVecGen2Fn *gvec_fn, + int esz, int rd, int rn) { - if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - gvec_fn(esz, vec_full_reg_offset(s, rd), - vec_full_reg_offset(s, rn), vsz, vsz); - } - return true; + unsigned vsz = vec_full_reg_size(s); + gvec_fn(esz, vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), vsz, vsz); } /* Invoke a vector expander on three Zregs. */ @@ -170,7 +168,10 @@ static bool do_vector3_z(DisasContext *s, GVecGen3Fn *gvec_fn, /* Invoke a vector move on two Zregs. */ static bool do_mov_z(DisasContext *s, int rd, int rn) { - return do_vector2_z(s, tcg_gen_gvec_mov, 0, rd, rn); + if (sve_access_check(s)) { + gen_gvec_fn_zz(s, tcg_gen_gvec_mov, MO_8, rd, rn); + } + return true; } /* Initialize a Zreg with replications of a 64-bit immediate. */ From patchwork Sat Aug 15 01:31:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247772 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1317880ilo; Sat, 15 Aug 2020 10:48:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvlyA6vy0jshTsRmMo6TzLrqpRGUKKkzRslCh9rSIRK9lw4X0NaJF2cP9cGPg/xLuZYSHl X-Received: by 2002:a25:d08a:: with SMTP id h132mr10560035ybg.368.1597513724696; Sat, 15 Aug 2020 10:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597513724; cv=none; d=google.com; s=arc-20160816; b=J68JDYBWniDVIpx+Sdi3kd9n3hRkRN3RO4MpOIWT8KS8bz/tUm3m7a7pZb/HsCVHus kw2bQYe7vyFROdtg+3J1x+WSe81ZqWHPzavKBmbVLFg+i4zoxmjUHvDcfmAuYQfemmby IUfGHaZ4DFbXNvdA3HYhP/iTaIlZDhR7J5r6Yy+I7CWaqbXjfP1otHCRGLfKeucwuPfj lUVFqXXwQ+SayHK580UP6BdIW6qj48T2gglxc4SN1zBcTFVntVOt3W7S5SIhO5G07qBe uEo8IijN1bG47kwg2xYur+YFwC7aGlPXTWmBjnb9mjCgetF+WPZxgIlSlj3vuZAOR/8Q HGPA== 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=AwlieOmSDn/Rt8TnNZpP6jW//R9aevOAUmcoQvuaIu0=; b=BtsPh82ne89HkZV+zmZ5Ky4hiOdE8Aab+PN8TYnmrbKKUACazm5aP7az/e937jTsdp ndmn6apBNNRjGkq0uu/vnPvCtUkFM6/ZYR4J1TcORxzAgBlnIM4LlalwoHmpZmDWPYZe kMGe1iQEjP8SwKY8Rvvml+YZaTgJ5xH7cW/Y9yWKdwLQqSRfBAfBRhvhJVLHe3SIAhst jDySTMIdok4Ime9J/mMNuD2j9n8tDJx/eOWwR81hzqBVm2flpoY0t8OWuTNMikEatyuk 3mWh1uujZujz0QSZonHfTEn/NLtCpX+K5bRJFxiaEAoDWLfqoaR/zme5kdB0ZrCNgCRT 2hJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zLmIOPoC; 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 n195si11755809ybf.106.2020.08.15.10.48.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 10:48:44 -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=zLmIOPoC; 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]:42788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k70IO-00030g-72 for patch@linaro.org; Sat, 15 Aug 2020 13:48:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k70IE-00030V-5c for qemu-devel@nongnu.org; Sat, 15 Aug 2020 13:48:34 -0400 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:43035) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k70IC-0005kX-CW for qemu-devel@nongnu.org; Sat, 15 Aug 2020 13:48:33 -0400 Received: by mail-oi1-x244.google.com with SMTP id l84so11103054oig.10 for ; Sat, 15 Aug 2020 10:48:31 -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=AwlieOmSDn/Rt8TnNZpP6jW//R9aevOAUmcoQvuaIu0=; b=zLmIOPoCrjmObGTyfj3dii+4lVz+oI81GQNI6AnXJGyoc/Ky43uQFq1D4IFK6R+JFQ xShIrmEy/qly+8q39OZBFHIK6lriSs8y5My3qnC3xNHYSzBwkMeAHriIVxGjdCi+cEFD 2GUQyDWjJy+PeBn4mQkBjaHnJ/BlnKJ/NGGreH9x2D+gpAJB2itiTNjRzb0t1wZVjwNS pd7VkpN24S4eqQxxpbmrFIIFc7cQcg395noD0c+HBgYmtmZWyhofMmd9DedhIJxkc+q8 1skWUYDLdhojlz8iOFlT7cb7IHFysu2K1s12o0zOSuhhB0LTQQf32mcaj3ZN/q7Ol6NC 9caQ== 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=AwlieOmSDn/Rt8TnNZpP6jW//R9aevOAUmcoQvuaIu0=; b=cdhgKDzfWe7VT9I4mMP8LOwRRChZCenHDyNEyr1q8aZQGIyb8KOYTK+FTZ2E+YHa4Y cgtew8MMI2JF4dJ/o9P7TMjXD3wCnhDKRRoNRaQWx2aq2HP9EYD9n0sMSoJUWimhFloC ncqZfO+wzMmPurvi6yA5Z8eRIR8nDA7GpFeFJNK6rEReBxJmthsxfrNZpIb1nxP8yGtD aiW9SrhbNx7JqNtz2XjbG122tpybBfzcrofPStLCVtg6Q2qlbxls/dRe7R7ksC5Y8kar COGTlKeFEg0i0FWdZRxn82hKMXBqShwWzqKViPaPu6OuFgNQE45RbXvzwVplI86NGsLU bvdQ== X-Gm-Message-State: AOAM530JubLVji4nRG2XXNRxCnIWeYmSvzIUyD9iM3cNyMT5y0AZdiYo gPhi8AekxTulCfbGB43+KUGCE44CAHm/vw== X-Received: by 2002:a17:90a:c207:: with SMTP id e7mr4568675pjt.172.1597455111984; Fri, 14 Aug 2020 18:31:51 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.31.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:31:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 03/20] target/arm: Split out gen_gvec_fn_zzz, do_zzz_fn Date: Fri, 14 Aug 2020 18:31:28 -0700 Message-Id: <20200815013145.539409-4-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::244; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x244.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" Model gen_gvec_fn_zzz on gen_gvec_fn3 in translate-a64.c, but indicating which kind of register and in which order. Model do_zzz_fn on the other do_foo functions that take an argument set and verify sve enabled. Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 43 +++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 19 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 28e27c55b5..b0fa38db1c 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -153,16 +153,13 @@ static void gen_gvec_fn_zz(DisasContext *s, GVecGen2Fn *gvec_fn, } /* Invoke a vector expander on three Zregs. */ -static bool do_vector3_z(DisasContext *s, GVecGen3Fn *gvec_fn, - int esz, int rd, int rn, int rm) +static void gen_gvec_fn_zzz(DisasContext *s, GVecGen3Fn *gvec_fn, + int esz, int rd, int rn, int rm) { - if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - gvec_fn(esz, vec_full_reg_offset(s, rd), - vec_full_reg_offset(s, rn), - vec_full_reg_offset(s, rm), vsz, vsz); - } - return true; + unsigned vsz = vec_full_reg_size(s); + gvec_fn(esz, vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + vec_full_reg_offset(s, rm), vsz, vsz); } /* Invoke a vector move on two Zregs. */ @@ -274,24 +271,32 @@ const uint64_t pred_esz_masks[4] = { *** SVE Logical - Unpredicated Group */ +static bool do_zzz_fn(DisasContext *s, arg_rrr_esz *a, GVecGen3Fn *gvec_fn) +{ + if (sve_access_check(s)) { + gen_gvec_fn_zzz(s, gvec_fn, a->esz, a->rd, a->rn, a->rm); + } + return true; +} + static bool trans_AND_zzz(DisasContext *s, arg_rrr_esz *a) { - return do_vector3_z(s, tcg_gen_gvec_and, 0, a->rd, a->rn, a->rm); + return do_zzz_fn(s, a, tcg_gen_gvec_and); } static bool trans_ORR_zzz(DisasContext *s, arg_rrr_esz *a) { - return do_vector3_z(s, tcg_gen_gvec_or, 0, a->rd, a->rn, a->rm); + return do_zzz_fn(s, a, tcg_gen_gvec_or); } static bool trans_EOR_zzz(DisasContext *s, arg_rrr_esz *a) { - return do_vector3_z(s, tcg_gen_gvec_xor, 0, a->rd, a->rn, a->rm); + return do_zzz_fn(s, a, tcg_gen_gvec_xor); } static bool trans_BIC_zzz(DisasContext *s, arg_rrr_esz *a) { - return do_vector3_z(s, tcg_gen_gvec_andc, 0, a->rd, a->rn, a->rm); + return do_zzz_fn(s, a, tcg_gen_gvec_andc); } /* @@ -300,32 +305,32 @@ static bool trans_BIC_zzz(DisasContext *s, arg_rrr_esz *a) static bool trans_ADD_zzz(DisasContext *s, arg_rrr_esz *a) { - return do_vector3_z(s, tcg_gen_gvec_add, a->esz, a->rd, a->rn, a->rm); + return do_zzz_fn(s, a, tcg_gen_gvec_add); } static bool trans_SUB_zzz(DisasContext *s, arg_rrr_esz *a) { - return do_vector3_z(s, tcg_gen_gvec_sub, a->esz, a->rd, a->rn, a->rm); + return do_zzz_fn(s, a, tcg_gen_gvec_sub); } static bool trans_SQADD_zzz(DisasContext *s, arg_rrr_esz *a) { - return do_vector3_z(s, tcg_gen_gvec_ssadd, a->esz, a->rd, a->rn, a->rm); + return do_zzz_fn(s, a, tcg_gen_gvec_ssadd); } static bool trans_SQSUB_zzz(DisasContext *s, arg_rrr_esz *a) { - return do_vector3_z(s, tcg_gen_gvec_sssub, a->esz, a->rd, a->rn, a->rm); + return do_zzz_fn(s, a, tcg_gen_gvec_sssub); } static bool trans_UQADD_zzz(DisasContext *s, arg_rrr_esz *a) { - return do_vector3_z(s, tcg_gen_gvec_usadd, a->esz, a->rd, a->rn, a->rm); + return do_zzz_fn(s, a, tcg_gen_gvec_usadd); } static bool trans_UQSUB_zzz(DisasContext *s, arg_rrr_esz *a) { - return do_vector3_z(s, tcg_gen_gvec_ussub, a->esz, a->rd, a->rn, a->rm); + return do_zzz_fn(s, a, tcg_gen_gvec_ussub); } /* From patchwork Sat Aug 15 01:31:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247765 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1284264ilo; Sat, 15 Aug 2020 09:45:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLUyRcv4OXUXQVAGK77pI0NQb/N/6RvoV3EmAoEkG0ATWQlDDfnKV0qvJ7gMoQnolcLCQV X-Received: by 2002:a5b:d12:: with SMTP id y18mr10459682ybp.400.1597509939373; Sat, 15 Aug 2020 09:45:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597509939; cv=none; d=google.com; s=arc-20160816; b=z+8NRYWZpCtDi+BjZSOKKpEBzX5VgUp0AfzkYjZ7yvuwphFI0oAemkZk3orE5uXJ48 dQLUfgFq7TxSeqQq7GboeK/4b9SVNcNF874xvZd0oNBplfHQyZpApUK6T4Jimc3+w6Uz EI0DOGW4HY4ANS/oP6/rd3v4lfzw8dzX/Y65b507pK5zP/U6Rennd/1jjyRMsEBm4vG+ Tud1ymrsmkCFTksSvWf65nNvNpmNa2akqhh3ZAGtgJjDf7SOAPDY+9FMOCvSwDRgIvyE IajN7Xb1g5u+nmkAudSFUhWC5IBB1xUQiZ15bD+NaxST3u2Grx4zla7VThJD6QJ/cqtW l5HA== 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=yiKdEsXrfNBH7/8vYLZc3MqLfFg4s03EnbAK1DMKZss=; b=xn3IuxAbAnqiImOVsXYiU6tY1fIDAQWYLTtZX+neruz9lAdgUxuAJ24BTqv12vofLJ PvPG41lMRQXSC4zNvfG5xIimGBlUp2ktac59gsG8/wTBXMXdQL3MaQIxuU0efgyvJsq0 w1I1siXjp1NwRdnvmXlUOPR5AC3gboJvwv80+2JPhG4WeA6k2ql8BgNKr+iFFwp8sMUl 0HBL9kM/NJaASuLlKuWDwTF3nZAthSmrlXLcoqHhRWQLRp/k7MjzK20wm+tGJyUmoZYz ddkdrgyICEqlkNnOblfWhffUStgEj2spr7SmCSVPrpIPWy1uH0QQRLptE+bTIeRCOz0V 7uGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FQSzufEJ; 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 w141si12820995ybg.104.2020.08.15.09.45.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 09:45:39 -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=FQSzufEJ; 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]:40360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6zJK-0008MZ-T0 for patch@linaro.org; Sat, 15 Aug 2020 12:45:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6zJ2-0008Kz-1Y for qemu-devel@nongnu.org; Sat, 15 Aug 2020 12:45:20 -0400 Received: from mail-oi1-x243.google.com ([2607:f8b0:4864:20::243]:34213) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6zJ0-0007Ag-2j for qemu-devel@nongnu.org; Sat, 15 Aug 2020 12:45:19 -0400 Received: by mail-oi1-x243.google.com with SMTP id z22so11029220oid.1 for ; Sat, 15 Aug 2020 09:45:17 -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=yiKdEsXrfNBH7/8vYLZc3MqLfFg4s03EnbAK1DMKZss=; b=FQSzufEJpHgEXdXVj7RJ7hNTKcgoV79nx+d0e7Am/nx1wtlmpnEm0lEwmqvYPpf7Rx wiU3dTxhItSJFWg+aMzhwylk7/8x/O6ZYHRKFQ/d4zRkBb8eEtJrkKK2p2eLW+CwoLaB cOSf+HdNoWbe1VApVrQTY578+Rqwxf5uHEXau22dC3u1y+1s6XagZzsqfXsIZHkw+uBe H1XgQ7XzX7GAvyv+bpnL8emy6jSckYdXc+Ah7XPy0FFEG9shQTx8Hjl7I3QogUiynPR3 wAE+6np2CPBt6Grj7sOsTV9xnRdyWZsrugH0fT2W4BehbhadwxrkhtZqxwQQydwxsjgR QYzQ== 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=yiKdEsXrfNBH7/8vYLZc3MqLfFg4s03EnbAK1DMKZss=; b=sFbmI3B4q+sheJm3V+00g0ADVIRuaGKVUK0nL+JFZGsYxSQJLwEDVJsnO7hFnJnLnC kTQmCArGoIf/mym1Nn8a4GLELR0kdtzAjYcuDsInEdiXjokIHydHdzyAxTdBZAoZBhgw /9eqW6q5MNTF1TUaXbW3XhRZnJ1htrrGRBsKOCQDnf7BFtAwGVjm6IGmT2HpaoP8mSvy F3MuI/XMr9cT6S1l/YSXrEBkuxDSPkvvx1sh5EuREsfxm/SV4+ZI/DQTG1KMQEhSZNzW GU5l5JY4o44r7SBUR1UvqhyjRGKQYA7FUgIyG+QgUHWYTd1I77TGkuTKO1bAHxP/joli oRLw== X-Gm-Message-State: AOAM531b2q8HVd1n4UAiGro3FqDQuFLgVqUYa3Q7a71A72gHVT2YrBwX uYoRlZpyMRQx+W/CB+P2BqylqSdS1FtjFA== X-Received: by 2002:a17:90a:a590:: with SMTP id b16mr4368232pjq.131.1597455113171; Fri, 14 Aug 2020 18:31:53 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.31.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:31:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 04/20] target/arm: Rearrange {sve,fp}_check_access assert Date: Fri, 14 Aug 2020 18:31:29 -0700 Message-Id: <20200815013145.539409-5-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::243; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x243.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" We want to ensure that access is checked by the time we ask for a specific fp/vector register. We want to ensure that we do not emit two lots of code to raise an exception. But sometimes it's difficult to cleanly organize the code such that we never pass through sve_check_access exactly once. Allow multiple calls so long as the result is true, that is, no exception to be raised. Signed-off-by: Richard Henderson --- target/arm/translate.h | 1 + target/arm/translate-a64.c | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate.h b/target/arm/translate.h index 16f2699ad7..ad7972eb22 100644 --- a/target/arm/translate.h +++ b/target/arm/translate.h @@ -64,6 +64,7 @@ typedef struct DisasContext { * that it is set at the point where we actually touch the FP regs. */ bool fp_access_checked; + bool sve_access_checked; /* ARMv8 single-step state (this is distinct from the QEMU gdbstub * single-step support). */ diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 534c3ff5f3..42aa695dff 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -1175,18 +1175,18 @@ static void do_vec_ld(DisasContext *s, int destidx, int element, * unallocated-encoding checks (otherwise the syndrome information * for the resulting exception will be incorrect). */ -static inline bool fp_access_check(DisasContext *s) +static bool fp_access_check(DisasContext *s) { - assert(!s->fp_access_checked); - s->fp_access_checked = true; + if (s->fp_excp_el) { + assert(!s->fp_access_checked); + s->fp_access_checked = true; - if (!s->fp_excp_el) { - return true; + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, + syn_fp_access_trap(1, 0xe, false), s->fp_excp_el); + return false; } - - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, - syn_fp_access_trap(1, 0xe, false), s->fp_excp_el); - return false; + s->fp_access_checked = true; + return true; } /* Check that SVE access is enabled. If it is, return true. @@ -1195,10 +1195,14 @@ static inline bool fp_access_check(DisasContext *s) bool sve_access_check(DisasContext *s) { if (s->sve_excp_el) { - gen_exception_insn(s, s->pc_curr, EXCP_UDEF, syn_sve_access_trap(), - s->sve_excp_el); + assert(!s->sve_access_checked); + s->sve_access_checked = true; + + gen_exception_insn(s, s->pc_curr, EXCP_UDEF, + syn_sve_access_trap(), s->sve_excp_el); return false; } + s->sve_access_checked = true; return fp_access_check(s); } @@ -14548,6 +14552,7 @@ static void disas_a64_insn(CPUARMState *env, DisasContext *s) s->base.pc_next += 4; s->fp_access_checked = false; + s->sve_access_checked = false; if (dc_isar_feature(aa64_bti, s)) { if (s->base.num_insns == 1) { From patchwork Sat Aug 15 01:31:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247768 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1295946ilo; Sat, 15 Aug 2020 10:06:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4cvAjwV2RVJKThWfuYfK3RHpyusLDLbOM7oMvJ4nX4huuNmONXZ+FhHmlpqkBBf9RHvWF X-Received: by 2002:a25:9242:: with SMTP id e2mr10105108ybo.341.1597511200169; Sat, 15 Aug 2020 10:06:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597511200; cv=none; d=google.com; s=arc-20160816; b=a5Xs3LgWMwRmvuoea8k100phQ53mN/0r1q0Gd3LUl+zm924iH1c6C84vzkhp4Zuqma pmHIbH8AMC8NgEZCr0N1kp7dGYb+zRT8fNE/FPHbeLKjguYvvXwe0+VnCqQW/+IiOt33 aC3vrT20t4RibN+Ym57FQbPOh/HlFqmBHTwcFXYgxLrkU7gIfl7ngvZQODAAVxNZvcCV Fd1A1g5oGga8l8CB+v5EbwMOM3mTJLWbg2quifhpOcqQvI923BnMWFi4T0bQMGHt8j0i clqyS/fJO3MFpNUzzQyJZ21WlFuPKOtVLz75ToR0IbQwySxx2RIuE1IUqB1RW1ZczkyK 9rBw== 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=AQeYh8suqz3vP9Br20s8Z+PHQd0HdWmpnfFfXQ0gVk0=; b=xAnLTENmuJTmYq47ExVQTcb8XadPTve/LXY8jv+lC9W/evnGVtFohFhvm0D5SwD5hm x4bnxi+L+jNPfnV00yQdKc6pyaHM8+HiFLM2ozpuJJqS43Jw9PoHr9pESrZneblIXIUt GlAOQWP7HtStgV3xrjbOz1n8sMIWnjw4wccGK7E4IRKVChBc8fz2fZhhFqMeTeRHWleA bEU6RREGNqlUBbyXtpNpdpbhtt5yMthZBe8WVEIHPpb3q3d4VwK7dzyazO9wi7Zxp12y MtKXJNpkpDuJ0WJ8vKkS9s/K8qJtzjvQ3YfFNYNDHDKSfg74pFxb26Vp9kyr5RTyHz2E 85oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t2I2BFiV; 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 206si11387808ybb.62.2020.08.15.10.06.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 10:06:40 -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=t2I2BFiV; 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]:35476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6zdf-0002oM-Ka for patch@linaro.org; Sat, 15 Aug 2020 13:06:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6zdT-0002m4-Cb for qemu-devel@nongnu.org; Sat, 15 Aug 2020 13:06:27 -0400 Received: from mail-oi1-x243.google.com ([2607:f8b0:4864:20::243]:35375) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6zdR-0001Oe-Ng for qemu-devel@nongnu.org; Sat, 15 Aug 2020 13:06:27 -0400 Received: by mail-oi1-x243.google.com with SMTP id k4so11055205oik.2 for ; Sat, 15 Aug 2020 10:06:25 -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=AQeYh8suqz3vP9Br20s8Z+PHQd0HdWmpnfFfXQ0gVk0=; b=t2I2BFiVfxZRRTbfGq6Pp8+KC7+vdcTG7s5uPvYm5KTwr7LPY8+qxlUceEO7cRkVii gtqwVWEtHqLa3ySJvJi/ZDBT1bvvU75Wqt4BrncS1AMw0TthNkV9lsHDNtHhT+jBh4vu glijcRgpMjAQ4oqO1S4Hjh5JOIxsyKLTp4mtLSWJazvHXxWOiBghvAbidl4Pimw2qryi ZV9TQPS84gKMtVk6xKoIedIUohdMWyk332yW7YHeOuVgs5cqnXu5KLJW6Vh80HyMTayv 7GdN0GGziLd8Gd3nEeoOXZY4ZfJdIhWf5I+4pYe7w3cL6mkjlJ50qAudPY8zrRF7pPTv x3Mw== 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=AQeYh8suqz3vP9Br20s8Z+PHQd0HdWmpnfFfXQ0gVk0=; b=a+kxizJjRLXkdaB+UZOQ6yNCGSbuNFJoNPaT2iqcYPsc2PpP6GfmQIyME3D8IpQasN oJ/z2zNcQU+tWY7oRuKyZvpdthx9RBC06nywLgFrvTzMTZN5wUxveMR0eqwMjwyfIxlN bqT5aC9KdtbtoTPDEs9AoaSKAwu+6mKOjosuWqRpW4+5l11ngxAGadf55dNv37unjZdQ RpwJO6v6TSwX/SOxYtYPYSCETENasyjxpNZPr/D0niz4rf8pyZhh+AEg3hWYVEXqBFU7 Qm6VjwxsFM1FDDb9qePzGWe9az8gJP+lm7K97YyQJFuViwfOPDQNyqI+mhyvm1KYtUhj ahHw== X-Gm-Message-State: AOAM531yHXShWL3r3bpz+sVLp++yG5tV3L1z16RGEfkutT/vE/Lt7KgW NbklA+0w2+MHaRBrQm9LSsZ/qLyrKgnLGA== X-Received: by 2002:a17:90a:eb09:: with SMTP id j9mr4558758pjz.192.1597455114402; Fri, 14 Aug 2020 18:31:54 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.31.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:31:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 05/20] target/arm: Merge do_vector2_p into do_mov_p Date: Fri, 14 Aug 2020 18:31:30 -0700 Message-Id: <20200815013145.539409-6-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::243; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x243.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" This is the only user of the function. Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index b0fa38db1c..d310709de3 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -178,18 +178,6 @@ static void do_dupi_z(DisasContext *s, int rd, uint64_t word) tcg_gen_gvec_dup_imm(MO_64, vec_full_reg_offset(s, rd), vsz, vsz, word); } -/* Invoke a vector expander on two Pregs. */ -static bool do_vector2_p(DisasContext *s, GVecGen2Fn *gvec_fn, - int esz, int rd, int rn) -{ - if (sve_access_check(s)) { - unsigned psz = pred_gvec_reg_size(s); - gvec_fn(esz, pred_full_reg_offset(s, rd), - pred_full_reg_offset(s, rn), psz, psz); - } - return true; -} - /* Invoke a vector expander on three Pregs. */ static bool do_vector3_p(DisasContext *s, GVecGen3Fn *gvec_fn, int esz, int rd, int rn, int rm) @@ -221,7 +209,12 @@ static bool do_vecop4_p(DisasContext *s, const GVecGen4 *gvec_op, /* Invoke a vector move on two Pregs. */ static bool do_mov_p(DisasContext *s, int rd, int rn) { - return do_vector2_p(s, tcg_gen_gvec_mov, 0, rd, rn); + if (sve_access_check(s)) { + unsigned psz = pred_gvec_reg_size(s); + tcg_gen_gvec_mov(MO_8, pred_full_reg_offset(s, rd), + pred_full_reg_offset(s, rn), psz, psz); + } + return true; } /* Set the cpu flags as per a return from an SVE helper. */ From patchwork Sat Aug 15 01:31:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247751 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1231236ilo; Sat, 15 Aug 2020 08:12:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLRfDCgQz7uYcjYvYdzHzmBR/SlHc34f5HkBAA01li6Dz4pLt8YhnOJi+yyIyMJFQx/NVO X-Received: by 2002:a25:c786:: with SMTP id w128mr10344583ybe.212.1597504375429; Sat, 15 Aug 2020 08:12:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597504375; cv=none; d=google.com; s=arc-20160816; b=Dh59Ec5rt4zLj4/+IW+LRN9Rzk5xSxl7mSbcU0sgjb55ccg8bB8HgxhlOyygfyjWJA ZP+68v2j84WIfGjZ69cBCOlfBvkPEDPfjB+oyGqUKCEVC5rCxcCypXJnKBEI7AT/Bxtw VOnAnnZbnb9UPy3UdPK0vrb17+BnrqNCX43j5AYmxAtdZW7DYreFZ4XKorvt2lm9CO7U KFfufJRPXycuSo5jsgL7uSvCjFZ+/Z7M/Z/nQDg2GOMKJUK8+EFy8cWVKXu2mwrlizva uKsq5kOJJJ+6k88B7JXQykXuzW0dK/MnQURyAsC36Y/N7EHLZZO4VrWh7V+W/5v85tTb AEEA== 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=x4ut4WZwpjGYcQOKgnzpo5v3a5LcV3S0PAGa2UNZBIM=; b=a8Ur6YlPibVOPQkC6hmYOfjMAtCD4AEsB97EOa14uAY4TffcayaIlbrv5idLaG1DUS Lo8r6ZQa3quMNKu5OmbFSL5z/VDdHCp93YodgkRZzJRFRBUf9T3avin4Elu43tT68X+c R7exZz6WrcN0f32MSWNxGOcIoXraQqAcIfow7qH8Se3jZ1b7yJWrd2mxij099nH3+/5N UziQ6CiVW0BZ7tr62ev/WiWaqWGhMuDabV3rGKTm1KRkEW6N/80y7oWYL8/oC4meI3dW 1L4mz7R/9K2IG70h6vwBNICCm/yljChDjphm5bQmxYYr55oYgEDjZKetjJIIztHAL5LZ +DpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gG284Da9; 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 m74si11503535ybm.81.2020.08.15.08.12.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 08:12:55 -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=gG284Da9; 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]:37890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6xra-0002j7-R0 for patch@linaro.org; Sat, 15 Aug 2020 11:12:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6xo2-0006xh-4a for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:09:14 -0400 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]:34964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6xnz-00084J-QY for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:09:13 -0400 Received: by mail-oi1-x241.google.com with SMTP id k4so10835933oik.2 for ; Sat, 15 Aug 2020 08:09:11 -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=x4ut4WZwpjGYcQOKgnzpo5v3a5LcV3S0PAGa2UNZBIM=; b=gG284Da9hxLVdfCl2ISzxrSvmsk5ZP0k51X88l8lXXLnObQbs90FdTMvR9cQyxUt5a bz1NGhhyfB77FrbgaCevsPfna37TtKCBV2X7h3/Q0ll9SfTIX7Kepk96K6dBwnCo2lyI gfJSdrLrSiquGZdQkthb39w1NzYsSA9l92LzgdKz9XDth/Xx005Dobe2lLDb9IdqyLBZ x/WK1BSeSrDzGApKWz9oq2Q8quDU4mLVbiYolNNPlvfa8AphAcN/6UZsBzzaJcKZG/K+ axyq8+CB9YEpw6i2NVEHDJuDAJpdIAZMNCIsJKv3dIn35wcrMhnY1pz5WvM51Vwdw4+i ACBw== 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=x4ut4WZwpjGYcQOKgnzpo5v3a5LcV3S0PAGa2UNZBIM=; b=DcbvLZNiqcTwHEJ5OweuB/QJsRyzwSxZIJq0BX8C+MZsWLnFe2EWqFzO8JJjGitKuJ xxY2i2rnAJA/8d797LqhFkqJii8r6wqmw7BV4EKw1qQSjYJ+8uz06i3v7xZgFazjEouX mafucE/2KCSYdtJ7yDZ7PdX7rrKdig1lPC6Fg0fRe+yraZtMfQgJXLVbcKBtr/sQKaHB gHTt/UT15T/4JGuRl0hO85cSyt1pBfhwxDqICdNgZjtfjigFvNGu8Ku3ThoYJHqaEoxP majyftnzci0VmQfLfJaQA5hjEyLbGHapbX6lR7EaZOy1h+V9nZHKI2DjFS24YTVyTpXv Umsg== X-Gm-Message-State: AOAM5320HHlYgkYNy4mNTIhVDJoQ90YI5541TjRWRNjQpOk1mXLh8iC2 S8hVFqFknOxXkUSh5ox4wtg7iXS4czMpXQ== X-Received: by 2002:a17:90a:a101:: with SMTP id s1mr3993200pjp.205.1597455116091; Fri, 14 Aug 2020 18:31:56 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.31.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:31:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 06/20] target/arm: Clean up 4-operand predicate expansion Date: Fri, 14 Aug 2020 18:31:31 -0700 Message-Id: <20200815013145.539409-7-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::241; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x241.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" Move the check for !S into do_pppp_flags, which allows to merge in do_vecop4_p. Split out gen_gvec_fn_ppp without sve_access_check, to mirror gen_gvec_fn_zzz. Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 111 ++++++++++++++----------------------- 1 file changed, 43 insertions(+), 68 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index d310709de3..13a0194d59 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -179,31 +179,13 @@ static void do_dupi_z(DisasContext *s, int rd, uint64_t word) } /* Invoke a vector expander on three Pregs. */ -static bool do_vector3_p(DisasContext *s, GVecGen3Fn *gvec_fn, - int esz, int rd, int rn, int rm) +static void gen_gvec_fn_ppp(DisasContext *s, GVecGen3Fn *gvec_fn, + int rd, int rn, int rm) { - if (sve_access_check(s)) { - unsigned psz = pred_gvec_reg_size(s); - gvec_fn(esz, pred_full_reg_offset(s, rd), - pred_full_reg_offset(s, rn), - pred_full_reg_offset(s, rm), psz, psz); - } - return true; -} - -/* Invoke a vector operation on four Pregs. */ -static bool do_vecop4_p(DisasContext *s, const GVecGen4 *gvec_op, - int rd, int rn, int rm, int rg) -{ - if (sve_access_check(s)) { - unsigned psz = pred_gvec_reg_size(s); - tcg_gen_gvec_4(pred_full_reg_offset(s, rd), - pred_full_reg_offset(s, rn), - pred_full_reg_offset(s, rm), - pred_full_reg_offset(s, rg), - psz, psz, gvec_op); - } - return true; + unsigned psz = pred_gvec_reg_size(s); + gvec_fn(MO_64, pred_full_reg_offset(s, rd), + pred_full_reg_offset(s, rn), + pred_full_reg_offset(s, rm), psz, psz); } /* Invoke a vector move on two Pregs. */ @@ -1067,6 +1049,11 @@ static bool do_pppp_flags(DisasContext *s, arg_rprr_s *a, int mofs = pred_full_reg_offset(s, a->rm); int gofs = pred_full_reg_offset(s, a->pg); + if (!a->s) { + tcg_gen_gvec_4(dofs, nofs, mofs, gofs, psz, psz, gvec_op); + return true; + } + if (psz == 8) { /* Do the operation and the flags generation in temps. */ TCGv_i64 pd = tcg_temp_new_i64(); @@ -1126,19 +1113,24 @@ static bool trans_AND_pppp(DisasContext *s, arg_rprr_s *a) .fno = gen_helper_sve_and_pppp, .prefer_i64 = TCG_TARGET_REG_BITS == 64, }; - if (a->s) { - return do_pppp_flags(s, a, &op); - } else if (a->rn == a->rm) { - if (a->pg == a->rn) { - return do_mov_p(s, a->rd, a->rn); - } else { - return do_vector3_p(s, tcg_gen_gvec_and, 0, a->rd, a->rn, a->pg); + + if (!a->s) { + if (!sve_access_check(s)) { + return true; + } + if (a->rn == a->rm) { + if (a->pg == a->rn) { + do_mov_p(s, a->rd, a->rn); + } else { + gen_gvec_fn_ppp(s, tcg_gen_gvec_and, a->rd, a->rn, a->pg); + } + return true; + } else if (a->pg == a->rn || a->pg == a->rm) { + gen_gvec_fn_ppp(s, tcg_gen_gvec_and, a->rd, a->rn, a->rm); + return true; } - } else if (a->pg == a->rn || a->pg == a->rm) { - return do_vector3_p(s, tcg_gen_gvec_and, 0, a->rd, a->rn, a->rm); - } else { - return do_vecop4_p(s, &op, a->rd, a->rn, a->rm, a->pg); } + return do_pppp_flags(s, a, &op); } static void gen_bic_pg_i64(TCGv_i64 pd, TCGv_i64 pn, TCGv_i64 pm, TCGv_i64 pg) @@ -1162,13 +1154,14 @@ static bool trans_BIC_pppp(DisasContext *s, arg_rprr_s *a) .fno = gen_helper_sve_bic_pppp, .prefer_i64 = TCG_TARGET_REG_BITS == 64, }; - if (a->s) { - return do_pppp_flags(s, a, &op); - } else if (a->pg == a->rn) { - return do_vector3_p(s, tcg_gen_gvec_andc, 0, a->rd, a->rn, a->rm); - } else { - return do_vecop4_p(s, &op, a->rd, a->rn, a->rm, a->pg); + + if (!a->s && a->pg == a->rn) { + if (sve_access_check(s)) { + gen_gvec_fn_ppp(s, tcg_gen_gvec_andc, a->rd, a->rn, a->rm); + } + return true; } + return do_pppp_flags(s, a, &op); } static void gen_eor_pg_i64(TCGv_i64 pd, TCGv_i64 pn, TCGv_i64 pm, TCGv_i64 pg) @@ -1192,11 +1185,7 @@ static bool trans_EOR_pppp(DisasContext *s, arg_rprr_s *a) .fno = gen_helper_sve_eor_pppp, .prefer_i64 = TCG_TARGET_REG_BITS == 64, }; - if (a->s) { - return do_pppp_flags(s, a, &op); - } else { - return do_vecop4_p(s, &op, a->rd, a->rn, a->rm, a->pg); - } + return do_pppp_flags(s, a, &op); } static void gen_sel_pg_i64(TCGv_i64 pd, TCGv_i64 pn, TCGv_i64 pm, TCGv_i64 pg) @@ -1222,11 +1211,11 @@ static bool trans_SEL_pppp(DisasContext *s, arg_rprr_s *a) .fno = gen_helper_sve_sel_pppp, .prefer_i64 = TCG_TARGET_REG_BITS == 64, }; + if (a->s) { return false; - } else { - return do_vecop4_p(s, &op, a->rd, a->rn, a->rm, a->pg); } + return do_pppp_flags(s, a, &op); } static void gen_orr_pg_i64(TCGv_i64 pd, TCGv_i64 pn, TCGv_i64 pm, TCGv_i64 pg) @@ -1250,13 +1239,11 @@ static bool trans_ORR_pppp(DisasContext *s, arg_rprr_s *a) .fno = gen_helper_sve_orr_pppp, .prefer_i64 = TCG_TARGET_REG_BITS == 64, }; - if (a->s) { - return do_pppp_flags(s, a, &op); - } else if (a->pg == a->rn && a->rn == a->rm) { + + if (!a->s && a->pg == a->rn && a->rn == a->rm) { return do_mov_p(s, a->rd, a->rn); - } else { - return do_vecop4_p(s, &op, a->rd, a->rn, a->rm, a->pg); } + return do_pppp_flags(s, a, &op); } static void gen_orn_pg_i64(TCGv_i64 pd, TCGv_i64 pn, TCGv_i64 pm, TCGv_i64 pg) @@ -1280,11 +1267,7 @@ static bool trans_ORN_pppp(DisasContext *s, arg_rprr_s *a) .fno = gen_helper_sve_orn_pppp, .prefer_i64 = TCG_TARGET_REG_BITS == 64, }; - if (a->s) { - return do_pppp_flags(s, a, &op); - } else { - return do_vecop4_p(s, &op, a->rd, a->rn, a->rm, a->pg); - } + return do_pppp_flags(s, a, &op); } static void gen_nor_pg_i64(TCGv_i64 pd, TCGv_i64 pn, TCGv_i64 pm, TCGv_i64 pg) @@ -1308,11 +1291,7 @@ static bool trans_NOR_pppp(DisasContext *s, arg_rprr_s *a) .fno = gen_helper_sve_nor_pppp, .prefer_i64 = TCG_TARGET_REG_BITS == 64, }; - if (a->s) { - return do_pppp_flags(s, a, &op); - } else { - return do_vecop4_p(s, &op, a->rd, a->rn, a->rm, a->pg); - } + return do_pppp_flags(s, a, &op); } static void gen_nand_pg_i64(TCGv_i64 pd, TCGv_i64 pn, TCGv_i64 pm, TCGv_i64 pg) @@ -1336,11 +1315,7 @@ static bool trans_NAND_pppp(DisasContext *s, arg_rprr_s *a) .fno = gen_helper_sve_nand_pppp, .prefer_i64 = TCG_TARGET_REG_BITS == 64, }; - if (a->s) { - return do_pppp_flags(s, a, &op); - } else { - return do_vecop4_p(s, &op, a->rd, a->rn, a->rm, a->pg); - } + return do_pppp_flags(s, a, &op); } /* From patchwork Sat Aug 15 01:31:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247757 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1244356ilo; Sat, 15 Aug 2020 08:35:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzf58oXLBXFOSoMWZ4Xnz1LY2bt0CDoA7CK7x0vpOuCn0VOGMvAS7JAO3TDF6WkhB3E8vKN X-Received: by 2002:a25:2057:: with SMTP id g84mr9872637ybg.169.1597505724031; Sat, 15 Aug 2020 08:35:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597505724; cv=none; d=google.com; s=arc-20160816; b=r7MdJYYU53V8Zhp+GA6YWRSBhm6ctCqEKHiBW+kYpDIBwPVK4YKiDjMIflAiVcNlZL xQRAXWgrvxbR30nfh30eLAs01Q68hsgxB/4gtmiF3ZYRmXZIDR3QmoQss6rSM3Zx8+Jq JfgqFzv0AXlApYrefKiudZG+Rn+eRLmzXuN3M1c1aQ3atZRlpzfOcEFsf6HrPYHitrN7 /LlF/mgue3Z8kPEuApPQWbKIEyXPNU9CUGtT/dBY3AsYuo3abPB+PiLrIMv7dvGpk53s J/SiWG+RMuZ/6DzGqI00joP80g/hVJHnpiTFEcXt7MBbrVXVkkRKwN+gTsmHEpR+lE7Z a8ZA== 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=R/VNIRE45vthmnotX1ygL9JJ9jQ4MS1MvprbVVBA5VY=; b=on+T9Be10tC75Aa5obaoTCkL+w/+nbMgVc9Y6ADEL/Y74ubiVoV+Te+9/UilirbtKq 8JS3Wvv652PSgXOSs5+mdcaJNcLSgBmZMI/iQgFLNuzJIDaJ1sFWD2LT9n/opedVnHaT zmb6Qt0+0Ft0pZmNFlUtN88PZ+9JfdSG1hJIKBU4brWAUiSoFIkKjD7QBCCEsc7Ux8+z SXfKu09OFAjlqIsNlNMiwRLizmdtnGaQNkviSXVd4dA6BwfcCelSI5LvgKD8pHFCvO+i 1lURx3fS/MBWrX2PqzmzOSAWTbBQ7s9NpibOMAZNmgZGXwEgi1p69ZSAM7/utpKLQa8K Jf5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gvH5QVMb; 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 s141si11003883ybc.165.2020.08.15.08.35.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 08:35:24 -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=gvH5QVMb; 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]:35894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6yDL-0003cn-7u for patch@linaro.org; Sat, 15 Aug 2020 11:35:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6yD6-0003ba-Mv for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:35:08 -0400 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:43365) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6yD4-0005Ax-Tj for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:35:08 -0400 Received: by mail-oi1-x242.google.com with SMTP id l84so10859090oig.10 for ; Sat, 15 Aug 2020 08:35:06 -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=R/VNIRE45vthmnotX1ygL9JJ9jQ4MS1MvprbVVBA5VY=; b=gvH5QVMbEqOryeyl9dG5muTYrPA1X2ec1UBGAhHofCPrkxEnLB55P0VmV3lO1s7Dz6 5YUqrqkk8aPxtJ5reUm2bYEjkLjopYVbu6zY9rHkn5XpDoemaYNWhi3M3ENIvQVS7mlJ edLQWGaSawykGX1hDuSifoX/pm2ML0IxlxR46maSiafZIl3TAs9goZu9tx54n7bIsZbE Zm2fZSkf2VaHsmwWSn0tFP8WSzU8OLpyFUSb3iE/qOovcwe2AN8bcD0Z6tfNp6nON3SL rxfKDgZjqahjtzITSDdHb2zrrp1qhnV1taJNMVwdbTgaoSTajeE2xyiOIslEaairMxsq HoTw== 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=R/VNIRE45vthmnotX1ygL9JJ9jQ4MS1MvprbVVBA5VY=; b=rvfxWqYk3TGWQ5nqDciYmWmUXUdLYjLcR6ih03VEM8xKWMWeRw5Tg5cqIJ2O5wT2cV rs1xqoQl7PW2T8bz+n6vITlZLc7C3XmH3A0cE8CDAlzZoBZdpUtyTo3OwydFa0FmfpT0 a5fCxhmRChxOl2JjjqDhW0/iARwKGOWwu0YUEiOo+Aq0AHQqeiuGcgyCAM0VDe2UHXvh 8xjaREmUgbc9bOLYYzesGxkLg2gPzWp8F5KtFnZB7Hk69hWLhpSEyydS2VWDCNdZvsNX 7ik6LDki5KHZAqFlPXDOse7EbPbkN8SHWj+r+zuR5J1hUkOYh2PIP2rT76rBxoH+qcDs xmuQ== X-Gm-Message-State: AOAM532W+9kJTNJ3gnIQjAKhNIBqYGn/pYATaJMl1YKgEwXIQ3PF+0i8 leeR1yAwg6PuFbMLy2ss3yZBydOFpiBtIA== X-Received: by 2002:a17:90a:ac0b:: with SMTP id o11mr4547374pjq.191.1597455117508; Fri, 14 Aug 2020 18:31:57 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.31.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:31:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 07/20] target/arm: Use tcg_gen_gvec_bitsel for trans_SEL_pppp Date: Fri, 14 Aug 2020 18:31:32 -0700 Message-Id: <20200815013145.539409-8-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::242; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x242.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" The gvec operation was added after the initial implementation of the SEL instruction and was missed in the conversion. Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 13a0194d59..aa7ed070e3 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -1188,34 +1188,19 @@ static bool trans_EOR_pppp(DisasContext *s, arg_rprr_s *a) return do_pppp_flags(s, a, &op); } -static void gen_sel_pg_i64(TCGv_i64 pd, TCGv_i64 pn, TCGv_i64 pm, TCGv_i64 pg) -{ - tcg_gen_and_i64(pn, pn, pg); - tcg_gen_andc_i64(pm, pm, pg); - tcg_gen_or_i64(pd, pn, pm); -} - -static void gen_sel_pg_vec(unsigned vece, TCGv_vec pd, TCGv_vec pn, - TCGv_vec pm, TCGv_vec pg) -{ - tcg_gen_and_vec(vece, pn, pn, pg); - tcg_gen_andc_vec(vece, pm, pm, pg); - tcg_gen_or_vec(vece, pd, pn, pm); -} - static bool trans_SEL_pppp(DisasContext *s, arg_rprr_s *a) { - static const GVecGen4 op = { - .fni8 = gen_sel_pg_i64, - .fniv = gen_sel_pg_vec, - .fno = gen_helper_sve_sel_pppp, - .prefer_i64 = TCG_TARGET_REG_BITS == 64, - }; - if (a->s) { return false; } - return do_pppp_flags(s, a, &op); + if (sve_access_check(s)) { + unsigned psz = pred_gvec_reg_size(s); + tcg_gen_gvec_bitsel(MO_8, pred_full_reg_offset(s, a->rd), + pred_full_reg_offset(s, a->pg), + pred_full_reg_offset(s, a->rn), + pred_full_reg_offset(s, a->rm), psz, psz); + } + return true; } static void gen_orr_pg_i64(TCGv_i64 pd, TCGv_i64 pn, TCGv_i64 pm, TCGv_i64 pg) From patchwork Sat Aug 15 01:31:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247758 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1263250ilo; Sat, 15 Aug 2020 09:07:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgcJymLv5Q/Jqw607zbDDNFalFhDHXAFFDbjUatujUXRpfA/eBEZxlqBam+yTzyIRTmYTv X-Received: by 2002:a67:ffca:: with SMTP id w10mr4355657vsq.142.1597507662798; Sat, 15 Aug 2020 09:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597507662; cv=none; d=google.com; s=arc-20160816; b=uW3PerE+OOPLQ5de/bWc+H9idNjtvmWttRoZR+wN2kradhqCfLSFN2daW2ETfO6GfD 0Yvv4edJ6Hi1mdiK/qasCSXJc5g+kfrMfiwftgFRKPNION+FujKGuRpCiTvVsx+idSTi nkcf34sKzjA7Xky/64JW1Y2CtWKk5pHvTG7YaYs4rHHK7fRUwJ0tdDXFwrOKAAd1AGE9 NdCiDCyE23nhBKXd0lBJ82uevZZmCzx2C3BqLSqeIiMazNUfxcnffDlznXi5DeZtCYNq C47CG1K4gyN55SWQKKdC6pcjuaSE2E7A8/iF7goGuYZJIc0h/WI0Lw70DVNEI9+LOWI5 itMQ== 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=SDfyZ1vPdbyiEKDNiF+oq98+HOXuA4JwMfm0jf3z2+s=; b=SCt5PtGHTACXMNxDdtmGHQ+8YzfiFyMkWGgXB1GliaE7aRk0Kz8yygTEtWhRbLt5kh E2Q1OnKtXV0NvASklfUG9iqrqtFyOEhTMtE2MFUSCWRzTGajszvNs9dyLDh3ppsdvn3n ognUHo2dNdKM2MDx/GmTTJW1SSWWn62IrWvL61Jgn1Fe5qzDEyNhKVJt1S78Mc6YRXDV uFT0dp6Kzl+1Ez7tNaqDmFmYwazbBypbuKvJQMVjKsqeNixEecZLIxkYlFLj3If63g6Y TZp/I4LFvQfwgpbPC+X5G4QPGVCEda8bMHtL89FmK1ZKxQvHOS6WXqfvr1Ht7SfRSjD0 NehA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JKrf+TQX; 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 u137si2233890vsc.405.2020.08.15.09.07.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 09:07:42 -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=JKrf+TQX; 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]:42138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6yic-0005qx-89 for patch@linaro.org; Sat, 15 Aug 2020 12:07:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6yc6-0007Az-5r for qemu-devel@nongnu.org; Sat, 15 Aug 2020 12:00:58 -0400 Received: from mail-oi1-x243.google.com ([2607:f8b0:4864:20::243]:33676) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6yc4-0001RE-7r for qemu-devel@nongnu.org; Sat, 15 Aug 2020 12:00:57 -0400 Received: by mail-oi1-x243.google.com with SMTP id n128so7085509oif.0 for ; Sat, 15 Aug 2020 09:00:55 -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=SDfyZ1vPdbyiEKDNiF+oq98+HOXuA4JwMfm0jf3z2+s=; b=JKrf+TQX3ghbMiQT0U6DNXZaI1HLVIPq4T8Ik6AKld+BYK/XN+cM4sNVqmOJLWALCt UYp3Nsx5BqQTlyGeactN2CqC3y5SI2pBCnqOpsB8lkTVBweEAfOKyAoJn6T1hZc6Scbo 2/Js8ZDJd+VLOLow+YWVZ5EZ760wCHJMnT4JAj/+v+F7sDoIJrXD9DTaRLZxdnFzbqHX Zuf7mhBP4nxy+eHd2MIYc5OFowDuAHwnEKDLs+m9bodisyIgjwfRw1oBHTySDbVJLCXw nBDljL4Zcll3Mj0o9HO1xWqMvHlDN8KGpkZrWvt5bJXdlaV6o+mI2A3E2aP0Gg/aq1/V uSyA== 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=SDfyZ1vPdbyiEKDNiF+oq98+HOXuA4JwMfm0jf3z2+s=; b=i3YYWtsEZiMZZ81CAmSXIEZozayix/EqlJ3p5GOquOMeiJsbNjCgQ7/+DqcBqXZWTO Tuhz58DSXvGbTfNkbmRfa82zH5y3sFdSKLOHybfEQvlqjAzJX2nsvCg15hQki6J6eXAC M+N9EErZhEK+l2TevoL6kn3wcId5zhZ3aCCaSNZ1K+WX0IQ72Ssr8t//NiQoK9YwtquB UK+q5WrsrJ815z8U34zYg8rbR5CBh3X2HWD8ApZHDfaI5Vz0tx9t5RJDExmkyYdk/3kG jtnQ1bQofqnZJVkfGyA1jih/gvxFZhH7l5OvoPoQd4Qga4/eMTSiQyya4pd5VOESYuXT HsKA== X-Gm-Message-State: AOAM532OMKzRdzJGOb9V7LSEATZqqHGQ62n/MsShCgzV2DrkOUn7V//0 DQnqoWb5BzBx0nIbqNK/W3hX+ACSW+L8cA== X-Received: by 2002:a17:90a:cf15:: with SMTP id h21mr4401515pju.108.1597455118711; Fri, 14 Aug 2020 18:31:58 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.31.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:31:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 08/20] target/arm: Split out gen_gvec_ool_zzzp Date: Fri, 14 Aug 2020 18:31:33 -0700 Message-Id: <20200815013145.539409-9-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::243; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x243.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" Model after gen_gvec_fn_zzz et al. Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index aa7ed070e3..535d086838 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -142,8 +142,19 @@ static int pred_gvec_reg_size(DisasContext *s) return size_for_gvec(pred_full_reg_size(s)); } -/* Invoke a vector expander on two Zregs. */ +/* Invoke an out-of-line helper on 3 Zregs and a predicate. */ +static void gen_gvec_ool_zzzp(DisasContext *s, gen_helper_gvec_4 *fn, + int rd, int rn, int rm, int pg, int data) +{ + unsigned vsz = vec_full_reg_size(s); + tcg_gen_gvec_4_ool(vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + vec_full_reg_offset(s, rm), + pred_full_reg_offset(s, pg), + vsz, vsz, data, fn); +} +/* Invoke a vector expander on two Zregs. */ static void gen_gvec_fn_zz(DisasContext *s, GVecGen2Fn *gvec_fn, int esz, int rd, int rn) { @@ -314,16 +325,11 @@ static bool trans_UQSUB_zzz(DisasContext *s, arg_rrr_esz *a) static bool do_zpzz_ool(DisasContext *s, arg_rprr_esz *a, gen_helper_gvec_4 *fn) { - unsigned vsz = vec_full_reg_size(s); if (fn == NULL) { return false; } if (sve_access_check(s)) { - tcg_gen_gvec_4_ool(vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), - vec_full_reg_offset(s, a->rm), - pred_full_reg_offset(s, a->pg), - vsz, vsz, 0, fn); + gen_gvec_ool_zzzp(s, fn, a->rd, a->rn, a->rm, a->pg, 0); } return true; } @@ -337,12 +343,7 @@ static void do_sel_z(DisasContext *s, int rd, int rn, int rm, int pg, int esz) gen_helper_sve_sel_zpzz_b, gen_helper_sve_sel_zpzz_h, gen_helper_sve_sel_zpzz_s, gen_helper_sve_sel_zpzz_d }; - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_4_ool(vec_full_reg_offset(s, rd), - vec_full_reg_offset(s, rn), - vec_full_reg_offset(s, rm), - pred_full_reg_offset(s, pg), - vsz, vsz, 0, fns[esz]); + gen_gvec_ool_zzzp(s, fns[esz], rd, rn, rm, pg, 0); } #define DO_ZPZZ(NAME, name) \ @@ -2704,12 +2705,8 @@ static bool trans_RBIT(DisasContext *s, arg_rpr_esz *a) static bool trans_SPLICE(DisasContext *s, arg_rprr_esz *a) { if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_4_ool(vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), - vec_full_reg_offset(s, a->rm), - pred_full_reg_offset(s, a->pg), - vsz, vsz, a->esz, gen_helper_sve_splice); + gen_gvec_ool_zzzp(s, gen_helper_sve_splice, + a->rd, a->rn, a->rm, a->pg, 0); } return true; } From patchwork Sat Aug 15 01:31:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247756 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1243184ilo; Sat, 15 Aug 2020 08:33:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6hDHW05r/MjV06PJTDDwV/EMcPDV8MfCtMZuvq/hPTAGI5VamnfpjoEk+dEvh+fLMvBl1 X-Received: by 2002:a5b:a87:: with SMTP id h7mr9730918ybq.333.1597505610838; Sat, 15 Aug 2020 08:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597505610; cv=none; d=google.com; s=arc-20160816; b=ps0GwI9JCnnoFXocdwdhH4GIxm8TN+Zs3Mc4Q3zIHGP8Rokpb/Js7mH3UgcliZWP2z 61yIrmMIQE/VBFdzP6w2MHGgTCEPbNRVNVcFKJxY1kIJzC6vAYlTUGav0NXyuCCQcy+J 8yqZHQKOK8oafNB1wC1lq4BwOX+Xslt9iSHsTR1dhbyJftdoErBZvBGMuFTnuyeGeGmu 0D/AXeiK1Q1gUEdy4sLvk/WVlTwNnAO84tvehdQGxVywkr1pGWZQkUGbZuvNQ3nEUB7u VPjrsQyIRL2f1aKnqNG6zDBMJwGt5pMq6Z49s7jgxA3W/T1Trhd+UpCEbO0AMnF7iVWq 969g== 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=72ANVc0SFy0xyCZHDYbUoUse0EmBxcTqUm+ixpLW/bM=; b=ZMXAh6+eB+EyhVSFA5m6aSiglJ71jW/xlAG0drdX2ovH+dk5ZskNONSmDScc11Gx7q shmGmLVh+wly3Qu8fsmvDdI9NHw/R34HvulaXOLah3lgS07yHlfvkvrRvorG17aYaG/S KWYBdADyS1IQY1Gq+hNxFY9jTjeEX0uOq8nEgQH3b4h8S5v/pW1VUZlsswj37U2j2+GI OyUYs0hy97LmXv0GLqhnp4UNtp5H9AegAV924TIwsfS/zzB+bkKkUpUHTPCzMw1Wjqhl tn2b/I8g5R75/SMFIUqT768biv/yw1YB7IVh9+tRSRkdR/bTXOZCxdaCoY8U2IW8M1Zm jYEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UkMvwG8g; 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 15si10958668ybj.90.2020.08.15.08.33.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 08:33:30 -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=UkMvwG8g; 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]:57286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6yBW-0000oh-9v for patch@linaro.org; Sat, 15 Aug 2020 11:33:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6yAr-0008Sc-8V for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:32:49 -0400 Received: from mail-oi1-x242.google.com ([2607:f8b0:4864:20::242]:42573) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6yAp-0004rA-5w for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:32:48 -0400 Received: by mail-oi1-x242.google.com with SMTP id j7so10860769oij.9 for ; Sat, 15 Aug 2020 08:32:46 -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=72ANVc0SFy0xyCZHDYbUoUse0EmBxcTqUm+ixpLW/bM=; b=UkMvwG8gWO2J5ok5oXLL7W6Owl0D5qppGXv/fw40l1lVb3XDkFl2Tr/dVmR4t/wlQs oW7F+qzBs9JGRJK5E2xb7v/HGziM7D5T9ZUQCOPpIQOwT3r/WP0FcykG6ViNHabvnR/+ bpecqRsBefD4SV31Y4/QCT7Xa7M7hn7xrVprB7kuHI68wIqOtW8gmuAPpDBta1gh4O06 7fsD4hTqy+y85cBOdHytlquD1GdHTnyY6FjYq4MP/ie/Sy1e7ou3ej1ZRk5sHPBTZ05E GQ/QXJdUet3FTqWPl8/qrpCk+HbpdyhwbGl86Rooz9ujxQW7/wHFzvZzPFouLrMFV8NZ y9wg== 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=72ANVc0SFy0xyCZHDYbUoUse0EmBxcTqUm+ixpLW/bM=; b=tFEwWRYJPoeOMowsIbILVrVrXKWJ1THxXV/6XTTjSp6/e2VxkwfjLo6KZtbeJTAa8n v55LnWe8ABvIy/C16YkdQV6M10snwHPwc2v6+7lFSYzPLAOnFJwrDTElEXEftRvSy7nP ISn0LCaUGOIvjlojGMGfgWAysJp0ua9OBWqSgrqfZuznawIGeZnBh4IgGRuaA7tR52gW klbOpU9St376U+/RXr3afMsxCfZdmaZklnEjAb/QMbrc5bNn3LTwOv9uFXpM4pnj1P7l rk0QfIzQPEfIitSsBcY0XpLpj1ZVXZNDpi0DJy2N8JwEMnWZfJANR9LlRLHRBp7fc8Iz eBTQ== X-Gm-Message-State: AOAM531XQETHNTxWuKzK55ofgWTatl1fqxqigCAF9wgiYEDaDf+TxfO4 kTD4mr8Yy8CtNlNkN30ptjYB+tK8sFSVYQ== X-Received: by 2002:a17:90a:f192:: with SMTP id bv18mr4143522pjb.21.1597455119802; Fri, 14 Aug 2020 18:31:59 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.31.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:31:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 09/20] target/arm: Merge helper_sve_clr_* and helper_sve_movz_* Date: Fri, 14 Aug 2020 18:31:34 -0700 Message-Id: <20200815013145.539409-10-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::242; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x242.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" The existing clr functions have only one vector argument, and so can only clear in place. The existing movz functions have two vector arguments, and so can clear while moving. Merge them, with a flag that controls the sense of active vs inactive elements being cleared. Signed-off-by: Richard Henderson --- target/arm/helper-sve.h | 5 --- target/arm/sve_helper.c | 70 ++++++++------------------------------ target/arm/translate-sve.c | 53 +++++++++++------------------ 3 files changed, 34 insertions(+), 94 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/helper-sve.h b/target/arm/helper-sve.h index 63c4a087ca..4411c47120 100644 --- a/target/arm/helper-sve.h +++ b/target/arm/helper-sve.h @@ -269,11 +269,6 @@ DEF_HELPER_FLAGS_3(sve_uminv_h, TCG_CALL_NO_RWG, i64, ptr, ptr, i32) DEF_HELPER_FLAGS_3(sve_uminv_s, TCG_CALL_NO_RWG, i64, ptr, ptr, i32) DEF_HELPER_FLAGS_3(sve_uminv_d, TCG_CALL_NO_RWG, i64, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(sve_clr_b, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(sve_clr_h, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(sve_clr_s, TCG_CALL_NO_RWG, void, ptr, ptr, i32) -DEF_HELPER_FLAGS_3(sve_clr_d, TCG_CALL_NO_RWG, void, ptr, ptr, i32) - DEF_HELPER_FLAGS_4(sve_movz_b, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve_movz_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(sve_movz_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index 382fa82bc8..4758d46f34 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -956,85 +956,43 @@ uint32_t HELPER(sve_pnext)(void *vd, void *vg, uint32_t pred_desc) return flags; } -/* Store zero into every active element of Zd. We will use this for two - * and three-operand predicated instructions for which logic dictates a - * zero result. In particular, logical shift by element size, which is - * otherwise undefined on the host. - * - * For element sizes smaller than uint64_t, we use tables to expand - * the N bits of the controlling predicate to a byte mask, and clear - * those bytes. +/* + * Copy Zn into Zd, and store zero into inactive elements. + * If inv, store zeros into the active elements. */ -void HELPER(sve_clr_b)(void *vd, void *vg, uint32_t desc) -{ - intptr_t i, opr_sz = simd_oprsz(desc) / 8; - uint64_t *d = vd; - uint8_t *pg = vg; - for (i = 0; i < opr_sz; i += 1) { - d[i] &= ~expand_pred_b(pg[H1(i)]); - } -} - -void HELPER(sve_clr_h)(void *vd, void *vg, uint32_t desc) -{ - intptr_t i, opr_sz = simd_oprsz(desc) / 8; - uint64_t *d = vd; - uint8_t *pg = vg; - for (i = 0; i < opr_sz; i += 1) { - d[i] &= ~expand_pred_h(pg[H1(i)]); - } -} - -void HELPER(sve_clr_s)(void *vd, void *vg, uint32_t desc) -{ - intptr_t i, opr_sz = simd_oprsz(desc) / 8; - uint64_t *d = vd; - uint8_t *pg = vg; - for (i = 0; i < opr_sz; i += 1) { - d[i] &= ~expand_pred_s(pg[H1(i)]); - } -} - -void HELPER(sve_clr_d)(void *vd, void *vg, uint32_t desc) -{ - intptr_t i, opr_sz = simd_oprsz(desc) / 8; - uint64_t *d = vd; - uint8_t *pg = vg; - for (i = 0; i < opr_sz; i += 1) { - if (pg[H1(i)] & 1) { - d[i] = 0; - } - } -} - -/* Copy Zn into Zd, and store zero into inactive elements. */ void HELPER(sve_movz_b)(void *vd, void *vn, void *vg, uint32_t desc) { intptr_t i, opr_sz = simd_oprsz(desc) / 8; + uint64_t inv = -(uint64_t)(simd_data(desc) & 1); uint64_t *d = vd, *n = vn; uint8_t *pg = vg; + for (i = 0; i < opr_sz; i += 1) { - d[i] = n[i] & expand_pred_b(pg[H1(i)]); + d[i] = n[i] & (expand_pred_b(pg[H1(i)]) ^ inv); } } void HELPER(sve_movz_h)(void *vd, void *vn, void *vg, uint32_t desc) { intptr_t i, opr_sz = simd_oprsz(desc) / 8; + uint64_t inv = -(uint64_t)(simd_data(desc) & 1); uint64_t *d = vd, *n = vn; uint8_t *pg = vg; + for (i = 0; i < opr_sz; i += 1) { - d[i] = n[i] & expand_pred_h(pg[H1(i)]); + d[i] = n[i] & (expand_pred_h(pg[H1(i)]) ^ inv); } } void HELPER(sve_movz_s)(void *vd, void *vn, void *vg, uint32_t desc) { intptr_t i, opr_sz = simd_oprsz(desc) / 8; + uint64_t inv = -(uint64_t)(simd_data(desc) & 1); uint64_t *d = vd, *n = vn; uint8_t *pg = vg; + for (i = 0; i < opr_sz; i += 1) { - d[i] = n[i] & expand_pred_s(pg[H1(i)]); + d[i] = n[i] & (expand_pred_s(pg[H1(i)]) ^ inv); } } @@ -1043,8 +1001,10 @@ void HELPER(sve_movz_d)(void *vd, void *vn, void *vg, uint32_t desc) intptr_t i, opr_sz = simd_oprsz(desc) / 8; uint64_t *d = vd, *n = vn; uint8_t *pg = vg; + uint8_t inv = simd_data(desc); + for (i = 0; i < opr_sz; i += 1) { - d[i] = n[i] & -(uint64_t)(pg[H1(i)] & 1); + d[i] = n[i] & -(uint64_t)((pg[H1(i)] ^ inv) & 1); } } diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 535d086838..ea6058f7ef 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -590,37 +590,26 @@ static bool trans_SADDV(DisasContext *s, arg_rpr_esz *a) *** SVE Shift by Immediate - Predicated Group */ -/* Store zero into every active element of Zd. We will use this for two - * and three-operand predicated instructions for which logic dictates a - * zero result. +/* + * Copy Zn into Zd, storing zeros into inactive elements. + * If invert, store zeros into the active elements. */ -static bool do_clr_zp(DisasContext *s, int rd, int pg, int esz) -{ - static gen_helper_gvec_2 * const fns[4] = { - gen_helper_sve_clr_b, gen_helper_sve_clr_h, - gen_helper_sve_clr_s, gen_helper_sve_clr_d, - }; - if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_2_ool(vec_full_reg_offset(s, rd), - pred_full_reg_offset(s, pg), - vsz, vsz, 0, fns[esz]); - } - return true; -} - -/* Copy Zn into Zd, storing zeros into inactive elements. */ -static void do_movz_zpz(DisasContext *s, int rd, int rn, int pg, int esz) +static bool do_movz_zpz(DisasContext *s, int rd, int rn, int pg, + int esz, bool invert) { static gen_helper_gvec_3 * const fns[4] = { gen_helper_sve_movz_b, gen_helper_sve_movz_h, gen_helper_sve_movz_s, gen_helper_sve_movz_d, }; - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, rd), - vec_full_reg_offset(s, rn), - pred_full_reg_offset(s, pg), - vsz, vsz, 0, fns[esz]); + + if (sve_access_check(s)) { + unsigned vsz = vec_full_reg_size(s); + tcg_gen_gvec_3_ool(vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + pred_full_reg_offset(s, pg), + vsz, vsz, invert, fns[esz]); + } + return true; } static bool do_zpzi_ool(DisasContext *s, arg_rpri_esz *a, @@ -664,7 +653,7 @@ static bool trans_LSR_zpzi(DisasContext *s, arg_rpri_esz *a) /* Shift by element size is architecturally valid. For logical shifts, it is a zeroing operation. */ if (a->imm >= (8 << a->esz)) { - return do_clr_zp(s, a->rd, a->pg, a->esz); + return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); } else { return do_zpzi_ool(s, a, fns[a->esz]); } @@ -682,7 +671,7 @@ static bool trans_LSL_zpzi(DisasContext *s, arg_rpri_esz *a) /* Shift by element size is architecturally valid. For logical shifts, it is a zeroing operation. */ if (a->imm >= (8 << a->esz)) { - return do_clr_zp(s, a->rd, a->pg, a->esz); + return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); } else { return do_zpzi_ool(s, a, fns[a->esz]); } @@ -700,7 +689,7 @@ static bool trans_ASRD(DisasContext *s, arg_rpri_esz *a) /* Shift by element size is architecturally valid. For arithmetic right shift for division, it is a zeroing operation. */ if (a->imm >= (8 << a->esz)) { - return do_clr_zp(s, a->rd, a->pg, a->esz); + return do_movz_zpz(s, a->rd, a->rd, a->pg, a->esz, true); } else { return do_zpzi_ool(s, a, fns[a->esz]); } @@ -5049,8 +5038,7 @@ static bool trans_LD1R_zpri(DisasContext *s, arg_rpri_load *a) /* Zero the inactive elements. */ gen_set_label(over); - do_movz_zpz(s, a->rd, a->rd, a->pg, esz); - return true; + return do_movz_zpz(s, a->rd, a->rd, a->pg, esz, false); } static void do_st_zpa(DisasContext *s, int zt, int pg, TCGv_i64 addr, @@ -5833,8 +5821,5 @@ static bool trans_MOVPRFX_m(DisasContext *s, arg_rpr_esz *a) static bool trans_MOVPRFX_z(DisasContext *s, arg_rpr_esz *a) { - if (sve_access_check(s)) { - do_movz_zpz(s, a->rd, a->rn, a->pg, a->esz); - } - return true; + return do_movz_zpz(s, a->rd, a->rn, a->pg, a->esz, false); } From patchwork Sat Aug 15 01:31:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247767 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1295412ilo; Sat, 15 Aug 2020 10:05:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy45AA4v/rq7axbWt3o41XYKLYkZ1qMYvw6m+SXUGQBAOQQwtDmWNSeCCJqnkqvtg6NCmUJ X-Received: by 2002:a25:5056:: with SMTP id e83mr11265368ybb.507.1597511152092; Sat, 15 Aug 2020 10:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597511152; cv=none; d=google.com; s=arc-20160816; b=YoDjlMh0bZV09ZY99w5/ZRqNFPLx+dKMuxxkKM7VogiPP8N2lPHeopT2Gs/1VVMo+W 65RZrAVo5tfqwwR7QJMUSIJEPpmgHXgJ/EDDEHYSCTz+Wd3RuMvt67YecCIMNMNnFgVR OV4bqcXWZFKCIdZpCL2xa7JMR4bgA3A0i51xcNYwEeZE7wxfe22JEK6FeWi4Xb+Avouf 9MVgjiGbRseKKfy/2UVyi7E6c0YUGPWkNW+Jr7x7o2om0REYb7I/ey7xBHGmC8M5j1hU qI6NKZGdOU35soQLShsb2LsvH7vjcecjIFYqopa8FU+csLZf3o6TKNJpjLlZhVQgprCB rqWg== 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=13iDMrHB1KJoXoePiZR2R7O74YXAoVM8bGBrZHlUo/Q=; b=rGKB8oP6rIUO31db6X3ZY+joPZpj4hrNbnVuuW6aZRLx05tHH6yvb4sVcSHPvYIeOh U11YRrRURcpUmK3zW4up/pOxxRUT5oygGGS/GiU2XsfySjxREEnsyttzWDJ2CeWx5VmZ gHjqIeHSJ2iwWJVT5RTQm/2SgaRyOMxst39N4HDtA6ZHRG3xEu4DPdxYM7EY4ql7DTXR LeogE6NSmgFskT4QMFImac/TNpcIVFxdmyCeT8begL1x44ySaEjd3ZkP3An01zEjRIit bfsNYFfl6V2Cw1SZaMidYCCLNkMMQz6AZukxwJrEA1ue93n8G86Wm8xn5FL0II9m1KUq 1OHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZXaSMdBA; 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 f76si13617775ybg.34.2020.08.15.10.05.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 10:05:52 -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=ZXaSMdBA; 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]:33352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6zct-0001uZ-LC for patch@linaro.org; Sat, 15 Aug 2020 13:05:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6zck-0001uK-OF for qemu-devel@nongnu.org; Sat, 15 Aug 2020 13:05:42 -0400 Received: from mail-vs1-xe42.google.com ([2607:f8b0:4864:20::e42]:41300) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6zci-0001Fn-RZ for qemu-devel@nongnu.org; Sat, 15 Aug 2020 13:05:42 -0400 Received: by mail-vs1-xe42.google.com with SMTP id y8so6214799vsq.8 for ; Sat, 15 Aug 2020 10:05:40 -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=13iDMrHB1KJoXoePiZR2R7O74YXAoVM8bGBrZHlUo/Q=; b=ZXaSMdBA1dKdayya5wF/mC1h5ohEFE3DXamlItJIzh+iz1gwu1zhmY971tu5h1CEIV K+oB5ZrXfK82etO8HzqMYnhzZUEbEQ/scApzwXX8F6knQ++jQxkoPUBOihfuJrCWItQ6 Smzlpy3xqMivwQtyJKv6beiwhpAH4ACg5r/v6hSzWekjl+tHKG6vd6cPy5gdJ6vNgfFO ULaMBMNZyd2cKsewyfS5O/ig759hktDgOusQTIxezlOpGw7PHEPAB+86pmziRNmZnuj7 Wdh9PkM/hx3hxZteCNwy4j6Df1qwRnP/DHWMlg/4kkwQdJjS9mTUvPdeF7hMO7d61Xu0 je1A== 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=13iDMrHB1KJoXoePiZR2R7O74YXAoVM8bGBrZHlUo/Q=; b=Nl4PTEIcVP+dFfD44fLqNH7jMDZ3eBVnxtcWgzmFP97e5vVvr2itmd7MHgQ5f+ZQmJ sLuO/ci0RS63R6SXj/rapWfj7MGEVwgfMvQOfF2kyuDNXR68SFAe1Y/N7+h1M5S4TZjz ix6Zp91U4f485Mphq8CKbB5KD8dng99C8bCBC3DvC9XqJvAK2TypWIL2nqn2SiScZSNV xe0FnbITrg+3KZWYCmn3qV1sxO7t6nTSbGdhDg4+1wTtaCkp8g6QfvJIFaX2/cWvrl2X VT3dQ8HeTVZ+L7Uxp41YF/cRS710AMznyXhScIc5xlvfisOmhMc12pnv2Fj/le4+ZXmZ 4Rgg== X-Gm-Message-State: AOAM530+CFBqo2tKHHUulRSZ6HOGf6Q13aPHrH2/mZKRW1SDmL+ROOzv WD8R17oz6l/nrGruVEXwmQ4ltc6w2TlFNg== X-Received: by 2002:a62:17c1:: with SMTP id 184mr3619805pfx.136.1597455121146; Fri, 14 Aug 2020 18:32:01 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.31.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:32:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 10/20] target/arm: Split out gen_gvec_ool_zzp Date: Fri, 14 Aug 2020 18:31:35 -0700 Message-Id: <20200815013145.539409-11-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" Model after gen_gvec_fn_zzz et al. Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index ea6058f7ef..3361e1c01f 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -142,6 +142,17 @@ static int pred_gvec_reg_size(DisasContext *s) return size_for_gvec(pred_full_reg_size(s)); } +/* Invoke an out-of-line helper on 2 Zregs and a predicate. */ +static void gen_gvec_ool_zzp(DisasContext *s, gen_helper_gvec_3 *fn, + int rd, int rn, int pg, int data) +{ + unsigned vsz = vec_full_reg_size(s); + tcg_gen_gvec_3_ool(vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + pred_full_reg_offset(s, pg), + vsz, vsz, data, fn); +} + /* Invoke an out-of-line helper on 3 Zregs and a predicate. */ static void gen_gvec_ool_zzzp(DisasContext *s, gen_helper_gvec_4 *fn, int rd, int rn, int rm, int pg, int data) @@ -415,11 +426,7 @@ static bool do_zpz_ool(DisasContext *s, arg_rpr_esz *a, gen_helper_gvec_3 *fn) return false; } if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), - pred_full_reg_offset(s, a->pg), - vsz, vsz, 0, fn); + gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, 0); } return true; } @@ -603,11 +610,7 @@ static bool do_movz_zpz(DisasContext *s, int rd, int rn, int pg, }; if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, rd), - vec_full_reg_offset(s, rn), - pred_full_reg_offset(s, pg), - vsz, vsz, invert, fns[esz]); + gen_gvec_ool_zzp(s, fns[esz], rd, rn, pg, invert); } return true; } @@ -616,11 +619,7 @@ static bool do_zpzi_ool(DisasContext *s, arg_rpri_esz *a, gen_helper_gvec_3 *fn) { if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), - pred_full_reg_offset(s, a->pg), - vsz, vsz, a->imm, fn); + gen_gvec_ool_zzp(s, fn, a->rd, a->rn, a->pg, a->imm); } return true; } From patchwork Sat Aug 15 01:31:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247761 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1270005ilo; Sat, 15 Aug 2020 09:18:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfszhkV+d7uLCPhyeXDdqLLebApkqrl+q+nxD/KAB8zvLvGqv0pU6wYdkcg2Sfz45gK+4A X-Received: by 2002:a25:cec1:: with SMTP id x184mr10107360ybe.222.1597508288944; Sat, 15 Aug 2020 09:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597508288; cv=none; d=google.com; s=arc-20160816; b=VTKxgaivB7NEzrG5BbIFtFnxN7aF8bElpHCL0IWCEIk3kiXfThV5XUpOswlx7yN1Fr vFFi6kt9SPRPRt/zRfWoB2rU+vj3RITbI+zFCVMPMal99NnPapIgMeuWND3M6r44Ly2v poOPyDr3n+kyFgW3NOhogsQbtQUhuILd2JuP9E91qV76/3v4sEPguNtKa/24RHQSath0 AHJzUZaF4D4aSBd15bdX88qrxFuw0DEn+juDlssXnKExcCpceKFfybCHIGExvzoxWbwx sPIG9JFwZiPrp2/6hPsZJPr2TEeexM9kA2+8TB4gRRyY2jUeIdeJ0RT1NlTDqOH6ArJ/ 1bww== 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=cA0vYLAZE6i6Tzs841BUfloSXj9bRzCj5fg2IHyhivw=; b=QQRljGbYc8OCt9klLvNp55jRoBaiuW1xfb7WLi9zsJhr9+6bpJJW9l5jKffdHRE0/f FOfgsYPV0rdlgETlUyaDCGtHr9ao1xisMtrA9q7U7TYNWuuEpkGHB3bBdg2zed6OMUzv LEsJ4Ux5aQsBqPbF4xTkO09+5z49NCqlP143h9GWmUUjDaiTx2tQ3lUuVQfSj3h/8Tux JDSqSaNlTqaNzL8VPHenydhNCVN/DMM03MJg5FSA2rzgMmAdSYDz+KKodhQxHiGhCBfc oGrsgwfQdkbV1I09bklSeIvYNdv9UDrKu2MHO8okXIpQxC3b307+Khwbn8i7QkB1NA3/ T36A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rP4gPilP; 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 e1si11432326yba.83.2020.08.15.09.18.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 09:18:08 -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=rP4gPilP; 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]:50626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6ysi-00049E-AL for patch@linaro.org; Sat, 15 Aug 2020 12:18:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6yrX-0002kz-0m for qemu-devel@nongnu.org; Sat, 15 Aug 2020 12:16:55 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:40224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6yrV-0003Xd-5q for qemu-devel@nongnu.org; Sat, 15 Aug 2020 12:16:54 -0400 Received: by mail-pl1-x643.google.com with SMTP id u10so5480164plr.7 for ; Sat, 15 Aug 2020 09:16:52 -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=cA0vYLAZE6i6Tzs841BUfloSXj9bRzCj5fg2IHyhivw=; b=rP4gPilPMT/vIfoGrXcjvkyRln4/9P+j8elpCDXBKje9s8TcAciV84bd59WGf1r2Ku lPPeCnLlIQtMVQDZIY9VQdxz7qAxkrYz6vH5Wae4b/YasxymB+PKNjRT0V3KQrgRp4vu LP8fQm9+dUe5RKn3CyCc0Y4StYOy3aPGqfVjiXPJQCBtUdiluAYPSEe79ObpfyM8dDud MgNf3pofyaKMyCapft8nnKdKIxwxSQs/skJRbGuO5+Ww8cTGDqHlTTlxHt5O5Sf+n6V2 y7RJc35pWJYbrRF8OfPhLM4lvQDcjkNrMyvyuVAFK7acROoJEASDbwOv7DPm7zIdY7UW vi1Q== 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=cA0vYLAZE6i6Tzs841BUfloSXj9bRzCj5fg2IHyhivw=; b=pFn5zo+gMtlFZFLIrT8Lk4Hk0w890KfMs6NN9Ft+7CLV6/bYfoshq7XEs8dyutLg1U tExkR9vGZjpC5knSUGgUU3DhJMno3bxX8yu7kl1anWxpdQ7qd4HzgVMdCIx9qsHB4hF/ TvYAxs0CFRhvTkNM+LuDj76MlKHT0o7eyflFSRVBOohsVJA+5FfBxaykmg23DWEGBh7T +3IP7z629a/RfQ9Sj0xwUK6Z50odLYxvvXczHNOdoabfyyrNpsQdUd6iI0oWkgEbANUP IQp5iwuu7WGXwXsJewiVwMOhGilv1Lbk9f951PP971O2CsfeAGgbmjRF03COfZ3Pf2G+ DZIA== X-Gm-Message-State: AOAM532gaSnsgttB9u2yK4lPpKrXRuGq9rMsBcUvZ/O+lkDbKx5dbsZC LeuSqpbQ847VdTy5qqNKHyiSnsV7g9nTWw== X-Received: by 2002:a62:7f06:: with SMTP id a6mr3752428pfd.300.1597455122610; Fri, 14 Aug 2020 18:32:02 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.32.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:32:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 11/20] target/arm: Split out gen_gvec_ool_zzz Date: Fri, 14 Aug 2020 18:31:36 -0700 Message-Id: <20200815013145.539409-12-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::643; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x643.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/translate-sve.c | 53 +++++++++++++------------------------- 1 file changed, 18 insertions(+), 35 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 3361e1c01f..3a90a645fd 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -142,6 +142,17 @@ static int pred_gvec_reg_size(DisasContext *s) return size_for_gvec(pred_full_reg_size(s)); } +/* Invoke an out-of-line helper on 3 Zregs. */ +static void gen_gvec_ool_zzz(DisasContext *s, gen_helper_gvec_3 *fn, + int rd, int rn, int rm, int data) +{ + unsigned vsz = vec_full_reg_size(s); + tcg_gen_gvec_3_ool(vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + vec_full_reg_offset(s, rm), + vsz, vsz, data, fn); +} + /* Invoke an out-of-line helper on 2 Zregs and a predicate. */ static void gen_gvec_ool_zzp(DisasContext *s, gen_helper_gvec_3 *fn, int rd, int rn, int pg, int data) @@ -769,11 +780,7 @@ static bool do_zzw_ool(DisasContext *s, arg_rrr_esz *a, gen_helper_gvec_3 *fn) return false; } if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), - vec_full_reg_offset(s, a->rm), - vsz, vsz, 0, fn); + gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, 0); } return true; } @@ -947,11 +954,7 @@ static bool trans_RDVL(DisasContext *s, arg_RDVL *a) static bool do_adr(DisasContext *s, arg_rrri *a, gen_helper_gvec_3 *fn) { if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), - vec_full_reg_offset(s, a->rm), - vsz, vsz, a->imm, fn); + gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, a->imm); } return true; } @@ -1012,11 +1015,7 @@ static bool trans_FTSSEL(DisasContext *s, arg_rrr_esz *a) return false; } if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), - vec_full_reg_offset(s, a->rm), - vsz, vsz, 0, fns[a->esz]); + gen_gvec_ool_zzz(s, fns[a->esz], a->rd, a->rn, a->rm, 0); } return true; } @@ -2067,11 +2066,7 @@ static bool trans_TBL(DisasContext *s, arg_rrr_esz *a) }; if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), - vec_full_reg_offset(s, a->rm), - vsz, vsz, 0, fns[a->esz]); + gen_gvec_ool_zzz(s, fns[a->esz], a->rd, a->rn, a->rm, 0); } return true; } @@ -2244,11 +2239,7 @@ static bool do_zzz_data_ool(DisasContext *s, arg_rrr_esz *a, int data, gen_helper_gvec_3 *fn) { if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), - vec_full_reg_offset(s, a->rm), - vsz, vsz, data, fn); + gen_gvec_ool_zzz(s, fn, a->rd, a->rn, a->rm, data); } return true; } @@ -3373,11 +3364,7 @@ static bool trans_DOT_zzz(DisasContext *s, arg_DOT_zzz *a) }; if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), - vec_full_reg_offset(s, a->rm), - vsz, vsz, 0, fns[a->u][a->sz]); + gen_gvec_ool_zzz(s, fns[a->u][a->sz], a->rd, a->rn, a->rm, 0); } return true; } @@ -3390,11 +3377,7 @@ static bool trans_DOT_zzx(DisasContext *s, arg_DOT_zzx *a) }; if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_3_ool(vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), - vec_full_reg_offset(s, a->rm), - vsz, vsz, a->index, fns[a->u][a->sz]); + gen_gvec_ool_zzz(s, fns[a->u][a->sz], a->rd, a->rn, a->rm, a->index); } return true; } From patchwork Sat Aug 15 01:31:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247748 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1220830ilo; Sat, 15 Aug 2020 07:59:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJze8PpmMjsrfGQ2YbNfBcGeMH3HLa4SPFcLFF7c603ybV/7Sb4YHI18FPCESdunx1CeWcMV X-Received: by 2002:a25:40cb:: with SMTP id n194mr10207118yba.380.1597503542097; Sat, 15 Aug 2020 07:59:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597503542; cv=none; d=google.com; s=arc-20160816; b=vXHJx/Kpbj5R1jLcC61Q0JNC1CbFEJgFjIwcE6XpdZe9ky4yE7Tos+R+xU5Z/ztjjP UVEJjKkn/nzQO3IRU/RJCwV3ZNuMpI+b78M4rvdKFJ4OrBPZizRqRAR5b25iGV4+MzAj hy4FzakJZk7MeD/zdKvI0Q/imdmj2r9xnCF5C0FCuFZZFPQFQWMnsL+B+3pEmuV7tpsZ h9ZkqVc1dlDRk4ptVTy0uHRFiQ/s708NdCffeJ2kJA/fIbzgzoL8nvWDuFyX2s1WMDyO Vcbo61pF8dXYMYOtIi4WYdBjDBXjKFTzG/Caelu6xKmBO3RFkP4vMegCfY2fVyh78jKD Y/NQ== 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=9NRH6u0bui4FSFIzrZ7Rwk8xUdSDUIfSDtkVwDeXJ9Q=; b=M+cTQJOswsqJJ63TNpoECRPueeIv3DCqZ/xbVdlOvUE5UjrwDg1sQDaDCV+TWeOECs UZu+XfmZvuoPEDakEPxoHwVKhdXdeXdRcxkXO/MQdIqXZvXaCwoiegUsJVZoUSFJpAKZ 1MknGnMfIJ3P2gTZ8c/o7t1A5L5XYIxZziIbFedkR7xdLXK2hxNZOlIr4iXsf56mpS84 wLIHAQekaWbS85UpYD2ip15YfC2TdFFAKvxGLRF79u4wK61c9kEvu1JbdOPYZkFUv4t+ GsqECnLPYc+qDwKZkpkIUzu9obX+g04zwmtf8/lwKyJ2qmMgHbaybE3VhPjepfvw5Hc2 Fe1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZPt+fJPT; 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 q142si11514394ybg.188.2020.08.15.07.59.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 07:59:02 -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=ZPt+fJPT; 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]:50328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6xe9-000160-Jm for patch@linaro.org; Sat, 15 Aug 2020 10:59:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6xcD-0007Ne-Mc for qemu-devel@nongnu.org; Sat, 15 Aug 2020 10:57:01 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:44931) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6xcB-00053z-VX for qemu-devel@nongnu.org; Sat, 15 Aug 2020 10:57:01 -0400 Received: by mail-pl1-x641.google.com with SMTP id y10so3865476plr.11 for ; Sat, 15 Aug 2020 07:56:59 -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=9NRH6u0bui4FSFIzrZ7Rwk8xUdSDUIfSDtkVwDeXJ9Q=; b=ZPt+fJPTvTouF096Ftttct1ge3AFLeLp7SUJP5rXJ14/8qg5ok6E1zKQT+MWWMR2Fh 7jAWUa6xD6kgzj+vFRs544VOMzUpsu76jdA/Yjtju5vrZwNpGV0xqj/A94DzhgzFSX/N zyje21Vc8p1O6UavOtCF52wOYNPP8IWsIrP81wlTvAc/Qq4caePlnYTH1DI8IT/1TWDf CxFny6kl60iNkUffU7GUIUuw6XskYyVY6TbpNpMGBoZQwomIuGYmjQbnzFTKUDUG24xn I9+X+lOB1+uUTX5nCQKgTEV0ch79vvuwE7JK4jSbVCtWXaaGW6+OE31u5aCYKSA7+l/3 jjZg== 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=9NRH6u0bui4FSFIzrZ7Rwk8xUdSDUIfSDtkVwDeXJ9Q=; b=g0sxeoCyZx5dIIJWcfiQBE1sOlAYFTvb3lLdpfxgdN3Uz9LF7XJcr8JDiLfnHP/Z7O ExFiVpbJbKxm2BuV/aq1tsbpVhN6mdfh5ILEFIo9ZvrxaUQ0B/dCITbNLO/QAoGBb0Rk 9B37an9As2C9mWTY+2G+HfP3QP71YHKWjY1kshnsxs79G21a0w8QBbxAqu6z3NeY3Mju MflA/UTUtur6/FAUeQJUM22gVXmKqLRjAQph+Efxkd7flFx9HoIZtqrzX8QBmEbhML1t tbPry8xdVe6iikJE+GZzHYPak0IJUUj7iFol37ha5OYExUyhV88A6uB6Pb2DfxkM69Qo 3ZYQ== X-Gm-Message-State: AOAM533ZMGpzEIBDds5qX/jWGv4wEUOu+TPtJDu94gjm/B79OUABZMd/ LeIGe2wesPqDmRCHeMRX/CezobTCHsb/OQ== X-Received: by 2002:a17:902:40a:: with SMTP id 10mr3861114ple.180.1597455123858; Fri, 14 Aug 2020 18:32:03 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:32:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 12/20] target/arm: Split out gen_gvec_ool_zz Date: Fri, 14 Aug 2020 18:31:37 -0700 Message-Id: <20200815013145.539409-13-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::641; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x641.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/translate-sve.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 3a90a645fd..a2948b5128 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -142,6 +142,16 @@ static int pred_gvec_reg_size(DisasContext *s) return size_for_gvec(pred_full_reg_size(s)); } +/* Invoke an out-of-line helper on 2 Zregs. */ +static void gen_gvec_ool_zz(DisasContext *s, gen_helper_gvec_2 *fn, + int rd, int rn, int data) +{ + unsigned vsz = vec_full_reg_size(s); + tcg_gen_gvec_2_ool(vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + vsz, vsz, data, fn); +} + /* Invoke an out-of-line helper on 3 Zregs. */ static void gen_gvec_ool_zzz(DisasContext *s, gen_helper_gvec_3 *fn, int rd, int rn, int rm, int data) @@ -995,10 +1005,7 @@ static bool trans_FEXPA(DisasContext *s, arg_rr_esz *a) return false; } if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_2_ool(vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), - vsz, vsz, 0, fns[a->esz]); + gen_gvec_ool_zz(s, fns[a->esz], a->rd, a->rn, 0); } return true; } @@ -2050,10 +2057,7 @@ static bool trans_REV_v(DisasContext *s, arg_rr_esz *a) }; if (sve_access_check(s)) { - unsigned vsz = vec_full_reg_size(s); - tcg_gen_gvec_2_ool(vec_full_reg_offset(s, a->rd), - vec_full_reg_offset(s, a->rn), - vsz, vsz, 0, fns[a->esz]); + gen_gvec_ool_zz(s, fns[a->esz], a->rd, a->rn, 0); } return true; } From patchwork Sat Aug 15 01:31:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247755 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1242344ilo; Sat, 15 Aug 2020 08:32:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOw9Ecza3q6+Ol514wpFqwRejdzY0JHbdioO+XskU0kkylBwICME+V7KBZDoHpcxoLhkFD X-Received: by 2002:a25:cf95:: with SMTP id f143mr9137458ybg.126.1597505530523; Sat, 15 Aug 2020 08:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597505530; cv=none; d=google.com; s=arc-20160816; b=tbaQ+Ml4kL59zquRV14kDt6im/lp5wAOkw7VDTXjDh2IN0NgJlNXXQWxwBNFRpNhTh IDLNRZwm/6iIaVnl64+bz6W+hxpfa0rdM5CzYOvs/encjGuh5QFU7ulMKauBrje9U2TG Ti+oDFuckUvazSf2mtpTTjd04MSV9Fs25y5IjWSuN8QvJaHmSlhaj5h/cvXKfSpt5mef 37zsHi7NzKZ0HxmVj7GBdojxTawb700p1Cm7/co6dUSWQNN0qBxNRn6M3QpvfE3rtjX/ +1fciapkzptQJ/4wXI5i0z3ZTPOAYgVv+rCNjCzqAPaGGTPqAV2Vb7Q32k3vUK6Uasm0 m/nQ== 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=Xaxzc+r6r88xLIgQLZ64izxJ1KoUU6V1OBDgcD8ihqc=; b=Bo2UZQAtqMupGIxfmFkSIDX9gaId0bLsmieXwYdMBN7yQOWErQCwMvkYhNuIqRLJru 7NilRj7JzypeCQWo+d0OQQAnz9DudYs5wnJCYAfaQrfVTmxx/3Vsoj3gC74cfDbiK+Jv oBB7PA2wyWSUCZPHalNC3apfvzdXi5XlGKJMQ4jwJtchxZgpwDjuZ3Cv9Z5Cu+L1zUDr Mber1wIGjVSnvhuK21bchhRODMaG+RrwEiNHTCcCJiOMWAyNG1tf+Cw+FXJ157JCDRk8 IAzq0bqYE8QeMG2kFr4HabMKEEuzjDU3Z9WVn2vWJz/HYK1mq7Qeertua8zD41GW2EnZ TfWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XEsdAbto; 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 x3si14904443ybt.216.2020.08.15.08.32.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 08:32:10 -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=XEsdAbto; 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]:52776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6yAD-0007IW-VC for patch@linaro.org; Sat, 15 Aug 2020 11:32:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6y9U-0006no-BO for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:31:24 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:46872) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6y9S-0004ZJ-MG for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:31:24 -0400 Received: by mail-pf1-x443.google.com with SMTP id 74so5961550pfx.13 for ; Sat, 15 Aug 2020 08:31:22 -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=Xaxzc+r6r88xLIgQLZ64izxJ1KoUU6V1OBDgcD8ihqc=; b=XEsdAbto4EBxr+22K8//q6bDOn7/suDGUrZHLQavsIhHq4G3hWDuk7d7i6aVTdj//B D/RKGQPoWruq5suvFHVDCQAmvF54ajyNaGMieNJBnTjvDJsz2DOztGLzm8d+7NviYD12 ZPcjumymMdhxrUmwdFo44S1ainKU4836d9g2UVFSgdtwEGZFLzFlOJTkPtw/NbMvqSmq YbecZdLm/QJe7ESrbaaO+Ox0U/5hEkxMY4ZIEJ7D1KmyPJYTYYB4suHPuozPlA/p0Gun otgDNTYpmvWRJv5cw5COmFqdLCboyNibCTlNIGDfmJXAS1Buj7eEeZTsFpbKv2jyiuFg SB8A== 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=Xaxzc+r6r88xLIgQLZ64izxJ1KoUU6V1OBDgcD8ihqc=; b=QmNPogqGqARlP8m54AIVQbhXorGFgAejtUjupNtxDwkVq0tdkvQiAbxOSph717uCEZ nKU10xEFY6PJq9bhaPWCR9BGBdYr8SBGAiLfdBoRgUQuM21k40e2kw6CUqRDBkqI9k2v G7CRzt2cx5GrjkP+kG7/R0JCwJTs2Y1q5MPRQQ74H4C60bGw5PKR/Sx4LxDcTE/VUAJ2 eF8uALZOn/vU2uf3xhSpK3zYoEpg2i7vh4bSJmIqbxc3g+3Qvgewdy9fIAVjf5fs2Db1 OVmRv82pcRcY+vkyRa7trfUqLcdEY6eBQ0Y077tl7pqyaAmHUOeidchK/rCYQ9B7IwPZ iFlw== X-Gm-Message-State: AOAM5324+/3mSKYM6/DzqQ24QtnQV5JfLg/XlzcecHuORRVYCwn8PG9Y l2/M/jHRW/DMZDZDRsNyb3nbB5qDNtAaXA== X-Received: by 2002:a63:4e56:: with SMTP id o22mr3256361pgl.381.1597455125698; Fri, 14 Aug 2020 18:32:05 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.32.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:32:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 13/20] target/arm: Tidy SVE tszimm shift formats Date: Fri, 14 Aug 2020 18:31:38 -0700 Message-Id: <20200815013145.539409-14-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::443; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x443.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" Rather than require the user to fill in the immediate (shl or shr), create full formats that include the immediate. Signed-off-by: Richard Henderson --- target/arm/sve.decode | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/sve.decode b/target/arm/sve.decode index 4f580a25e7..6425396ac1 100644 --- a/target/arm/sve.decode +++ b/target/arm/sve.decode @@ -150,13 +150,17 @@ @rd_rn_i6 ........ ... rn:5 ..... imm:s6 rd:5 &rri # Two register operand, one immediate operand, with predicate, -# element size encoded as TSZHL. User must fill in imm. -@rdn_pg_tszimm ........ .. ... ... ... pg:3 ..... rd:5 \ - &rpri_esz rn=%reg_movprfx esz=%tszimm_esz +# element size encoded as TSZHL. +@rdn_pg_tszimm_shl ........ .. ... ... ... pg:3 ..... rd:5 \ + &rpri_esz rn=%reg_movprfx esz=%tszimm_esz imm=%tszimm_shl +@rdn_pg_tszimm_shr ........ .. ... ... ... pg:3 ..... rd:5 \ + &rpri_esz rn=%reg_movprfx esz=%tszimm_esz imm=%tszimm_shr # Similarly without predicate. -@rd_rn_tszimm ........ .. ... ... ...... rn:5 rd:5 \ - &rri_esz esz=%tszimm16_esz +@rd_rn_tszimm_shl ........ .. ... ... ...... rn:5 rd:5 \ + &rri_esz esz=%tszimm16_esz imm=%tszimm16_shl +@rd_rn_tszimm_shr ........ .. ... ... ...... rn:5 rd:5 \ + &rri_esz esz=%tszimm16_esz imm=%tszimm16_shr # Two register operand, one immediate operand, with 4-bit predicate. # User must fill in imm. @@ -289,14 +293,10 @@ UMINV 00000100 .. 001 011 001 ... ..... ..... @rd_pg_rn ### SVE Shift by Immediate - Predicated Group # SVE bitwise shift by immediate (predicated) -ASR_zpzi 00000100 .. 000 000 100 ... .. ... ..... \ - @rdn_pg_tszimm imm=%tszimm_shr -LSR_zpzi 00000100 .. 000 001 100 ... .. ... ..... \ - @rdn_pg_tszimm imm=%tszimm_shr -LSL_zpzi 00000100 .. 000 011 100 ... .. ... ..... \ - @rdn_pg_tszimm imm=%tszimm_shl -ASRD 00000100 .. 000 100 100 ... .. ... ..... \ - @rdn_pg_tszimm imm=%tszimm_shr +ASR_zpzi 00000100 .. 000 000 100 ... .. ... ..... @rdn_pg_tszimm_shr +LSR_zpzi 00000100 .. 000 001 100 ... .. ... ..... @rdn_pg_tszimm_shr +LSL_zpzi 00000100 .. 000 011 100 ... .. ... ..... @rdn_pg_tszimm_shl +ASRD 00000100 .. 000 100 100 ... .. ... ..... @rdn_pg_tszimm_shr # SVE bitwise shift by vector (predicated) ASR_zpzz 00000100 .. 010 000 100 ... ..... ..... @rdn_pg_rm @@ -400,12 +400,9 @@ RDVL 00000100 101 11111 01010 imm:s6 rd:5 ### SVE Bitwise Shift - Unpredicated Group # SVE bitwise shift by immediate (unpredicated) -ASR_zzi 00000100 .. 1 ..... 1001 00 ..... ..... \ - @rd_rn_tszimm imm=%tszimm16_shr -LSR_zzi 00000100 .. 1 ..... 1001 01 ..... ..... \ - @rd_rn_tszimm imm=%tszimm16_shr -LSL_zzi 00000100 .. 1 ..... 1001 11 ..... ..... \ - @rd_rn_tszimm imm=%tszimm16_shl +ASR_zzi 00000100 .. 1 ..... 1001 00 ..... ..... @rd_rn_tszimm_shr +LSR_zzi 00000100 .. 1 ..... 1001 01 ..... ..... @rd_rn_tszimm_shr +LSL_zzi 00000100 .. 1 ..... 1001 11 ..... ..... @rd_rn_tszimm_shl # SVE bitwise shift by wide elements (unpredicated) # Note esz != 3 From patchwork Sat Aug 15 01:31:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247770 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1314147ilo; Sat, 15 Aug 2020 10:40:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhsAOG1LUtVzLnVyBlwA2VbxEIg0uZ75pXkScBae4snEOHaSioPtvW52dl33GtL6MxgVeA X-Received: by 2002:a25:a08f:: with SMTP id y15mr10151888ybh.24.1597513236249; Sat, 15 Aug 2020 10:40:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597513236; cv=none; d=google.com; s=arc-20160816; b=qoKzXOjFi8RVv2rLbKQEHQoo9czNWhrifZ32sCDPyAV/+6DLWob7LDTgTQgq0ZcC96 KyB5IiY970d4kL+5Q7z4+LrUWeOqAXbuGI5Qr1efp5HiA8suX94Yg+sBQaKUamp1ruED 9nN7Ejx4g8FgWybuu9tqDd8BZqxwNYhpSuoGUg17r6Ji3usSH1nPBCUXJguJLv/6/qTI 2lNl44cbZaFA5PTPxGHLklqxuUE9HMl87eOM65da7fmlx1QKjP/RoxmYf/1+Eysoy3nR RdnVI2kBit/4nWYareQSeaccsSmHFkn4sRID15uJb8qjRC8886uKtg924KRZgtytnkWH WTAQ== 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=Dt3CKviEUaIARP3VoTRcas5wkm8EDq7dhBzT1P07KmY=; b=Iit55jM9QxYDwzVRWU8R7ixwivOuMDNnDlFPwlI4WgyChXzEozBBSaoYKxRytY5ydl xQvNFqhSB2uqV6UaEsujsXVOjgZiezFd6V0k6EeQC9+rmIhY3Nee2zhZoXyQApPuxoDG ZXU5ZojqXPnHqC4oh08c2iHEgzH1JnnTQwWK2MHu24wxODo+8nZ3Qz6kRCDoL/XH9N5Y pPBB46RM6gGEtCB0BvSFi1+cPgwxBPBW5KfKhsOZ3GSwCrjIYn0Z7a9CAeYqNE6xnc8P 69os/w1Jq9kpiyCIaOgUFxm/8q0fouTvpVRUvUUs/2eqSCXnmpC6qOvP3S+kCA+KD83x vAaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="N2LWH/Or"; 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 81si7939455ybn.182.2020.08.15.10.40.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 10:40:36 -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="N2LWH/Or"; 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]:34196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k70AV-0007gU-Od for patch@linaro.org; Sat, 15 Aug 2020 13:40:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k70AM-0007gJ-St for qemu-devel@nongnu.org; Sat, 15 Aug 2020 13:40:26 -0400 Received: from mail-qv1-xf34.google.com ([2607:f8b0:4864:20::f34]:34745) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k70AL-0004r6-40 for qemu-devel@nongnu.org; Sat, 15 Aug 2020 13:40:26 -0400 Received: by mail-qv1-xf34.google.com with SMTP id t6so5849298qvw.1 for ; Sat, 15 Aug 2020 10:40:24 -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=Dt3CKviEUaIARP3VoTRcas5wkm8EDq7dhBzT1P07KmY=; b=N2LWH/OrQhwtQi1q9rkIfT8KvyE3KjDBucs5l/nbT4+PFvvgbbLDqtNJOsJIZcVGCB lwlFBZcTP9XATBbneSUqQxJxTB802wyRzLD1+UtQJ67KmGTnECXBcSpMypVsjYhHQbvz yeu/jcg13ekCu6EE4D88I1pQeEtAWkR8eR4eIsvn1J1TpZscgju5SKOtlNo8CdyISrXT P1YTbanhKrVNiQN+D+o0/jtJpyl9h2m9GNssr3UeGC0aStG501WSrGC4H4rUsEF9P5n6 eqwJvlbjtYVmMZFE+McVouXgIXqsBidoTXjICjIzr2+UZN4ZCf8tR+KdK6+m4OhuYJb5 Ea+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=Dt3CKviEUaIARP3VoTRcas5wkm8EDq7dhBzT1P07KmY=; b=rXU+kWYHYbXm7pcTtQClYEllUcR9uxoUdwZUDBfpB1BEJ54RNgYBuLScLZKyY8+4Sa /exejGJzGZik2Rs4fomcMmPmbkfp/fXJ4zKYF+/XHmuZtqx9CIMWs1aP1FudyFrrxLrL 36yEKAxGCPRM+SL9QUwkH4k/llJ6f0MiIgiPmCI7kxPuT3HgOJUgmIWds+zDEnonSBGU ci5qzmxLxsEzO2RaP1TDwX2/vyFUUiBFphAmzi5iisWGVyGw6OYp1OlCE5Vo2vVCLxsL aml9Ji7JhnwzM/QIJ7DMmPOaPhlXvQ1KHkwaN3ItemLirXlTPKwJr5uIlw/etEiUB5tI 3lnA== X-Gm-Message-State: AOAM533VYTjlK4boySeDwyjcmPGLIFyxN4rskiCSrutFUg5lNtrE5SAM suVr/E2nM1mhyorhbjpiE9nnXW3q/4sceQ== X-Received: by 2002:a62:7f15:: with SMTP id a21mr3690539pfd.191.1597455126728; Fri, 14 Aug 2020 18:32:06 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:32:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 14/20] target/arm: Generalize inl_qrdmlah_* helper functions Date: Fri, 14 Aug 2020 18:31:39 -0700 Message-Id: <20200815013145.539409-15-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::f34; envelope-from=richard.henderson@linaro.org; helo=mail-qv1-xf34.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" Unify add/sub helpers and add a parameter for rounding. This will allow saturating non-rounding to reuse this code. Signed-off-by: Richard Henderson --- target/arm/vec_helper.c | 80 +++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 51 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c index 7d76412ee0..bbd1141dfc 100644 --- a/target/arm/vec_helper.c +++ b/target/arm/vec_helper.c @@ -37,19 +37,24 @@ #endif /* Signed saturating rounding doubling multiply-accumulate high half, 16-bit */ -static int16_t inl_qrdmlah_s16(int16_t src1, int16_t src2, - int16_t src3, uint32_t *sat) +static int16_t do_sqrdmlah_h(int16_t src1, int16_t src2, int16_t src3, + bool neg, bool round, uint32_t *sat) { - /* Simplify: + /* + * Simplify: * = ((a3 << 16) + ((e1 * e2) << 1) + (1 << 15)) >> 16 * = ((a3 << 15) + (e1 * e2) + (1 << 14)) >> 15 */ int32_t ret = (int32_t)src1 * src2; - ret = ((int32_t)src3 << 15) + ret + (1 << 14); + if (neg) { + ret = -ret; + } + ret += ((int32_t)src3 << 15) + (round << 14); ret >>= 15; + if (ret != (int16_t)ret) { *sat = 1; - ret = (ret < 0 ? -0x8000 : 0x7fff); + ret = (ret < 0 ? INT16_MIN : INT16_MAX); } return ret; } @@ -58,8 +63,9 @@ uint32_t HELPER(neon_qrdmlah_s16)(CPUARMState *env, uint32_t src1, uint32_t src2, uint32_t src3) { uint32_t *sat = &env->vfp.qc[0]; - uint16_t e1 = inl_qrdmlah_s16(src1, src2, src3, sat); - uint16_t e2 = inl_qrdmlah_s16(src1 >> 16, src2 >> 16, src3 >> 16, sat); + uint16_t e1 = do_sqrdmlah_h(src1, src2, src3, false, true, sat); + uint16_t e2 = do_sqrdmlah_h(src1 >> 16, src2 >> 16, src3 >> 16, + false, true, sat); return deposit32(e1, 16, 16, e2); } @@ -73,35 +79,18 @@ void HELPER(gvec_qrdmlah_s16)(void *vd, void *vn, void *vm, uintptr_t i; for (i = 0; i < opr_sz / 2; ++i) { - d[i] = inl_qrdmlah_s16(n[i], m[i], d[i], vq); + d[i] = do_sqrdmlah_h(n[i], m[i], d[i], false, true, vq); } clear_tail(d, opr_sz, simd_maxsz(desc)); } -/* Signed saturating rounding doubling multiply-subtract high half, 16-bit */ -static int16_t inl_qrdmlsh_s16(int16_t src1, int16_t src2, - int16_t src3, uint32_t *sat) -{ - /* Similarly, using subtraction: - * = ((a3 << 16) - ((e1 * e2) << 1) + (1 << 15)) >> 16 - * = ((a3 << 15) - (e1 * e2) + (1 << 14)) >> 15 - */ - int32_t ret = (int32_t)src1 * src2; - ret = ((int32_t)src3 << 15) - ret + (1 << 14); - ret >>= 15; - if (ret != (int16_t)ret) { - *sat = 1; - ret = (ret < 0 ? -0x8000 : 0x7fff); - } - return ret; -} - uint32_t HELPER(neon_qrdmlsh_s16)(CPUARMState *env, uint32_t src1, uint32_t src2, uint32_t src3) { uint32_t *sat = &env->vfp.qc[0]; - uint16_t e1 = inl_qrdmlsh_s16(src1, src2, src3, sat); - uint16_t e2 = inl_qrdmlsh_s16(src1 >> 16, src2 >> 16, src3 >> 16, sat); + uint16_t e1 = do_sqrdmlah_h(src1, src2, src3, true, true, sat); + uint16_t e2 = do_sqrdmlah_h(src1 >> 16, src2 >> 16, src3 >> 16, + true, true, sat); return deposit32(e1, 16, 16, e2); } @@ -115,19 +104,23 @@ void HELPER(gvec_qrdmlsh_s16)(void *vd, void *vn, void *vm, uintptr_t i; for (i = 0; i < opr_sz / 2; ++i) { - d[i] = inl_qrdmlsh_s16(n[i], m[i], d[i], vq); + d[i] = do_sqrdmlah_h(n[i], m[i], d[i], true, true, vq); } clear_tail(d, opr_sz, simd_maxsz(desc)); } /* Signed saturating rounding doubling multiply-accumulate high half, 32-bit */ -static int32_t inl_qrdmlah_s32(int32_t src1, int32_t src2, - int32_t src3, uint32_t *sat) +static int32_t do_sqrdmlah_s(int32_t src1, int32_t src2, int32_t src3, + bool neg, bool round, uint32_t *sat) { /* Simplify similarly to int_qrdmlah_s16 above. */ int64_t ret = (int64_t)src1 * src2; - ret = ((int64_t)src3 << 31) + ret + (1 << 30); + if (neg) { + ret = -ret; + } + ret = ((int64_t)src3 << 31) + (round << 30); ret >>= 31; + if (ret != (int32_t)ret) { *sat = 1; ret = (ret < 0 ? INT32_MIN : INT32_MAX); @@ -139,7 +132,7 @@ uint32_t HELPER(neon_qrdmlah_s32)(CPUARMState *env, int32_t src1, int32_t src2, int32_t src3) { uint32_t *sat = &env->vfp.qc[0]; - return inl_qrdmlah_s32(src1, src2, src3, sat); + return do_sqrdmlah_s(src1, src2, src3, false, true, sat); } void HELPER(gvec_qrdmlah_s32)(void *vd, void *vn, void *vm, @@ -152,31 +145,16 @@ void HELPER(gvec_qrdmlah_s32)(void *vd, void *vn, void *vm, uintptr_t i; for (i = 0; i < opr_sz / 4; ++i) { - d[i] = inl_qrdmlah_s32(n[i], m[i], d[i], vq); + d[i] = do_sqrdmlah_s(n[i], m[i], d[i], false, true, vq); } clear_tail(d, opr_sz, simd_maxsz(desc)); } -/* Signed saturating rounding doubling multiply-subtract high half, 32-bit */ -static int32_t inl_qrdmlsh_s32(int32_t src1, int32_t src2, - int32_t src3, uint32_t *sat) -{ - /* Simplify similarly to int_qrdmlsh_s16 above. */ - int64_t ret = (int64_t)src1 * src2; - ret = ((int64_t)src3 << 31) - ret + (1 << 30); - ret >>= 31; - if (ret != (int32_t)ret) { - *sat = 1; - ret = (ret < 0 ? INT32_MIN : INT32_MAX); - } - return ret; -} - uint32_t HELPER(neon_qrdmlsh_s32)(CPUARMState *env, int32_t src1, int32_t src2, int32_t src3) { uint32_t *sat = &env->vfp.qc[0]; - return inl_qrdmlsh_s32(src1, src2, src3, sat); + return do_sqrdmlah_s(src1, src2, src3, true, true, sat); } void HELPER(gvec_qrdmlsh_s32)(void *vd, void *vn, void *vm, @@ -189,7 +167,7 @@ void HELPER(gvec_qrdmlsh_s32)(void *vd, void *vn, void *vm, uintptr_t i; for (i = 0; i < opr_sz / 4; ++i) { - d[i] = inl_qrdmlsh_s32(n[i], m[i], d[i], vq); + d[i] = do_sqrdmlah_s(n[i], m[i], d[i], true, true, vq); } clear_tail(d, opr_sz, simd_maxsz(desc)); } From patchwork Sat Aug 15 01:31:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247766 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1289040ilo; Sat, 15 Aug 2020 09:55:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytHUse2VySVCN8oaxqp1MBYJjn2oeyTOWPi+7UUnhvk3qCBUZqHc7p6xlu3sr8Ch2ZFKoH X-Received: by 2002:a5b:410:: with SMTP id m16mr10295271ybp.309.1597510526728; Sat, 15 Aug 2020 09:55:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597510526; cv=none; d=google.com; s=arc-20160816; b=VvEe5mlP1tQxTMykXGFmQWE33lPlC9dt2GUpQRQhV3ucV+YNHs3Lr4CDDNfVRZ3lg2 8r37c1IljLnaFwprfpHh7vxmRb0mP+tJz720IbMjcDv2wEXnVebdBa1FeLH9gw5QfT1T mKeG5Hy6FBvJ6ngWWgmFgrDKDQ7GC1CHj78jnhJqn4Iwb33KxqwkJONxUz3982hfL5TM mEO2k1NKYMtzkZUVyhoQPhD/L+VPmLBSHyvyw4QyavrIT5UvsTQxczIV29lBkdSHTcwB iJqHiZsZrzVIWNL3lQmyN081hOlu5QpMPjnwPJ2cZ8fYbNb+/04Eu6usGu5O9JDrMpRS Eamw== 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=Op8+nIvDwpXgHA5KB5m5Q5E20k6FFVqok3W8zuTgmJQ=; b=eY1tHVJTO+AIPTg5DGVnthPld1Z4wFBo7TjhOYb8fZMbFSKxnWjsVZgw/JsFf9/60X 659QcBwhfqTxTLzfIAGo2CJ98Md9lpcBd7wAPL3kxx/mUNKxO6teQCoM0Ga8tES9qRwH mGsEkg6psDAYgmgKerS+0RHpOUrJ+Ncmtx3DxWSvt5RsDTqs5msUFtPN3+zG1sn6wnzn CTf563xxY/EghgcA+ZHevqegkZ0q3y7cIeY10CzQsIRQaUvfXLwXNWCWf0g9KP9LGS6S qmNtRh6fgTacH+tU2i6e39iqBE3OQrJLZZmelxRiC3roL/tXHr8vNzyLUvK6/sdZlVAH u6mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="SWBW/y7m"; 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=fail (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 r9si12788924ybr.120.2020.08.15.09.55.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 09:55:26 -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=fail header.i=@linaro.org header.s=google header.b="SWBW/y7m"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6zSo-00063E-8p for patch@linaro.org; Sat, 15 Aug 2020 12:55:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6zSg-00062Z-6e for qemu-devel@nongnu.org; Sat, 15 Aug 2020 12:55:18 -0400 Received: from mail-vs1-xe42.google.com ([2607:f8b0:4864:20::e42]:42873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6zSe-0008PE-GI for qemu-devel@nongnu.org; Sat, 15 Aug 2020 12:55:17 -0400 Received: by mail-vs1-xe42.google.com with SMTP id q13so6199972vsn.9 for ; Sat, 15 Aug 2020 09:55:16 -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=Op8+nIvDwpXgHA5KB5m5Q5E20k6FFVqok3W8zuTgmJQ=; b=SWBW/y7m3+PdaFt/aEfgwdLYM4xUYOO17egAyx0QX5bMmY7zUS1lWiXgArxER7vnw6 ab99bz1uQiinq8jZkO3ohdw/cycWCP5Mm00VzBf2UQfBpgAAReD9Yvxxe+up2iKlRRb0 9lioC+hyaLBS+YCrr2EeZAhDRcZyIlwHVUSCAgjpTtqsYmo5ABE3kGQdi77me/47hfpp kwjg+wTaKG2QlAPNaEELUNzq9mTnG8BX5b5FsNakrnYIBDXqsDhLa4fw3If9ZK3YKBax kkHCAptEGkXErDKmK0yTay3HHkGJ+/g9MAzvzk34s1R4CwWZJ3iINy6Sr0ZZnPTGXlAj 7BPw== 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=Op8+nIvDwpXgHA5KB5m5Q5E20k6FFVqok3W8zuTgmJQ=; b=RuV9xAquiD5yc3xFv1iMObXn7xUwyT5A4xGevZ60JxyoVUd7Cf6hxLB9aEX82uQBkR jLecBBqG5WxYXd/gfV23dob2sjaZIyb3RFfZBoOKBYnKMt9N2k2ErmT9Ml26gmt11NE+ gptcr0OZXhKogeoT7jaEK8mdjE+bdqp0xkV0MTKBWs1++n4898kCfxPLR+Gfy6HzBxtb EG/oSxRm3YeePxxzkJPOL+qbvstbBKv/D/Gwgo1rEPMnooHmmAeLayeOyA2eFeS+sqfI J6Ok/SgsdUMPlNBpDwzusMXmPgGjVQ17TXJIHo8+yzvMq0cmkUGge4S7wc7GDeoNeg5h VF8Q== X-Gm-Message-State: AOAM531OA/3XfuKvhy7nn0l9GrWQnyj4nVqvekoMUVdK+uRHLwOAl6eI kdbP3PaLCKUuISH70cfUb9MYISY6Ps4+4Q== X-Received: by 2002:a62:d111:: with SMTP id z17mr3757649pfg.221.1597455128053; Fri, 14 Aug 2020 18:32:08 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:32:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 15/20] target/arm: Fix sve_uzp_p vs odd vector lengths Date: Fri, 14 Aug 2020 18:31:40 -0700 Message-Id: <20200815013145.539409-16-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: Laurent Desnogues , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Missed out on compressing the second half of a predicate with length vl % 512 > 256. Adjust all of the x + (y << s) to x | (y << s) as a general style fix. Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson --- target/arm/sve_helper.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) -- 2.25.1 diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index 4758d46f34..fcb46f150f 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -1938,7 +1938,7 @@ void HELPER(sve_uzp_p)(void *vd, void *vn, void *vm, uint32_t pred_desc) if (oprsz <= 8) { l = compress_bits(n[0] >> odd, esz); h = compress_bits(m[0] >> odd, esz); - d[0] = extract64(l + (h << (4 * oprsz)), 0, 8 * oprsz); + d[0] = l | (h << (4 * oprsz)); } else { ARMPredicateReg tmp_m; intptr_t oprsz_16 = oprsz / 16; @@ -1952,23 +1952,35 @@ void HELPER(sve_uzp_p)(void *vd, void *vn, void *vm, uint32_t pred_desc) h = n[2 * i + 1]; l = compress_bits(l >> odd, esz); h = compress_bits(h >> odd, esz); - d[i] = l + (h << 32); + d[i] = l | (h << 32); } - /* For VL which is not a power of 2, the results from M do not - align nicely with the uint64_t for D. Put the aligned results - from M into TMP_M and then copy it into place afterward. */ + /* + * For VL which is not a multiple of 512, the results from M do not + * align nicely with the uint64_t for D. Put the aligned results + * from M into TMP_M and then copy it into place afterward. + */ if (oprsz & 15) { - d[i] = compress_bits(n[2 * i] >> odd, esz); + int final_shift = (oprsz & 15) * 2; + + l = n[2 * i + 0]; + h = n[2 * i + 1]; + l = compress_bits(l >> odd, esz); + h = compress_bits(h >> odd, esz); + d[i] = l | (h << final_shift); for (i = 0; i < oprsz_16; i++) { l = m[2 * i + 0]; h = m[2 * i + 1]; l = compress_bits(l >> odd, esz); h = compress_bits(h >> odd, esz); - tmp_m.p[i] = l + (h << 32); + tmp_m.p[i] = l | (h << 32); } - tmp_m.p[i] = compress_bits(m[2 * i] >> odd, esz); + l = m[2 * i + 0]; + h = m[2 * i + 1]; + l = compress_bits(l >> odd, esz); + h = compress_bits(h >> odd, esz); + tmp_m.p[i] = l | (h << final_shift); swap_memmove(vd + oprsz / 2, &tmp_m, oprsz / 2); } else { @@ -1977,7 +1989,7 @@ void HELPER(sve_uzp_p)(void *vd, void *vn, void *vm, uint32_t pred_desc) h = m[2 * i + 1]; l = compress_bits(l >> odd, esz); h = compress_bits(h >> odd, esz); - d[oprsz_16 + i] = l + (h << 32); + d[oprsz_16 + i] = l | (h << 32); } } } From patchwork Sat Aug 15 01:31:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247752 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1232934ilo; Sat, 15 Aug 2020 08:15:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyE3VDVyFPdr8foH+LNIj1RNs2cgJMuotaWJwGIjewSdmPiw3QkN2SNRBkFgvVYY5ecde+g X-Received: by 2002:a25:4c8:: with SMTP id 191mr9860824ybe.170.1597504549158; Sat, 15 Aug 2020 08:15:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597504549; cv=none; d=google.com; s=arc-20160816; b=lSPHo29rDjOPE6tNZ0pDYTICVaYEKY4IHYF+G7Ybovl3XcFyeioZ1qff3JMhdv8Fut QTsuXvIiKlns/ZphZxIiekkbJDY28iWdRWXgyS8KejZcoicetsafRqZsZ1/pFkkdw9CS ZoKPDAxOuJ8iSFhN6acq/ac8RvTXcw7dfmjXmBe6I2d3CztubzZQe2r0ZWx4IB0+jCKR 6L6uHRdElZ/3Wc6KvP/6ioyxKkUAnOrDpPHxbchxhmNUUA1XrqyEBTQbD4FBVCeF5QOZ mRi5tBj/4LpzynIwgr74uGeCMAcCbQABDDhCRKXgC1LKL3viYjKA4qZA3VzrMe3ltFiS FzHQ== 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=a6sddQ4a7J3ma5R9bNKguwF3w7koXzfGsjqJtD8mfho=; b=Xr6UMJ/H8rS6TxJVvzeeXze28KIal9D1bTRfc2HutzrXD9dATokslOgmufMdfAdaSG BDZ7PH4tzwkhJcQ5f1HxgY9XMPT3udhbjSNijgQrEWz7L5x8Avr+fNa0jFnd6gFlx7+B Um79ZkcX+Qgt1wcw+Rd/E81Twm9y0a3rmJS1GdRXSl0jGvrxitapwnI4JqdC0pkOxVIW OEiXpwmCUfzyrM5SzkodMwntSRq58PLq7du/PcDY28NcWSUxAr+yHn0Mi6SjcFsVBTAS EoJBVhrWPc4eujp7e7yODN7xe4I+aXYbzAunCDJdr1tQSrPOm0C9zgG7wKdaUjX6j6jW O4BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=X10e0JN1; 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=fail (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 f76si13316506ybg.34.2020.08.15.08.15.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 08:15:49 -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=fail header.i=@linaro.org header.s=google header.b=X10e0JN1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6xuO-0006sF-Hq for patch@linaro.org; Sat, 15 Aug 2020 11:15:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6xtO-0006o3-NB for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:14:46 -0400 Received: from mail-vs1-xe43.google.com ([2607:f8b0:4864:20::e43]:46489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6xtM-000185-M9 for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:14:46 -0400 Received: by mail-vs1-xe43.google.com with SMTP id b26so6109234vsa.13 for ; Sat, 15 Aug 2020 08:14: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=a6sddQ4a7J3ma5R9bNKguwF3w7koXzfGsjqJtD8mfho=; b=X10e0JN16bMkT8rBKbYO3BHenJUORxUWQVjak0G+QKgEcbyt4DB0uHnytL7vwpAO+a NwxwXz7FjAeGU0LmyKOMB0pMGxPo+UWJ1S4zjb+XaFGjXws9eycSdNF1xZK4Lvu5w7Jr Co4tarm7RPg7D/kYnLxijq5KqIKCfBCBSsIksLWNfUQt2DpqKP/oflHZrXhv/LJnPAPP SvDhhS1B60DA1iIgr/KirJgUR7yfFrn7gOuixzyJcYTxkFIkB5aO0uN91G8O0sU08ZI2 8MNM/O42zhLLuCUHlCUZniGqJBMvOB+DKRt4um9BM4KVpsMDkmXG1Cmj8GCz5P1zqBy4 ri4A== 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=a6sddQ4a7J3ma5R9bNKguwF3w7koXzfGsjqJtD8mfho=; b=dcIAT+sCWdB1XuP+SMZfdWszHb+r+Q3BUxTP5B45n33EjJlKtnNMhuNpnJ2gTY8L4i OpGFlzf3DUIMe+Uq17sS0NY448HIUMTbWQOO7NBPMZwdrR9F9ibvT7uSXTSwztVtFR1W BXQQppZYkpUBXMg8bo4whtUGJOCwJwr/L3zh6nP7dGgdy4+QYzM2001TLZehKsqqATS/ Stg5MQ3irTBJYOKzLjcU3p6Zxa/DA6mMaxmU31lUwnMXAShdRlxU+oanj3EBbgnn+MwH YfrBIJck74UMqghrS2v4UcnTsJKqvWBYwHQ2Lfb0W+GQ/Qq0cItPpqyrIkdVWp0gQM73 lkVA== X-Gm-Message-State: AOAM532XjN3mDQmKZVaAIUGp6GutIGNHqe0LGnfX2BQ54u7w0Dwnlo0j tbwyZcLE9iSiAUozkSVNTv7Vd2KVbPbJvw== X-Received: by 2002:aa7:924b:: with SMTP id 11mr680979pfp.185.1597455129593; Fri, 14 Aug 2020 18:32:09 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.32.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:32:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 16/20] target/arm: Fix sve_zip_p vs odd vector lengths Date: Fri, 14 Aug 2020 18:31:41 -0700 Message-Id: <20200815013145.539409-17-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::e43; envelope-from=richard.henderson@linaro.org; helo=mail-vs1-xe43.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: Laurent Desnogues , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Wrote too much with low-half zip (zip1) with vl % 512 != 0. Adjust all of the x + (y << s) to x | (y << s) as a style fix. Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson --- target/arm/sve_helper.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) -- 2.25.1 diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index fcb46f150f..b8651ae173 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -1870,6 +1870,7 @@ void HELPER(sve_zip_p)(void *vd, void *vn, void *vm, uint32_t pred_desc) intptr_t oprsz = extract32(pred_desc, 0, SIMD_OPRSZ_BITS) + 2; int esz = extract32(pred_desc, SIMD_DATA_SHIFT, 2); intptr_t high = extract32(pred_desc, SIMD_DATA_SHIFT + 2, 1); + int esize = 1 << esz; uint64_t *d = vd; intptr_t i; @@ -1882,33 +1883,35 @@ void HELPER(sve_zip_p)(void *vd, void *vn, void *vm, uint32_t pred_desc) mm = extract64(mm, high * half, half); nn = expand_bits(nn, esz); mm = expand_bits(mm, esz); - d[0] = nn + (mm << (1 << esz)); + d[0] = nn | (mm << esize); } else { - ARMPredicateReg tmp_n, tmp_m; + ARMPredicateReg tmp; /* We produce output faster than we consume input. Therefore we must be mindful of possible overlap. */ - if ((vn - vd) < (uintptr_t)oprsz) { - vn = memcpy(&tmp_n, vn, oprsz); - } - if ((vm - vd) < (uintptr_t)oprsz) { - vm = memcpy(&tmp_m, vm, oprsz); + if (vd == vn) { + vn = memcpy(&tmp, vn, oprsz); + if (vd == vm) { + vm = vn; + } + } else if (vd == vm) { + vm = memcpy(&tmp, vm, oprsz); } if (high) { high = oprsz >> 1; } - if ((high & 3) == 0) { + if ((oprsz & 7) == 0) { uint32_t *n = vn, *m = vm; high >>= 2; - for (i = 0; i < DIV_ROUND_UP(oprsz, 8); i++) { + for (i = 0; i < oprsz / 8; i++) { uint64_t nn = n[H4(high + i)]; uint64_t mm = m[H4(high + i)]; nn = expand_bits(nn, esz); mm = expand_bits(mm, esz); - d[i] = nn + (mm << (1 << esz)); + d[i] = nn | (mm << esize); } } else { uint8_t *n = vn, *m = vm; @@ -1920,7 +1923,7 @@ void HELPER(sve_zip_p)(void *vd, void *vn, void *vm, uint32_t pred_desc) nn = expand_bits(nn, esz); mm = expand_bits(mm, esz); - d16[H2(i)] = nn + (mm << (1 << esz)); + d16[H2(i)] = nn | (mm << esize); } } } From patchwork Sat Aug 15 01:31:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247759 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1265063ilo; Sat, 15 Aug 2020 09:10:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzfKy37aZMRLNgyz0ASHSeC7UIb7yH1c3YjM1X4caoIcepWxvUCZLMogs7JhN4OsPcUNUC X-Received: by 2002:a25:2006:: with SMTP id g6mr11875222ybg.143.1597507815311; Sat, 15 Aug 2020 09:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597507815; cv=none; d=google.com; s=arc-20160816; b=gKo92CZvrdA7qi0wRDmT9XbWbUHoDIIwI95yFTcM/9Eqt7+otdQMI6LZKDq3tMB/1V kZEc3OzpABtrZeq0q7wYfUsFQIqP8IptB3YSksU57b2IXwVtgeI2hks9C9ziNj24VD0Y e+YhSQPZxuIAw3HxUhL4eDoknpK9JYDBCgZJRvTfbVNIle4oeJMFG6N64umYSh5UqLlP iBEZk0Dy0uBQKtP3aALQ/7p8h03CKWqbaifYt77DI0NL/Kio8fqUMqzfSuzIZzRPrjJi Y5UrRP/kZMGiYOBpdd8kfGX+OGm1veYHM6XY3E8SfIv9UKPjfZmQ5EljZQSXw+tfa5jn SpiQ== 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=QsaGTiUVfWoR7s1tF95X85Ju0+8PUYwEAqh0P+R84cU=; b=PPxVP+1xljFvFILAGW+yQZqni2srZK7EHkP31cIc3W41sjEq09xky2tGVGsNIefmfc Kt5MPt69Clh7lEpywN/1saEFdWkPgNbIBd4DHXYyhcoYuKvwvTId4vaKgL1diSxZOcoD Z2JButipIPqiBX+yAvDiONfy+1lmhGNVQBhGX7roJ28ulhZYEzwr1e+xC+3jkExPHY7x Fz2sTwdiaU355o8V3viFKW6xo1IMHtIKLuamnFrdMvSAwMQ6Sip/M65UBt9PFQlcS+Yu 8CY2K8BPAQyDPWbNMvqyUoWwlc1uNk8WmSf8MeJqi4PVhLUnHAJNebJkgkYDy9iJk+ox 865Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NkdNomWE; 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=fail (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 r126si11402476ybf.329.2020.08.15.09.10.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 09:10:15 -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=fail header.i=@linaro.org header.s=google header.b=NkdNomWE; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6yl4-0002SW-Rv for patch@linaro.org; Sat, 15 Aug 2020 12:10:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6yko-0002Qj-RS for qemu-devel@nongnu.org; Sat, 15 Aug 2020 12:09:58 -0400 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]:34768) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6ykn-0002a9-88 for qemu-devel@nongnu.org; Sat, 15 Aug 2020 12:09:58 -0400 Received: by mail-oi1-x241.google.com with SMTP id z22so10962318oid.1 for ; Sat, 15 Aug 2020 09:09:56 -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=QsaGTiUVfWoR7s1tF95X85Ju0+8PUYwEAqh0P+R84cU=; b=NkdNomWEJHvOAJWlQ7t+8+TgCmGLRbkeX5ytcxkQFp1uN+rHhK1sZszsWa6sgHuGrF l65YGA8PvL9ZUzjy5qlkYXKcN9ANgkfBIjDRQwZYBE7wb7TLNh+b5SBy1+yy7AitQhBl JAlnBvArNkVeeXx0yHx0KKXLw0Szd6fHoyun3BfgsA6Pu0w2a8Xq1zJB5E40y7EdPVqW hHe5Nl+xE/Zl1Y+x9itwl7NsJrO8e3vLcn+OP8F4DPBkXQ3hyRtjNb29F5BISBjFPUSw Aj9HHyK2LTUNO+gufx7TnUl17fQXo8OXK//N0ELWrQZ93ws+3vTY6m4T6UbAZoIh35Rp u5Pw== 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=QsaGTiUVfWoR7s1tF95X85Ju0+8PUYwEAqh0P+R84cU=; b=gMBCpn+AV9UD/nWjd6URJfAX5/Wq8C37s8AzremIZfOPyCJyIkSqncdIsPhgZRlE3W k/4UnWWyXhywVgxjapLVR6Do1pbLOGN2hB68Ns46LgI2HmOMvAWcvMWtZZIcGHamyjQC 24nkp2GHSCKguFf8tkz3X9u/mf66jKzmEzf53uaRiBsAY065RvOCF2O4lHwzDe/gMw3E 0MYXg4oo8pFgvECTDZqy09q73al6ALg8937LwVqJ/0YMe39wdZXj27HPtggjIXLcCsJ6 MCWqnXPlNsctQb9xFq1Oe6cvyz3QvHhFAV5X8Nj4uJSHnTa6NiXBud44HPMyusQ1ajQ0 HxOw== X-Gm-Message-State: AOAM531jPPLVngvDrh/zocueFhVQCqEzDMzO3Yno1z57mvwDDgSy5KlO l0Mh/k/TSDDPSJ6wifv+2TGQTTr7z9EkvA== X-Received: by 2002:a17:90a:1a42:: with SMTP id 2mr4123152pjl.16.1597455130803; Fri, 14 Aug 2020 18:32:10 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:32:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 17/20] target/arm: Fix sve_punpk_p vs odd vector lengths Date: Fri, 14 Aug 2020 18:31:42 -0700 Message-Id: <20200815013145.539409-18-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::241; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x241.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: Laurent Desnogues , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Wrote too much with punpk1 with vl % 512 != 0. Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson --- target/arm/sve_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index b8651ae173..c983cd4356 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -2104,11 +2104,11 @@ void HELPER(sve_punpk_p)(void *vd, void *vn, uint32_t pred_desc) high = oprsz >> 1; } - if ((high & 3) == 0) { + if ((oprsz & 7) == 0) { uint32_t *n = vn; high >>= 2; - for (i = 0; i < DIV_ROUND_UP(oprsz, 8); i++) { + for (i = 0; i < oprsz / 8; i++) { uint64_t nn = n[H4(high + i)]; d[i] = expand_bits(nn, 0); } From patchwork Sat Aug 15 01:31:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247771 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1315707ilo; Sat, 15 Aug 2020 10:44:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaucTVfTgtExhkngKeWdm3kPWXR2uJvNGzglYP9UFcSWVNmy3zSzwREXIV2mX9FT1+YjfN X-Received: by 2002:a25:4846:: with SMTP id v67mr10965931yba.103.1597513443167; Sat, 15 Aug 2020 10:44:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597513443; cv=none; d=google.com; s=arc-20160816; b=ZqZ0CILiyP9iww4fn4ZdB0jRk7Q6Jz4RCIDdImrXfDJGim8JZqoVVjbeB78ia9+0ku bTmgFL/XLWVvZUVkLvTrTvIPTV56zwtIzSlNYxaLz1NGSAVEFRZ8p92KYFgnj17lyjO/ cIfJDMftvwDwEsRecXqbOqTx1PlCF1uSmqD0pqjoL8x/KljL8f1ma915VqhI4gwAgdsm EooOMliUMXboxgCVV3f0GfitIxvbc0wvFbRhckKXkh6PDyGzstv20EgTFSXkOJMdMfKP UyB7VO8fsZ3ylyHV4Q2OAH+10zI+CSvuXlX/0IErl4oOWFcW3tawK2/dm46XBfEcz3VA SSgQ== 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=zTB6EmS659aVNk9guq/xoJniox/gT5O8Z9/PsHuviR0=; b=GBdwjrDRuHBBgFu6K5u0Fxn+U9qsWUAB3r7sxorJmE9MhhReL6BzqfFmYJ/DZh5cR+ HOojiIl+xx8MYxQk5JPi50cBSwaH3tCa1f2RDE/LGo0Ul/2/TlQDeITgUSQO+JGy1JOW KXQ3Oozorb1y+2HSP60+MYdof5/oUibWDlw5krgubvDaXUoAHIlB8PIHj98pTy2ThSDm BS3lgEAxMWaJQNy4H2ILAkZNzmDNMCXfXYSWQuQBfqzuPnjawdaIrAIHBF6RSJHdUijq 8V2PySDADKnE1FAAxfaOXCa7QmlYaFgPQRMfKVST8Ni2TdWJy1SjjbvmJd3CgFfyOPsC pFzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J7WPSr9H; 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 z6si11502704ybn.356.2020.08.15.10.44.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 10:44:03 -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=J7WPSr9H; 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]:36908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k70Dq-0000Pt-M6 for patch@linaro.org; Sat, 15 Aug 2020 13:44:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k70Dh-0000Pm-4N for qemu-devel@nongnu.org; Sat, 15 Aug 2020 13:43:53 -0400 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:45475) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k70Df-0005DA-CR for qemu-devel@nongnu.org; Sat, 15 Aug 2020 13:43:52 -0400 Received: by mail-oi1-x244.google.com with SMTP id o21so11082051oie.12 for ; Sat, 15 Aug 2020 10:43:50 -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=zTB6EmS659aVNk9guq/xoJniox/gT5O8Z9/PsHuviR0=; b=J7WPSr9H6Uv8XIX6kkH7GuxqNvaDlPcE+cUlUh5B9l7naWSHAZMYLTt89khtdA7NpE +UryUTEBC/tTGcYZX61gTmldhC/WbS6HJXoRA4YZqwa6oqhhyfnnb0IiK6NINS9LEQKA uZmQ6Qmf9eXnWYqbb8zO22gma/uwPuYjcHtmBUXQoNjkwuZ8JaZWSsrTpRWlhXKGJAHa peXYzWvw3jHrS77ScxoZz/+1abZg03N2c3o9UxQzCmJZSVhvTwRj1nmFsh5VS0cbY4Wk lk6yOhFoBoXFQpekpWVSL5bT2QxxkStsjEozF2KIqhJxUhJ42vqLxoaCgGRczCYusy8A OzPA== 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=zTB6EmS659aVNk9guq/xoJniox/gT5O8Z9/PsHuviR0=; b=dOlBPplHkykQaEZfB8+qcrHo+z7nm3P5mXfa2FPcEbD4n7iSr1q0nm9j55kTaWgEzu +8Hf7+RtZH7+iPUuS2shk5/di+q43ELMrnI1MJzfaI/FuMoy38xHG87jjMAygOS/U3p5 jKIhMxPoCwW5jmkqS2/TRzWQTaK+F0zfYNgYTaYe3RPuaVsFmBlPachOiybJhCXWlmhM ch+Sz7kgs0PmJyyJOQ6+ZTZA8tpyFIKEsMoUSl1JiePwbaU+fUn+hbQHiFmr+bRNKVMu Q04mtnaA92UNZ6Qazve9mhnQer6xZXAjUCrD1PSlilC5uPkVXe8TasjP/E1fpEAfrydq Ux5Q== X-Gm-Message-State: AOAM531UJ6YJJBChLSUTL1SmhSd1b4MP16RLpHMjILgd2TkT0dnMo+Su GTOOpSnBDrySAIUMuJbrQKPHrlL/ZQjeQA== X-Received: by 2002:a17:90a:c208:: with SMTP id e8mr4218187pjt.73.1597455131996; Fri, 14 Aug 2020 18:32:11 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:32:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 18/20] target/arm: Convert integer multiply (indexed) to gvec for aa64 advsimd Date: Fri, 14 Aug 2020 18:31:43 -0700 Message-Id: <20200815013145.539409-19-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::244; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x244.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 | 4 ++++ target/arm/translate-a64.c | 16 ++++++++++++++++ target/arm/vec_helper.c | 29 +++++++++++++++++++++++++---- 3 files changed, 45 insertions(+), 4 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/helper.h b/target/arm/helper.h index 759639a63a..d0573a53c8 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -758,6 +758,10 @@ DEF_HELPER_FLAGS_4(gvec_uaba_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_uaba_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_4(gvec_uaba_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +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) + #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 42aa695dff..d08960a1c8 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -13507,6 +13507,22 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn) data, gen_helper_gvec_fmlal_idx_a64); } return; + + case 0x08: /* MUL */ + if (!is_long && !is_scalar) { + static gen_helper_gvec_3 * const fns[3] = { + gen_helper_gvec_mul_idx_h, + gen_helper_gvec_mul_idx_s, + gen_helper_gvec_mul_idx_d, + }; + tcg_gen_gvec_3_ool(vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + vec_full_reg_offset(s, rm), + 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 bbd1141dfc..aa1de36921 100644 --- a/target/arm/vec_helper.c +++ b/target/arm/vec_helper.c @@ -711,6 +711,27 @@ DO_3OP(gvec_rsqrts_d, helper_rsqrtsf_f64, float64) */ #define DO_MUL_IDX(NAME, TYPE, H) \ +void HELPER(NAME)(void *vd, void *vn, void *vm, 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; \ + for (i = 0; i < oprsz / sizeof(TYPE); i += segment) { \ + TYPE mm = m[H(i + idx)]; \ + for (j = 0; j < segment; j++) { \ + d[i + j] = n[i + j] * mm; \ + } \ + } \ + clear_tail(d, oprsz, simd_maxsz(desc)); \ +} + +DO_MUL_IDX(gvec_mul_idx_h, uint16_t, H2) +DO_MUL_IDX(gvec_mul_idx_s, uint32_t, H4) +DO_MUL_IDX(gvec_mul_idx_d, uint64_t, ) + +#undef DO_MUL_IDX + +#define DO_FMUL_IDX(NAME, TYPE, H) \ void HELPER(NAME)(void *vd, void *vn, void *vm, void *stat, uint32_t desc) \ { \ intptr_t i, j, oprsz = simd_oprsz(desc), segment = 16 / sizeof(TYPE); \ @@ -725,11 +746,11 @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *stat, uint32_t desc) \ clear_tail(d, oprsz, simd_maxsz(desc)); \ } -DO_MUL_IDX(gvec_fmul_idx_h, float16, H2) -DO_MUL_IDX(gvec_fmul_idx_s, float32, H4) -DO_MUL_IDX(gvec_fmul_idx_d, float64, ) +DO_FMUL_IDX(gvec_fmul_idx_h, float16, H2) +DO_FMUL_IDX(gvec_fmul_idx_s, float32, H4) +DO_FMUL_IDX(gvec_fmul_idx_d, float64, ) -#undef DO_MUL_IDX +#undef DO_FMUL_IDX #define DO_FMLA_IDX(NAME, TYPE, H) \ void HELPER(NAME)(void *vd, void *vn, void *vm, void *va, \ 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) \ { \ From patchwork Sat Aug 15 01:31:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247754 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp1241449ilo; Sat, 15 Aug 2020 08:30:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8BcngobzRvOSizaMboxZPL+MqgfJfXUHYKv92HU0dY1ImftiaK4jtjOka1ZibloZqLwfC X-Received: by 2002:a25:9b86:: with SMTP id v6mr10367746ybo.133.1597505436564; Sat, 15 Aug 2020 08:30:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597505436; cv=none; d=google.com; s=arc-20160816; b=pc+wx4Xso3U7l/sq38lXNd7r3VpZcJIXZ8czc35IIz7HIKzpuHUOPd+7QQZjdRp+h1 pNcd2oPRBK7PNi3gNNXwpYGBH7t7KaoQOmNjDxaQbq0/2hyz/ASeUfwb41eya7/I99xP /yl4U8XYAfe8lmt8MNo2cDLAnehpgDdTdbbm1e+qto4N2D9RcY1UvRYLbpOT/Mt+ZssR 5QVW/EnRH7PVd2hFK7RxEBoqn0Oqcv3VvkuluVXyH8cyWdY7tTUOfWyLTeNnqfG9Va0l fuovP+cuEtM3vdvFuZ9Y5iR9SKW3nCeqrHICmXWuynlarpQiEgg5rjOlOToJhojX/u3b xPfQ== 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=D1VJrUQknShqmnmzu8X8w1cJRuHx820LA67l/SpR/wI=; b=ZCyXQLLzNBcQYv+3WzBSKxZj1gVi2DDzNUwFm3Dbo0u8HLiwqAH2DZTOxMPsocYkd9 rSoaaaFEOTUBAeQO2U4a0MYtj7N6voZXQ7G8K8Cu1daD2+7oPMbpfPe1SxssFPWMJYFJ VyAGvZ/2KooxtFxuUbb21XX0GVKxruUu8kpb/aQCuSD3s7wrdhOkrK6J38vDEOfIKia2 3Ei7lvlawt5KXSYTjp3RLnUdJbpwi1KF8qZKA/H7SIlN56qZ88bwmdck59EVf3p5mCnA El+OH+IRghBFgRoOLt4O9vLSzH+Me3cioGXxgUMM05jq0H6hPib0Gt+6LffyDW4Q5CSq pP7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WmVif8Ar; 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=fail (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 x4si11390328ybq.362.2020.08.15.08.30.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Aug 2020 08:30:36 -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=fail header.i=@linaro.org header.s=google header.b=WmVif8Ar; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6y8h-0004fl-Vz for patch@linaro.org; Sat, 15 Aug 2020 11:30:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6y6U-0002oW-Ko for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:28:18 -0400 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]:39770) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6y6S-00040C-Qi for qemu-devel@nongnu.org; Sat, 15 Aug 2020 11:28:18 -0400 Received: by mail-pj1-x1041.google.com with SMTP id f9so5653082pju.4 for ; Sat, 15 Aug 2020 08:28:15 -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=D1VJrUQknShqmnmzu8X8w1cJRuHx820LA67l/SpR/wI=; b=WmVif8ArPf0sdlGrhV/s/zKZGtvIaxy/aOyK09OYvPdy1oSxGR/pblFFX7sTBnZxVj rgYuuolNwN0G3RqTYUnL9AOR0TKKNCCov/uFEKu2KcE62MXZjMeJwFHqb13XcnQbP9NH F/MyD8YVDCB7K+frcYVEx4gl2O3q09F/b+ZPNFofurzUZS2iDQ88/1+K3dgf/VI/PLz7 iHzmUInH0x0GdkdHNm91F6rCqXtH7nVokTtTvekG8BmC6MzVNX1ui/Okle3vOYJnWrH+ /1RFKCugh3a3MQcsgPN+Q90nh1JWdS68qVQICNGq4jZ6iP/s/taoRX6D4uqvE3S+XFPv DWIQ== 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=D1VJrUQknShqmnmzu8X8w1cJRuHx820LA67l/SpR/wI=; b=ZUMp3PvBcy//An/314dcFzERoJbUGlEHAR384E2lfKjrt2QJ8M3BtAXroz4s/FWVb5 Du9xYPK7AzyP7Mmc0sDlOjmBCS4NB8HeTeUjNycwmHRaJ1W64DgZgAvDLh8e2WNRrkkT yStC+kmIlBfIbDyqjxBS3d7EqGkxWsv3q8eNd7/+h+j+AXZQNScO+kjGGJoJUuvKfIYs KqKDrO3x9eCEMryu5b2A630LZx/dg42G+BxvPWp8LFOH0fWOwCL7F8E0cezDsShBEnf5 KpSwjNf144YNt0xmqRmhLc+PeD0iqyFPSGCuGpvag15vp+aD4k2uZzMs/PyNKhn1DmI/ jaBA== X-Gm-Message-State: AOAM5321PLyC18018pF5UVvecltQaOAe0Iu2cTmpBnZVRY/eoucM9SGG movwJlseLoIuM7anxNHG3ll76+SRGpdpPg== X-Received: by 2002:aa7:9552:: with SMTP id w18mr695754pfq.150.1597455134318; Fri, 14 Aug 2020 18:32:14 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id y196sm10625528pfc.202.2020.08.14.18.32.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2020 18:32:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 20/20] target/arm: Convert sq{, r}dmulh to gvec for aa64 advsimd Date: Fri, 14 Aug 2020 18:31:45 -0700 Message-Id: <20200815013145.539409-21-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::1041; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1041.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 | 10 ++++++++ target/arm/translate-a64.c | 33 ++++++++++++++++++-------- target/arm/vec_helper.c | 48 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 10 deletions(-) -- 2.25.1 Reviewed-by: Peter Maydell diff --git a/target/arm/helper.h b/target/arm/helper.h index 378bb1898b..3ca73a1764 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -776,6 +776,16 @@ DEF_HELPER_FLAGS_5(gvec_mls_idx_s, TCG_CALL_NO_RWG, DEF_HELPER_FLAGS_5(gvec_mls_idx_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(neon_sqdmulh_h, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(neon_sqdmulh_s, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) + +DEF_HELPER_FLAGS_5(neon_sqrdmulh_h, TCG_CALL_NO_RWG, + void, ptr, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_5(neon_sqrdmulh_s, 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 c74c6e854c..d4da12268c 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -697,6 +697,20 @@ static void gen_gvec_op3_fpst(DisasContext *s, bool is_q, int rd, int rn, tcg_temp_free_ptr(fpst); } +/* Expand a 3-operand + qc + operation using an out-of-line helper. */ +static void gen_gvec_op3_qc(DisasContext *s, bool is_q, int rd, int rn, + int rm, gen_helper_gvec_3_ptr *fn) +{ + TCGv_ptr qc_ptr = tcg_temp_new_ptr(); + + tcg_gen_addi_ptr(qc_ptr, cpu_env, offsetof(CPUARMState, vfp.qc)); + tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + vec_full_reg_offset(s, rm), qc_ptr, + is_q ? 16 : 8, vec_full_reg_size(s), 0, fn); + tcg_temp_free_ptr(qc_ptr); +} + /* Set ZF and NF based on a 64 bit result. This is alas fiddlier * than the 32 bit equivalent. */ @@ -11753,6 +11767,15 @@ static void disas_simd_3same_int(DisasContext *s, uint32_t insn) gen_gvec_fn3(s, is_q, rd, rn, rm, gen_gvec_mla, size); } return; + case 0x16: /* SQDMULH, SQRDMULH */ + { + static gen_helper_gvec_3_ptr * const fns[2][2] = { + { gen_helper_neon_sqdmulh_h, gen_helper_neon_sqrdmulh_h }, + { gen_helper_neon_sqdmulh_s, gen_helper_neon_sqrdmulh_s }, + }; + gen_gvec_op3_qc(s, is_q, rd, rn, rm, fns[size - 1][u]); + } + return; case 0x11: if (!u) { /* CMTST */ gen_gvec_fn3(s, is_q, rd, rn, rm, gen_gvec_cmtst, size); @@ -11864,16 +11887,6 @@ static void disas_simd_3same_int(DisasContext *s, uint32_t insn) genenvfn = fns[size][u]; break; } - case 0x16: /* SQDMULH, SQRDMULH */ - { - static NeonGenTwoOpEnvFn * const fns[2][2] = { - { gen_helper_neon_qdmulh_s16, gen_helper_neon_qrdmulh_s16 }, - { gen_helper_neon_qdmulh_s32, gen_helper_neon_qrdmulh_s32 }, - }; - assert(size == 1 || size == 2); - genenvfn = fns[size - 1][u]; - break; - } default: g_assert_not_reached(); } diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c index fb53684ce3..73d62c4e4f 100644 --- a/target/arm/vec_helper.c +++ b/target/arm/vec_helper.c @@ -109,6 +109,30 @@ void HELPER(gvec_qrdmlsh_s16)(void *vd, void *vn, void *vm, clear_tail(d, opr_sz, simd_maxsz(desc)); } +void HELPER(neon_sqdmulh_h)(void *vd, void *vn, void *vm, + void *vq, uint32_t desc) +{ + intptr_t i, opr_sz = simd_oprsz(desc); + int16_t *d = vd, *n = vn, *m = vm; + + for (i = 0; i < opr_sz / 2; ++i) { + d[i] = do_sqrdmlah_h(n[i], m[i], 0, false, false, vq); + } + clear_tail(d, opr_sz, simd_maxsz(desc)); +} + +void HELPER(neon_sqrdmulh_h)(void *vd, void *vn, void *vm, + void *vq, uint32_t desc) +{ + intptr_t i, opr_sz = simd_oprsz(desc); + int16_t *d = vd, *n = vn, *m = vm; + + for (i = 0; i < opr_sz / 2; ++i) { + d[i] = do_sqrdmlah_h(n[i], m[i], 0, false, true, vq); + } + clear_tail(d, opr_sz, simd_maxsz(desc)); +} + /* Signed saturating rounding doubling multiply-accumulate high half, 32-bit */ static int32_t do_sqrdmlah_s(int32_t src1, int32_t src2, int32_t src3, bool neg, bool round, uint32_t *sat) @@ -172,6 +196,30 @@ void HELPER(gvec_qrdmlsh_s32)(void *vd, void *vn, void *vm, clear_tail(d, opr_sz, simd_maxsz(desc)); } +void HELPER(neon_sqdmulh_s)(void *vd, void *vn, void *vm, + void *vq, uint32_t desc) +{ + intptr_t i, opr_sz = simd_oprsz(desc); + int32_t *d = vd, *n = vn, *m = vm; + + for (i = 0; i < opr_sz / 4; ++i) { + d[i] = do_sqrdmlah_s(n[i], m[i], 0, false, false, vq); + } + clear_tail(d, opr_sz, simd_maxsz(desc)); +} + +void HELPER(neon_sqrdmulh_s)(void *vd, void *vn, void *vm, + void *vq, uint32_t desc) +{ + intptr_t i, opr_sz = simd_oprsz(desc); + int32_t *d = vd, *n = vn, *m = vm; + + for (i = 0; i < opr_sz / 4; ++i) { + d[i] = do_sqrdmlah_s(n[i], m[i], 0, false, true, vq); + } + clear_tail(d, opr_sz, simd_maxsz(desc)); +} + /* Integer 8 and 16-bit dot-product. * * Note that for the loops herein, host endianness does not matter