From patchwork Fri May 26 11:09:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 99440 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp385300vqr; Fri, 26 May 2023 04:09:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ75Q109yLm3c8QQ7ADXsGxeY2rLUdcTTdBuFae/jgkBqi7NRxGh4b4pcw3PxmHz41TdQ754 X-Received: by 2002:a17:907:9620:b0:961:8fcd:53bc with SMTP id gb32-20020a170907962000b009618fcd53bcmr1736746ejc.21.1685099398441; Fri, 26 May 2023 04:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685099398; cv=none; d=google.com; s=arc-20160816; b=WCe2l3+CJQTozYhouMPNlPYRsuEmtXwMwtDsxywLiIt3dy6DdJX9mXECn0Z9L3jmXt kVAR+dgESK6MIkO2zZQd033P4KSDg4tDHEyzyfUPDRmu5oLaMm/CKoXpkjOgqgj9JzJ1 idR81DWOorBHZJ6vONwKIbJWW6qp7q7h7jh2En31TC0V/VE2Z/pHn7QjytDR5PRXlEIf cUO6JCHzJieNB3jm4Nq1GglG+BI2ZMc0FLQlloxqcLxGGMqm5uWU/xkm86UfL4tUJlVE 4yo7XO+pHvhbaeZ/va6zRAszqbgOoxmYIKdOpJmSh9ArPqvIpl3H5l88fGjoxF1W1n2c 54og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:organization:message-id:date :subject:to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=Z6dUI/okhUZkpQKKh6xtZsy2VSF8LfwLb/KalmjNa7I=; b=A1FZ9LSaiCL/F4iCw5jAHNJf5Vpghji0YJSEMICx0O0LsTChjftgP4X7Sd+EVN55zc clmLGjUwkPCjW65YkKq0nHdoieQML9gJsBlsOdpFaYyQTj+rC8rWUpI7s9kZ1Ld8pmOc HN3JyWH0/c2tEy+5IslHAhOjy9Fi0NJYSME8Tn7Ixa4AYrj5ATfkizTR42+VWSxqP3ak iHGuGiKKGw+RJiT7KEE4gteGjwTN0Ix0AnOb20uGIsgoh9gYKoyp6MUG8ZYMaPIg3lrQ L0bAu4W6a2BMi/dJ1tdNSL8FUS3KEaSFogQfdcUvIawuvvQBR8+kNvBp81wV3kmtoDj6 6kOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=IX2ui4Oa; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id oz32-20020a1709077da000b00973b8e7a2fdsi2346707ejc.113.2023.05.26.04.09.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 04:09:58 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=IX2ui4Oa; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A72B1385770A for ; Fri, 26 May 2023 11:09:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A72B1385770A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685099387; bh=Z6dUI/okhUZkpQKKh6xtZsy2VSF8LfwLb/KalmjNa7I=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=IX2ui4Oa5YCWECuVG43Zasyf70v463SbXQN9Pjc6dfGsRfRA99eE0zAcFm3U6SUsi 09dHKdBGXLzIhd+EjpEuIQ6Fdz5XO94LxLhwSBSdBUn9UfFsSZ1p+RBgwxICkuy0V1 lo12T8T9gzxc64DczTm+2RHoBbe63TASoVCJBgj4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id 01CEF3858D39; Fri, 26 May 2023 11:09:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 01CEF3858D39 Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id 2A7642051044; Fri, 26 May 2023 13:09:02 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sGV2L8Asq315; Fri, 26 May 2023 13:09:02 +0200 (CEST) Received: from srvEX6.campus.gsi.de (unknown [10.10.4.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id 02A802051040; Fri, 26 May 2023 13:09:02 +0200 (CEST) Received: from minbar.localnet (140.181.3.12) by srvEX6.campus.gsi.de (10.10.4.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 26 May 2023 13:09:01 +0200 To: , Subject: [PATCH] libstdc++: Simplify calculation of expected value in simd test Date: Fri, 26 May 2023 13:09:01 +0200 Message-ID: <10530000.NyiUUSuA9g@minbar> Organization: GSI Helmholtz Centre for Heavy Ion Research MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvEX8.Campus.gsi.de (10.10.4.160) To srvEX6.campus.gsi.de (10.10.4.96) X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Matthias Kretz via Gcc-patches From: Matthias Kretz Reply-To: Matthias Kretz Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766954786795036411?= X-GMAIL-MSGID: =?utf-8?q?1766954786795036411?= OK for master and all backports (after 11.4 is done)? tested on powerpc64le-linux-gnu ----------- 8< ------------ This avoids a failure on PR109964. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * testsuite/experimental/simd/tests/integer_operators.cc: Compute expected value differently to avoid getting turned into a vector shift. --- .../experimental/simd/tests/integer_operators.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) -- ────────────────────────────────────────────────────────────────────────── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Centre for Heavy Ion Research https://gsi.de stdₓ::simd ────────────────────────────────────────────────────────────────────────── diff --git a/libstdc++-v3/testsuite/experimental/simd/tests/integer_operators.cc b/libstdc++-v3/testsuite/experimental/simd/tests/integer_operators.cc index 7a2bc085e49..08ad49ca710 100644 --- a/libstdc++-v3/testsuite/experimental/simd/tests/integer_operators.cc +++ b/libstdc++-v3/testsuite/experimental/simd/tests/integer_operators.cc @@ -179,11 +179,10 @@ for (int s = 1; s < nbits; ++s) for (int j = 0; j < 100; ++j) { const V seq([&](auto i) -> T { return (j + i) % n_promo_bits; }); - COMPARE(V(1) >> seq, V([&](auto i) { return T(T(1) >> seq[i]); })) - << "seq = " << seq; - COMPARE(make_value_unknown(V(1)) >> make_value_unknown(seq), - V([&](auto i) { return T(T(1) >> seq[i]); })) - << "seq = " << seq; + const V expect([&](auto i) { return seq[i] == 0 ? T(1) : T(0); }); + COMPARE(V(1) >> seq, expect) << "\nseq = " << seq; + COMPARE(make_value_unknown(V(1)) >> make_value_unknown(seq), expect) + << "\nseq = " << seq; } for_constexpr([](auto shift_ic) { constexpr int shift = shift_ic;