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.129.124]) by sourceware.org (Postfix) with ESMTPS id 1EB2B3858C3A for ; Mon, 14 Nov 2022 09:13:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1EB2B3858C3A 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=1668417206; 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:in-reply-to:in-reply-to: references:references; bh=AlL6KMauOOmq++D3RTzdCKJ5Kcq7cqd1yjGoDPcbUB8=; b=Q3MnJ78L8D4/03eIMXHOxEijsmjl6TB7w4BwCo8jcFAjkWquHi32DbLalDvNB/Wnle5O3D ScyyZWZgOG6w6G2qlp+gUhwi+d5HoMWvA3te+bvZpxuTyvaN4Nr4H2b0zvyhqbXi3xOBwP zYj0Bgq449re1yOL86LrHGZy0De8j2Y= 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-665-2x1HLrYTNAKeKQXqdlUcxg-1; Mon, 14 Nov 2022 04:13:25 -0500 X-MC-Unique: 2x1HLrYTNAKeKQXqdlUcxg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2859B85A5A6; Mon, 14 Nov 2022 09:13:25 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB40840E80E4; Mon, 14 Nov 2022 09:13:24 +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 2AE9DKmo2823347 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 14 Nov 2022 10:13:20 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2AE9DJ262823346; Mon, 14 Nov 2022 10:13:19 +0100 Date: Mon, 14 Nov 2022 10:13:19 +0100 From: Jakub Jelinek To: Hongtao Liu Cc: Uros Bizjak , gcc-patches@gcc.gnu.org, Florian Weimer , "H.J. Lu" Subject: Re: [PATCH] i386: Emit 16b atomics inline with -m64 -mcx16 -mavx [PR104688] Message-ID: Reply-To: Jakub Jelinek References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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 Mon, Nov 14, 2022 at 05:04:24PM +0800, Hongtao Liu wrote: > On Mon, Nov 14, 2022 at 3:57 PM Uros Bizjak via Gcc-patches > wrote: > > > > On Mon, Nov 14, 2022 at 8:52 AM Jakub Jelinek wrote: > > > > > > Hi! > > > > > > Working virtually out of Baker Island. > > > > > > Given > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104688#c10 > > > the following patch implements atomic load/store (and therefore also > > > enabling compare and exchange) for -m64 -mcx16 -mavx. > > > > > > Ok for trunk if it passes bootstrap/regtest? > > > > We only have guarantee from Intel and AMD, there can be other vendors. > Can we make it a as a micro-architecture tuning? No, -mtune= isn't a guarantee the code will be executed only on certain CPUs (-march= is), -mtune= is only about optimizing code for certain CPU. If we don't get a guarantee from the remaining makers of CPUs with AVX + CX16 ISAs, another option would be to add a new -mvmovdqa-atomic option and set it on for -march= of Intel and AMD CPUs with AVX + CX16 and use TARGET_64BIT && TARGET_CMPXCHG16B && TARGET_AVX && TARGET_VMOVDQA_ATOMIC as the conditions in the patch. But that would use it only for -march=native or when people -march= a particular Intel or AMD CPU, while if we get a guarantee from all AVX+CX16 CPU makers, then it can be on by default with just -mcx16 -mavx. Jakub