From patchwork Fri Jan 14 12:40:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 50025 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9E3EC3836005 for ; Fri, 14 Jan 2022 12:41:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E3EC3836005 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1642164080; bh=XpIXDzrb4doItTwS2ua7286YWcSahD/LO3Q9Ku/d78o=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=FM1p6E6tAvtWB0gJNeqlFCHVQuTKH8uX1s+jk9pC0KXTQK8SEpqAVy6itGG57iE3T JQUIvCo0Fqt6rAXbVBK/1r/X5DZePytTm+KL4AoS1k8P444XJSSV84AkZVXfIcMkfj G3DDTZQ4ZHG0uHyr6Lt8QFNGg73afKleqfI3j/+A= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id D3F883858C39 for ; Fri, 14 Jan 2022 12:40:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D3F883858C39 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-370-aXoIK0jONZKQe3FkTSuKxg-1; Fri, 14 Jan 2022 07:40:18 -0500 X-MC-Unique: aXoIK0jONZKQe3FkTSuKxg-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 88D16100C660; Fri, 14 Jan 2022 12:40:17 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B72EE72436; Fri, 14 Jan 2022 12:40:16 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 1/7] x86: HAVE_X86_LAHF_SAHF, HAVE_X86_MOVBE and -march=x86-64-vN (bug 28782) In-Reply-To: References: X-From-Line: 01dee4fcc3539959c720b1cc09193f80a5c2ba62 Mon Sep 17 00:00:00 2001 Message-Id: <01dee4fcc3539959c720b1cc09193f80a5c2ba62.1642162312.git.fweimer@redhat.com> Date: Fri, 14 Jan 2022 13:40:14 +0100 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.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" HAVE_X86_LAHF_SAHF is implied by x86-64-v2, and HAVE_X86_MOVBE by x86-64-v3. The individual flag does not appear in -fverbose-asm flag output even if the ISA level implies it. Reviewed-by: H.J. Lu --- sysdeps/x86/configure | 4 ++-- sysdeps/x86/configure.ac | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sysdeps/x86/configure b/sysdeps/x86/configure index 62676bb686..7bdbfdc6dc 100644 --- a/sysdeps/x86/configure +++ b/sysdeps/x86/configure @@ -155,7 +155,7 @@ else (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } | grep -q "\-msahf"; then + test $ac_status = 0; }; } | grep -qE '(-msahf\b|-march=x86-64-v)'; then libc_cv_have_x86_lahf_sahf=yes fi fi @@ -176,7 +176,7 @@ else (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } | grep -q "\-mmovbe"; then + test $ac_status = 0; }; } | grep -qE '(-mmovbe\b|-march=x86-64-v([3-9]|[1-9][0-9]))'; then libc_cv_have_x86_movbe=yes fi fi diff --git a/sysdeps/x86/configure.ac b/sysdeps/x86/configure.ac index 04a12ab680..10d5c2e0e5 100644 --- a/sysdeps/x86/configure.ac +++ b/sysdeps/x86/configure.ac @@ -110,7 +110,7 @@ if test $libc_cv_include_x86_isa_level = yes; then AC_CACHE_CHECK([for LAHF/SAHF instruction support], libc_cv_have_x86_lahf_sahf, [dnl libc_cv_have_x86_lahf_sahf=no - if AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -fverbose-asm -S -o - -x c /dev/null) | grep -q "\-msahf"; then + if AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -fverbose-asm -S -o - -x c /dev/null) | grep -qE '(-msahf\b|-march=x86-64-v)'; then libc_cv_have_x86_lahf_sahf=yes fi]) if test $libc_cv_have_x86_lahf_sahf = yes; then @@ -119,7 +119,7 @@ if test $libc_cv_include_x86_isa_level = yes; then AC_CACHE_CHECK([for MOVBE instruction support], libc_cv_have_x86_movbe, [dnl libc_cv_have_x86_movbe=no - if AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -fverbose-asm -S -o - -x c /dev/null) | grep -q "\-mmovbe"; then + if AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -fverbose-asm -S -o - -x c /dev/null) | grep -qE '(-mmovbe\b|-march=x86-64-v(@<:@3-9@:>@|@<:@1-9@:>@@<:@0-9@:>@))'; then libc_cv_have_x86_movbe=yes fi]) if test $libc_cv_have_x86_movbe = yes; then