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 D13FB389367F for ; Mon, 22 Feb 2021 10:40:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D13FB389367F 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-1-Zo2hUojvMYuHVukOXv4GEQ-1; Mon, 22 Feb 2021 05:39:59 -0500 X-MC-Unique: Zo2hUojvMYuHVukOXv4GEQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B23D110066F0; Mon, 22 Feb 2021 10:39:58 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-131.ams2.redhat.com [10.36.113.131]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A3C0A62A04; Mon, 22 Feb 2021 10:39:57 +0000 (UTC) From: Florian Weimer To: "H.J. Lu via Libc-alpha" Cc: "H.J. Lu" , Joseph Myers Subject: Re: [PATCH v3] x86: Disable x86-64 level marker [BZ #27318] References: <20210202215112.1002416-1-hjl.tools@gmail.com> <87k0rom825.fsf@oldenburg.str.redhat.com> <6586609.jJDZkT8p0M@farino> <87k0rk8968.fsf@oldenburg.str.redhat.com> <87pn1a1tvb.fsf@oldenburg.str.redhat.com> Date: Mon, 22 Feb 2021 11:40:38 +0100 In-Reply-To: (H. J. Lu via Libc-alpha's message of "Mon, 8 Feb 2021 16:29:35 -0800") Message-ID: <871rd875cp.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.4 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_H3, 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: Mon, 22 Feb 2021 10:40:04 -0000 * H. J. Lu via Libc-alpha: > +#if defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 \ > + || defined __LAHF_SAHF__ || defined __POPCNT__ || defined __SSE3__ \ > + || defined __SSSE3__ || defined __SSE4_1__ || defined __SSE4_2__ > +/* NB: Some ISAs in x86-64 ISA level v2 are used. */ > +# if defined __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 \ > + && defined __LAHF_SAHF__ && defined __POPCNT__ && defined __SSE3__ \ > + && defined __SSSE3__ && defined __SSE4_1__ && defined __SSE4_2__ > +/* NB: Enable x86-64 ISA level v2 marker only if all ISAs are enabled. */ > +# define ISA_V2 GNU_PROPERTY_X86_ISA_1_V2 > +# else > +/* NB: We can't use the lesser x86-64 ISA level marker since some v2 ISAs > + are used. */ > +# error "Missing ISAs for x86-64 ISA level v2" > +# endif > +#else > +# define ISA_V2 0 > +#endif > + > +#if defined __AVX__ || defined __AVX2__ || defined __F16C__ \ > + || defined __FMA__ || defined __LZCNT__ || defined __MOVBE__ > +/* NB: Some ISAs in x86-64 ISA level v3 are used. */ > +# if defined __AVX__ && defined __AVX2__ && defined __F16C__ \ > + && defined __FMA__ && defined __LZCNT__ && defined __MOVBE__ > +/* NB: Enable x86-64 ISA level v3 marker only if all ISAs are enabled. */ > +# define ISA_V3 GNU_PROPERTY_X86_ISA_1_V3 > +# else > +/* NB: We can't use the lesser x86-64 ISA level marker since some v3 ISAs > + are used. */ > +# error "Missing ISAs for x86-64 ISA level v3" > +# endif > +#else > +# define ISA_V3 0 > +#endif I think this will produce an #error for if there is a lone -mavx in addition to x86-64-v2 coverage in the compiler. The first block would define ISA_V2, but the second block produces the error. I assume that causes inclusion of the build note to be skipped. Is this really helpful? If glibc was built to run with on x86-64-v2 CPUs with some extra, wouldn't it still make sense to perform the x86-64-v2 diagnostic upon startup? Thanks, Florian