From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id EA7EB3857346; Thu, 28 Apr 2022 13:05:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EA7EB3857346 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 23SD37HD001232; Thu, 28 Apr 2022 08:03:07 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 23SD36su001231; Thu, 28 Apr 2022 08:03:06 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 28 Apr 2022 08:03:06 -0500 From: Segher Boessenkool To: Alexandre Oliva Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org, David Edelsohn Subject: Re: [PATCH] libstdc++: ppc: conditionalize vsx-only simd intrinsics Message-ID: <20220428130306.GS25951@gate.crashing.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2022 13:05:13 -0000 Hi! On Thu, Apr 28, 2022 at 03:09:54AM -0300, Alexandre Oliva wrote: > libstdc++'s bits/simd.h section for PPC (Altivec) defines various > intrinsic vector types that are only available along with VSX: 64-bit > long double, double, (un)signed long long, and 64-bit (un)signed long. > > experimental/simd/standard_abi_usable{,_2}.cc tests error out reporting > the unmet requirements when the target cpu doesn't enable VSX. Make the > reported instrinsic types conditional on VSX so that > can be used on ppc variants that do not have VSX support. > * include/experimental/bits/simd.h [__ALTIVEC__]: Require VSX > for double, long long, and 64-bit long and 64-bit long double > intrinsic types. > --- a/libstdc++-v3/include/experimental/bits/simd.h > +++ b/libstdc++-v3/include/experimental/bits/simd.h > @@ -2430,17 +2430,23 @@ template > template <> \ > struct __intrinsic_type_impl<_Tp> { using type = __vector _Tp; } > _GLIBCXX_SIMD_PPC_INTRIN(float); > +# ifdef __VSX__ No space after # (here and everywhere else). > #ifndef __VSX__ > - static_assert(!is_same_v<_Tp, double>, > - "no __intrinsic_type support for double on PPC w/o VSX"); > + static_assert(!(is_same_v<_Tp, double> > + || (_S_is_ldouble && sizeof(long double) == sizeof(double))), > + "no __intrinsic_type support for [long] double on PPC w/o VSX"); > #endif This change isn't in the changelog. The message should not say "long double" without qualifying it as "64-bit long double". It is probably best to just keep the message as-is, the other possibilities for long double aren't supported either, not even with VSX, and all this becomes much too complicated to put in a simple error message. It confuses the poor user, as well. Alternatively you can make it two separate error messages, one for double, one for 64-bit long double. Okay for trunk without this part of the patch, and the spaces after the hash signs deleted. Or send a new patch with the "[long] double" thing fixed? Thanks! Segher