From patchwork Wed Feb 15 20:50:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthias Kretz X-Patchwork-Id: 57721 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp411346wrn; Wed, 15 Feb 2023 12:52:40 -0800 (PST) X-Google-Smtp-Source: AK7set82kGfDxGFg6OkM+te5QojuHWVVc1scKSb1ONzKdngLpJs0ZXSaGNzWIV8B4WwrAhUMsKIx X-Received: by 2002:a17:906:4acb:b0:889:5ca0:146e with SMTP id u11-20020a1709064acb00b008895ca0146emr3810864ejt.16.1676494360396; Wed, 15 Feb 2023 12:52:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676494360; cv=none; d=google.com; s=arc-20160816; b=bozaRMP89jZGRW6b/WhL/LijREdKnEHctRZlZXFII8CZlEN6dQm5KvNbTQaCJdZxTb R03BecxmfhsygFmqVRkr5dD3PfhZk5mq8xSrW1f/26BpE9cQ2geqouFxmyt2X1mPiuO5 9gcg622cIddR4zBEzT3kbql8oPXnVyhIT6Dj1XuUBgkg+9k+hkhdU4sueONmtutMNubs +pLWzDW9NCU1DHj3J5ZFRD6mob+HTnoleVRHhFNXuYw+OFYZIBydU0w/deJw+gmm+mny pG01HEBLCv7o+CjVD+6hFlBGa9zZXWjtG2nwiBzF9dtkgPwbXqpoH3lCx1uOC9Vj6Wvh hi1g== 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=YmvGXuxNH4WYfSY4GgDQkl79cFoGV8RuGzSqQlQwNqQ=; b=wag4tiydCfeN06smxGwTPb732h+f5ABTQrsZ+jVjczAylwRM+k7CF7j7K6ALKd9Ukt cABPKK5gIZi0MowJZ5rSYtLcBC8dwO0MuMDTl9KRakrSoaOqelwfwa9k4sMMGNBHrZiU stbRaPjldm6O0QaN9WPYJ4KH5WWV2lDveIcoHn4pzVugW+5mzULGvXvUHt54wGYp/AE8 L2a2Je/vQo2IUuE6TXXaf2d8nvDR82mfRA1/AiccRChpRiSZg6M2Hx0IQnwgegXYTvJO 26Et74PHJlt78BUZw1aJbBTvoM3hX09MKCiTrjURollKYZkh2WtxXkngCIuAa9zOQxKf 9mhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=R4ZOFTki; 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 mr40-20020a17090782a800b008b149d060d0si2219796ejc.12.2023.02.15.12.52.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 12:52:40 -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=R4ZOFTki; 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 CCB7D3858434 for ; Wed, 15 Feb 2023 20:51:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CCB7D3858434 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676494262; bh=YmvGXuxNH4WYfSY4GgDQkl79cFoGV8RuGzSqQlQwNqQ=; 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=R4ZOFTki52nHBUUQAJvHk1tveHaDoa+pQLesXYmqAL347Wf+D8ryQAOymqNsKUrVg HsgKuk09bMTweCBliPWWEKY+AA1tKx9LYNZCq7DIgb5SNkJyRP625+w+V9lxHnBXBm GdzDJss45IskKU9kyxfHex1t3aFma8aM4XIerBMg= 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 4183A384F035; Wed, 15 Feb 2023 20:50:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4183A384F035 Received: from localhost (localhost [127.0.0.1]) by lxmtout2.gsi.de (Postfix) with ESMTP id 6A917202AD5E; Wed, 15 Feb 2023 21:50:12 +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 b636al7Edxgt; Wed, 15 Feb 2023 21:50:12 +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 4FE47202AD51; Wed, 15 Feb 2023 21:50:12 +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.21; Wed, 15 Feb 2023 21:50:12 +0100 To: , Subject: [PATCH 7/7] libstdc++: Fix incorrect function call in -ffast-math optimization Date: Wed, 15 Feb 2023 21:50:11 +0100 Message-ID: <111787281.nniJfEyVGO@minbar> Organization: GSI Helmholtz Centre for Heavy Ion Research In-Reply-To: <3238840.44csPzL39Z@minbar> References: <3238840.44csPzL39Z@minbar> MIME-Version: 1.0 X-Originating-IP: [140.181.3.12] X-ClientProxiedBy: srvex5.Campus.gsi.de (10.10.4.95) To srvEX6.campus.gsi.de (10.10.4.96) X-Spam-Status: No, score=-10.0 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?1757931750429010333?= X-GMAIL-MSGID: =?utf-8?q?1757931750429010333?= Signed-off-by: Matthias Kretz libstdc++-v3/ChangeLog: * include/experimental/bits/simd_math.h (__hypot): Bitcasting between scalars requires the __bit_cast helper function instead of simd_bit_cast. --- libstdc++-v3/include/experimental/bits/simd_math.h | 4 ++-- 1 file changed, 2 insertions(+), 2 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_math.h b/libstdc++-v3/include/experimental/bits/simd_math.h index c20315e4e30..c91f05fceb3 100644 --- a/libstdc++-v3/include/experimental/bits/simd_math.h +++ b/libstdc++-v3/include/experimental/bits/simd_math.h @@ -1010,7 +1010,7 @@ template using _IV = rebind_simd_t<_Ip, _V>; const auto __as_int = simd_bit_cast<_IV>(__hi_exp); const _V __scale - = simd_bit_cast<_V>(2 * simd_bit_cast<_Ip>(_Tp(1)) - __as_int); + = simd_bit_cast<_V>(2 * __bit_cast<_Ip>(_Tp(1)) - __as_int); #else const _V __scale = (__hi_exp ^ __inf) * _Tp(.5); #endif @@ -1181,7 +1181,7 @@ _GLIBCXX_SIMD_CVTING2(hypot) using _IV = rebind_simd_t<_Ip, _V>; const auto __as_int = simd_bit_cast<_IV>(__hi_exp); const _V __scale - = simd_bit_cast<_V>(2 * simd_bit_cast<_Ip>(_Tp(1)) - __as_int); + = simd_bit_cast<_V>(2 * __bit_cast<_Ip>(_Tp(1)) - __as_int); #else const _V __scale = (__hi_exp ^ __inf) * _Tp(.5); #endif