From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 60C5D3857835 for ; Wed, 28 Apr 2021 09:06:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 60C5D3857835 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-379-Xgwj1K18Pgi0AUXQXp8bpg-1; Wed, 28 Apr 2021 05:06:08 -0400 X-MC-Unique: Xgwj1K18Pgi0AUXQXp8bpg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 213A4C7406; Wed, 28 Apr 2021 09:06:07 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-20.ams2.redhat.com [10.36.113.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6285A6B8DA; Wed, 28 Apr 2021 09:06:06 +0000 (UTC) From: Florian Weimer To: Paul Zimmermann Cc: libc-alpha@sourceware.org Subject: Re: use of fma References: <87sg3ake7i.fsf@oldenburg.str.redhat.com> Date: Wed, 28 Apr 2021 11:06:35 +0200 In-Reply-To: (Paul Zimmermann's message of "Wed, 28 Apr 2021 10:42:25 +0200") Message-ID: <8735vakcbo.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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, 28 Apr 2021 09:06:12 -0000 * Paul Zimmermann: >> This is already covered by the existing mechanisms for compiler flag >> changes. The problem is that not all x86 CPUs currently in production >> support FMA. We aren't even at the stage yet where we could discuss >> phasing out support for old CPUs. So building everything to require FMA >> by default would break things for users. >>=20 >> We already have some FMA-using function variants selected by IFUNC >> resolvers. Search for =E2=80=9Cifunc-fma=E2=80=9D in the source tree fo= r examples. >> More could be added if beneficial. >>=20 >> If you have FMA-capable hardware and want to build glibc to take >> advantage of it unconditionally (without IFUNCs), use GCC 11 and >> -march=3Dx86-64-v3. It should be compatible with all such CPUs, and the >> build will also use additional CPU features not present in the x86-64 >> baseline specification. > > thanks Florian. However this is quite technical and not easily accessible > to the average user. I understand that with default configure, the binary > produced should run on any x86_64. What I suggest is a configure option > which would take advantage of all nice features available on the processo= r > where we compile, with no guarantee whatsoever that it runs on any other > processor. In the above case the -march=3Dx86-64-v3 option would be added > by configure automatically. But there are inherent complexities here. We have some statically linked code in libc_nonshared.a that will be used even if an application is run on top of a glibc that was built with different compiler settings (e.g., -march=3Dnative on a different machine). So building with -march=3Dnative (or other -march=3D options) could have unexpected side effects, and the impact needs to be considered carefully. That's why I'm hesitant to offer configure-level support for this. Thanks, Florian