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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id EAAE83858D35 for ; Fri, 9 Jun 2023 12:49:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EAAE83858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686314946; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H99W29bVOd2AnfzAV8dWEsPXTP7XtA2QCD6ilXy4FPM=; b=XCdIijZI/+jLsteDcuZRaCjy5ubqd22K7eCAaEawMn4EndN9M/oBWv1Rj0DDhVSES1fhmk pYF950LLv0FSDCHSwWo9O+rpqebEIHPytm98baHqjqB2axT5iarat4QTywKj71v9g3gn0a uHJ946W1nJ2XpIfJRiHE0P2u0KOJ5EI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-642-gR2eo7OKMS22i5YZQP_UKg-1; Fri, 09 Jun 2023 08:49:05 -0400 X-MC-Unique: gR2eo7OKMS22i5YZQP_UKg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 21B728037AD; Fri, 9 Jun 2023 12:49:05 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A6DEA10BDD; Fri, 9 Jun 2023 12:49:04 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 359Cn2pO153492 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 9 Jun 2023 14:49:02 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 359Cn1Is153491; Fri, 9 Jun 2023 14:49:01 +0200 Date: Fri, 9 Jun 2023 14:49:00 +0200 From: Jakub Jelinek To: Xi Ruoyao Cc: gcc-patches@gcc.gnu.org Subject: Re: Ping: [PATCH] libatomic: x86_64: Always try ifunc Message-ID: Reply-To: Jakub Jelinek References: <20230603112532.3264658-1-xry111@xry111.site> <58414744e2e6b43edb79f2da3eae8cf4c7afcaf7.camel@xry111.site> MIME-Version: 1.0 In-Reply-To: <58414744e2e6b43edb79f2da3eae8cf4c7afcaf7.camel@xry111.site> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Jun 09, 2023 at 08:37:20PM +0800, Xi Ruoyao wrote: > Ping (in hopes that someone can review before the weekend). > > On Sat, 2023-06-03 at 19:25 +0800, Xi Ruoyao wrote: > > We used to skip ifunc check when CX16 is available.  But now we use > > CX16+AVX+Intel/AMD for the "perfect" 16b load implementation, so CX16 > > alone is not a sufficient reason not to use ifunc (see PR104688). > > > > This causes a subtle and annoying issue: when GCC is built with a > > higher -march= setting in CFLAGS_FOR_TARGET, ifunc is disabled and > > the worst (locked) implementation of __atomic_load_16 is always used. > > > > There seems no good way to check if the CPU is Intel or AMD from > > the built-in macros (maybe we can check every known model like > > __skylake, > > __bdver2, ..., but it will be very error-prune and require an update > > whenever we add the support for a new x86 model).  The best thing we > > can > > do seems "always try ifunc" here. > > > > Bootstrapped and tested on x86_64-linux-gnu.  Ok for trunk? > > > > libatomic/ChangeLog: > > > >         * configure.tgt: For x86_64, always set try_ifunc=yes. Ok, thanks. Jakub