From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id A94263854801 for ; Wed, 31 Mar 2021 14:23:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A94263854801 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fw@deneb.enyo.de Received: from [172.17.203.2] (port=42735 helo=deneb.enyo.de) by albireo.enyo.de ([172.17.140.2]) with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1lRbl2-00034r-93; Wed, 31 Mar 2021 14:23:44 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1lRbl2-0006v3-2k; Wed, 31 Mar 2021 16:23:44 +0200 From: Florian Weimer To: Stefan Liebler via Libc-alpha Cc: Stefan Liebler Subject: Re: [PATCH v2] S390: Allow "v" constraint for long double math_opt_barrier and math_force_eval with GCC 11. References: <20210331141701.1339437-1-stli@linux.ibm.com> Date: Wed, 31 Mar 2021 16:23:44 +0200 In-Reply-To: <20210331141701.1339437-1-stli@linux.ibm.com> (Stefan Liebler via Libc-alpha's message of "Wed, 31 Mar 2021 16:17:01 +0200") Message-ID: <87czvfqu4v.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2021 14:23:47 -0000 * Stefan Liebler via Libc-alpha: > Starting with GCC 11, long double values can also be processed in vector > registers if build with -march >= z14. Then GCC defines the > __LONG_DOUBLE_VX__ macro. > > FYI: GCC commit "IBM Z: Introduce __LONG_DOUBLE_VX__ macro" > https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=f47df2af313d2ce7f9149149010a142c2237beda > --- > sysdeps/s390/fpu/math-barriers.h | 21 +++++++++++++++++++-- > 1 file changed, 19 insertions(+), 2 deletions(-) > > diff --git a/sysdeps/s390/fpu/math-barriers.h b/sysdeps/s390/fpu/math-barriers.h > index 68a3e55098..13fd30017f 100644 > --- a/sysdeps/s390/fpu/math-barriers.h > +++ b/sysdeps/s390/fpu/math-barriers.h > @@ -21,13 +21,26 @@ > > #ifdef HAVE_S390_VX_GCC_SUPPORT > # define ASM_CONSTRAINT_VR "v" > +# ifdef __LONG_DOUBLE_VX__ > +/* Starting with gcc 11, long double values can also be processed in vector > + registers if build with -march >= z14. Then GCC defines the > + __LONG_DOUBLE_VX__ macro. */ > +# define ASM_LONG_DOUBLE_IN_VR 1 > +# else > +# define ASM_LONG_DOUBLE_IN_VR 0 > +# endif > #else > # define ASM_CONSTRAINT_VR > +# define ASM_LONG_DOUBLE_IN_VR 0 > #endif > > #define math_opt_barrier(x) \ > ({ __typeof (x) __x = (x); \ > - if (__builtin_types_compatible_p (__typeof (x), _Float128)) \ > + if (! ASM_LONG_DOUBLE_IN_VR \ > + && (__builtin_types_compatible_p (__typeof (x), _Float128) \ > + || __builtin_types_compatible_p (__typeof (x), long double) \ > + ) \ > + ) \ > __asm__ ("# math_opt_barrier_f128 %0" : "+fm" (__x)); \ > else \ > __asm__ ("# math_opt_barrier %0" \ > @@ -35,7 +48,11 @@ > __x; }) > #define math_force_eval(x) \ > ({ __typeof (x) __x = (x); \ > - if (__builtin_types_compatible_p (__typeof (x), _Float128)) \ > + if (! ASM_LONG_DOUBLE_IN_VR \ > + && (__builtin_types_compatible_p (__typeof (x), _Float128) \ > + || __builtin_types_compatible_p (__typeof (x), long double) \ > + ) \ > + ) \ > __asm__ __volatile__ ("# math_force_eval_f128 %0" \ > : : "fm" (__x)); \ > else \ This version looks good to me, thanks.