From patchwork Thu Jun 2 21:47:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 578137 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp953222max; Thu, 2 Jun 2022 15:12:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNG4FE0Q9KztvZB9cMFJR8ncJAs0b+OJwGIKAhyoSaH2+08ldsdwAMh0PPEZlcrhRrPndY X-Received: by 2002:a37:a781:0:b0:6a6:9b4c:fc8d with SMTP id q123-20020a37a781000000b006a69b4cfc8dmr286958qke.657.1654207933861; Thu, 02 Jun 2022 15:12:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654207933; cv=none; d=google.com; s=arc-20160816; b=qMd2Ycp6LZ5O+jxP7vJ4wnGSBC+N0lF/igWyI7aAkNgty+jF0cw5ekK4Rbj2jyNQ4a JtsbU5WZutQn+8oDSjD9lyRiKJvZyAFP19V4Qxt7agt+6tOe4ORLX28FX2ESl7LciWBZ /KiSm9GjkQnIXgdEyfNTJJT1E4ZGDAXLcRdzzyG3CzTJCHC9mdOWwETnHT9FMipyWi+L DUIGa1yAgHqF7rnDtzZbU5d+OdZUQOjkqJLN096mfGXyLzgAj8m5TYDmGi0+UvYeIoBu FoXCaE3JNoQ5jiBy+P6DeBasBHrSWWp1GzAp3Bd7+jjP6IyoRfgyrL8veDZHmw+qIbhp Q7rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=lRGebQyqBWSguPRywmTvdJmhpPUXlvnLMmD10I0JmJc=; b=LGUYenMBw47oOYy3w5KZ60Aojkvs0O5O5nba4EgsuDAcKWGTLBAirZ1HSdEHlRnY64 TI1AQdQK41CcTvEhZUtK6MT3BlPCHVDMn8O5nFXO2tmhlJrcoyjj1ReULxfqggzzVFbP K1loIM6N/cRuh71pCC6ZblnAVSp5FVrcguReKQ9ioPVPzBQlzaUAKCxhxXmz3QC4FmNV Vf4c/aRBeMhz8kcxBmidbvqiwbIiiPFvgtWV02qtVBW9Gx+fsCjQ+FGCuZ4QBmXA6H1T f2b+eHepL1NeWGEaFTxRexkIqRqNUFOXJkIhIFEF3zyT96CE9wSH9w76+7ikCbIRdpro FNSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lXrwu39I; 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 y6-20020a05622a120600b00303cb18187csi2645858qtx.279.2022.06.02.15.12.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Jun 2022 15:12:13 -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=lXrwu39I; 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]:37562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwt37-0005FG-EY for patch@linaro.org; Thu, 02 Jun 2022 18:12:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwsgs-0004lL-I2 for qemu-devel@nongnu.org; Thu, 02 Jun 2022 17:49:15 -0400 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]:41489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nwsgo-00007w-NX for qemu-devel@nongnu.org; Thu, 02 Jun 2022 17:49:13 -0400 Received: by mail-pg1-x530.google.com with SMTP id e66so5779812pgc.8 for ; Thu, 02 Jun 2022 14:49:10 -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=lRGebQyqBWSguPRywmTvdJmhpPUXlvnLMmD10I0JmJc=; b=lXrwu39I4hZ8xZuBJ/xJTwzvbO4UwmhjQ9vsm3hMeSTwAjq+EqmXjZ8a63nkBt5tfC mdDrxLu4tYeH0tG+95j9ouedL7BAbzEmJw37MzLS4bwPlF7JtQsUApCGkDq+akCzpJOD JnzMoT51DP1J+zWt7gIHeKo+h2hxd0Ly3dnKltfs6KA7P+xe0d5DxCRsOpJZzhvlR65V r6Uz9MA7eHKI/rsIbfzSrsN3Y09oYcx4M8/QtVueg9VYILC0Tk8wgNkboR1oHjKSE6JQ ZiVc/w2L3eOPBEfbmv4qVoTKnVv/4MX5eCN1lJ2GyKWIktrzaQXCL7+MWdONQdpPDhvl tuQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lRGebQyqBWSguPRywmTvdJmhpPUXlvnLMmD10I0JmJc=; b=LtKwz+xjOIRgaKXZFIY9wuxyqesEHcF9uF+1PpYgftmnSg9kaWmdm74ytjTbaUtpd9 h4IAGXsNszL2fAmXzdSj0u9SN+2+niH/xJQbeoK2KIMtFmYMI5hMGyfNy/QW+WSP7KTn DvJdNn92haxU0dWoZrYYTPf3btSSzuzezlKj4t2Z1DcDLkvaTd2IZ8HV7hpJXBIEwXkJ TTlcq3JzV80IGq4YB8bK8S4nl+OvbHI1QmaLaZAUGEQ7UHCcW2CJ56MlYkE3bcuv+gGw 1tWG+neuy9gvAc8+XmnBW4Nno8GjyHPmxUG74njlgJjA3kRTm/IjDBdMVmInBwZNLe2W +EtQ== X-Gm-Message-State: AOAM531sZ526d/Bj7aar172bug1O5GFTHKedY7yRydABdlxxxPkCaP2B d7x2R31JoZ93Gy1Lzj9kkmxoz+XjuPywYA== X-Received: by 2002:a65:44c2:0:b0:3fa:8a91:1ae9 with SMTP id g2-20020a6544c2000000b003fa8a911ae9mr5966968pgs.412.1654206549415; Thu, 02 Jun 2022 14:49:09 -0700 (PDT) Received: from stoup.. (174-21-71-225.tukw.qwest.net. [174.21.71.225]) by smtp.gmail.com with ESMTPSA id bf7-20020a170902b90700b00163c6ac211fsm3988760plb.111.2022.06.02.14.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jun 2022 14:49:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH 17/71] target/arm: Move expand_pred_h to vec_internal.h Date: Thu, 2 Jun 2022 14:47:59 -0700 Message-Id: <20220602214853.496211-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220602214853.496211-1-richard.henderson@linaro.org> References: <20220602214853.496211-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.google.com 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Move the data to vec_helper.c and the inline to vec_internal.h. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/vec_internal.h | 7 +++++++ target/arm/sve_helper.c | 29 ----------------------------- target/arm/vec_helper.c | 26 ++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 29 deletions(-) diff --git a/target/arm/vec_internal.h b/target/arm/vec_internal.h index d1a1ea4a66..1d527fadac 100644 --- a/target/arm/vec_internal.h +++ b/target/arm/vec_internal.h @@ -59,6 +59,13 @@ static inline uint64_t expand_pred_b(uint8_t byte) return expand_pred_b_data[byte]; } +/* Similarly for half-word elements. */ +extern const uint64_t expand_pred_h_data[0x55 + 1]; +static inline uint64_t expand_pred_h(uint8_t byte) +{ + return expand_pred_h_data[byte & 0x55]; +} + static inline void clear_tail(void *vd, uintptr_t opr_sz, uintptr_t max_sz) { uint64_t *d = vd + opr_sz; diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c index e865c12527..1654c0bbf9 100644 --- a/target/arm/sve_helper.c +++ b/target/arm/sve_helper.c @@ -103,35 +103,6 @@ uint32_t HELPER(sve_predtest)(void *vd, void *vg, uint32_t words) return flags; } -/* Similarly for half-word elements. - * for (i = 0; i < 256; ++i) { - * unsigned long m = 0; - * if (i & 0xaa) { - * continue; - * } - * for (j = 0; j < 8; j += 2) { - * if ((i >> j) & 1) { - * m |= 0xfffful << (j << 3); - * } - * } - * printf("[0x%x] = 0x%016lx,\n", i, m); - * } - */ -static inline uint64_t expand_pred_h(uint8_t byte) -{ - static const uint64_t word[] = { - [0x01] = 0x000000000000ffff, [0x04] = 0x00000000ffff0000, - [0x05] = 0x00000000ffffffff, [0x10] = 0x0000ffff00000000, - [0x11] = 0x0000ffff0000ffff, [0x14] = 0x0000ffffffff0000, - [0x15] = 0x0000ffffffffffff, [0x40] = 0xffff000000000000, - [0x41] = 0xffff00000000ffff, [0x44] = 0xffff0000ffff0000, - [0x45] = 0xffff0000ffffffff, [0x50] = 0xffffffff00000000, - [0x51] = 0xffffffff0000ffff, [0x54] = 0xffffffffffff0000, - [0x55] = 0xffffffffffffffff, - }; - return word[byte & 0x55]; -} - /* Similarly for single word elements. */ static inline uint64_t expand_pred_s(uint8_t byte) { diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c index 17fb158362..26c373e522 100644 --- a/target/arm/vec_helper.c +++ b/target/arm/vec_helper.c @@ -127,6 +127,32 @@ const uint64_t expand_pred_b_data[256] = { 0xffffffffffffffff, }; +/* + * Similarly for half-word elements. + * for (i = 0; i < 256; ++i) { + * unsigned long m = 0; + * if (i & 0xaa) { + * continue; + * } + * for (j = 0; j < 8; j += 2) { + * if ((i >> j) & 1) { + * m |= 0xfffful << (j << 3); + * } + * } + * printf("[0x%x] = 0x%016lx,\n", i, m); + * } + */ +const uint64_t expand_pred_h_data[0x55 + 1] = { + [0x01] = 0x000000000000ffff, [0x04] = 0x00000000ffff0000, + [0x05] = 0x00000000ffffffff, [0x10] = 0x0000ffff00000000, + [0x11] = 0x0000ffff0000ffff, [0x14] = 0x0000ffffffff0000, + [0x15] = 0x0000ffffffffffff, [0x40] = 0xffff000000000000, + [0x41] = 0xffff00000000ffff, [0x44] = 0xffff0000ffff0000, + [0x45] = 0xffff0000ffffffff, [0x50] = 0xffffffff00000000, + [0x51] = 0xffffffff0000ffff, [0x54] = 0xffffffffffff0000, + [0x55] = 0xffffffffffffffff, +}; + /* Signed saturating rounding doubling multiply-accumulate high half, 8-bit */ int8_t do_sqrdmlah_b(int8_t src1, int8_t src2, int8_t src3, bool neg, bool round)