From patchwork Thu Feb 23 08:49:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 60848 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp207207wrd; Thu, 23 Feb 2023 00:52:46 -0800 (PST) X-Google-Smtp-Source: AK7set9zzSoywuwBTq7l/X2j7FVXNqnp6WEkgBViIULuZSCY5GTCzJd5njJ43h4/UzRtRxzgxUX9 X-Received: by 2002:a17:906:7e06:b0:8aa:c2e1:6a64 with SMTP id e6-20020a1709067e0600b008aac2e16a64mr18143212ejr.61.1677142366117; Thu, 23 Feb 2023 00:52:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677142366; cv=none; d=google.com; s=arc-20160816; b=EpKRnj8aiXel4pQ14jor2HZKLP5xe4k8Gg9Fphn3Xg2XX6jRlbAujzoW6EpI+K7X7x wWWA5SCD0Adt1uueDhDgheZ/oe22OOoSDEiyCDgDGqTTnmgVoHNCTYgzXLmJOhhtWU2S y+lYuAW+gNkro/gAQXq2oROdBosCm70VwZ//6S6pn1F1v16RS0JbJ82SjCC8fOOeu/KV DwPVLPgSsQnQk2YkNKFTQahzxjcfPxywVV/Neis7Tbqz5cvTnAcxT0PJ7bJwgb5wiH5q LVq5KxoZrX9cIkjFLmXauqtN+y09qrie8LBXBymFgjI3eLZ26n1IKZCOQbgY7+iz5vfl hiGg== 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:references:in-reply-to :organization:message-id:date:subject:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=SoZSkurcE0bSRS6XqXqGJ6YyhRfsAuR3dsET3zG0zQA=; b=FElcDWNu3CrbWHKm45YbP7HA6PCkL8/6wlTBCokxYeKQ5K9bNn7595nwgbYvQrMJh2 Y4sA+gA4xUK+MxYdSEKIuB7wFWGLdXH85eSb4gIy1o4AHIiIB9mEL3xvGtD10JjkIYB2 liQ73szNUFqLy00vyqdDoqbxvCTv+N/X62RQcIixKBIvYrZnt9lmkJO7TwOb6FMn9Boy 6neOEeULtkTu1yfy5sXDk7WEO9ZhOoj4yD01iH+7pBxvtEdgoQS2hsmPwdAvKA6LHywQ 35ikvU5FIYAbyZ9UfEvG++zL/Et+QKXoWtRHBXRBFM6PwnFMQOmOCQNUk3t+kUyqlL8/ qrmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=H78uZy4K; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id eu22-20020a170907299600b008db6177cc3bsi7901638ejc.525.2023.02.23.00.52.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 00:52:46 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=H78uZy4K; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 DB0AD384D1BA for ; Thu, 23 Feb 2023 08:51:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB0AD384D1BA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677142303; bh=SoZSkurcE0bSRS6XqXqGJ6YyhRfsAuR3dsET3zG0zQA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=H78uZy4KNxqG9sen9MaxZSPivXhOEhw8caFcH+9PZiGd+B0f5iCybUzQJYshiE8Bz Bu++Vr8Lixgo7Hz1AsO/zuWZhWhotOirGry0VipDesw7qU/fHQZJsMBbOUaUyODSHr e0i2oiuF/nyphG+k9uxL2BiKTVEi0sY4FAptviW8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lxmtout2.gsi.de (lxmtout2.gsi.de [140.181.3.112]) by sourceware.org (Postfix) with ESMTPS id 022BB385B52B; Thu, 23 Feb 2023 08:50:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 022BB385B52B Received: from localhost (localhost [127.0.0.1]) by lxmtout2.gsi.de (Postfix) with ESMTP id DDD182027E52; Thu, 23 Feb 2023 09:50:51 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout2.gsi.de Received: from lxmtout2.gsi.de ([127.0.0.1]) by localhost (lxmtout2.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 4_JlvMXkCEoX; Thu, 23 Feb 2023 09:50:51 +0100 (CET) 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 lxmtout2.gsi.de (Postfix) with ESMTPS id C0AD22038F9E; Thu, 23 Feb 2023 09:50:51 +0100 (CET) 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.25; Thu, 23 Feb 2023 09:50:51 +0100 To: , Subject: [PATCH 4/8] libstdc++: Add missing constexpr on simd shift implementation Date: Thu, 23 Feb 2023 09:49:51 +0100 Message-ID: <2550642.Lt9SDvczpP@minbar> Organization: GSI Helmholtz Centre for Heavy Ion Research In-Reply-To: <2218250.iZASKD2KPV@minbar> References: <2218250.iZASKD2KPV@minbar> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvEX7.Campus.gsi.de (10.10.4.97) To srvEX6.campus.gsi.de (10.10.4.96) X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP 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?1758611233553396782?= X-GMAIL-MSGID: =?utf-8?q?1758611233553396782?= Resolves -Wtautological-compare warnings about `if (__builtin_is_constant_evaluated())` in the implementations of these functions. Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_x86.h (_S_bit_shift_left) (_S_bit_shift_right): Declare constexpr. The implementation was already expecting constexpr evaluation. --- libstdc++-v3/include/experimental/bits/simd_x86.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 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/include/experimental/bits/simd_x86.h b/libstdc++-v3/include/experimental/bits/simd_x86.h index 897a67829d1..8872ca301b9 100644 --- a/libstdc++-v3/include/experimental/bits/simd_x86.h +++ b/libstdc++-v3/include/experimental/bits/simd_x86.h @@ -1526,7 +1526,7 @@ _S_modulus(_SimdWrapper<_Tp, _Np> __x, _SimdWrapper<_Tp, _Np> __y) // values. #ifndef _GLIBCXX_SIMD_NO_SHIFT_OPT template > - inline _GLIBCXX_CONST static typename _TVT::type + constexpr inline _GLIBCXX_CONST static typename _TVT::type _S_bit_shift_left(_Tp __xx, int __y) { using _V = typename _TVT::type; @@ -1631,7 +1631,7 @@ unsigned( } template > - inline _GLIBCXX_CONST static typename _TVT::type + constexpr inline _GLIBCXX_CONST static typename _TVT::type _S_bit_shift_left(_Tp __xx, typename _TVT::type __y) { using _V = typename _TVT::type; @@ -1800,7 +1800,7 @@ _mm512_cvtepi16_epi8( // _S_bit_shift_right {{{ #ifndef _GLIBCXX_SIMD_NO_SHIFT_OPT template > - inline _GLIBCXX_CONST static typename _TVT::type + constexpr inline _GLIBCXX_CONST static typename _TVT::type _S_bit_shift_right(_Tp __xx, int __y) { using _V = typename _TVT::type; @@ -1850,7 +1850,7 @@ _S_bit_shift_right(_Tp __xx, int __y) } template > - inline _GLIBCXX_CONST static typename _TVT::type + constexpr inline _GLIBCXX_CONST static typename _TVT::type _S_bit_shift_right(_Tp __xx, typename _TVT::type __y) { using _V = typename _TVT::type;