From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mengyan1223.wang (mengyan1223.wang [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 0B0B23858D28 for ; Fri, 25 Feb 2022 14:16:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0B0B23858D28 Received: from [IPv6:240e:358:1147:5a00:dc73:854d:832e:4] (unknown [IPv6:240e:358:1147:5a00:dc73:854d:832e:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@mengyan1223.wang) by mengyan1223.wang (Postfix) with ESMTPSA id 09A54659CA; Fri, 25 Feb 2022 09:16:37 -0500 (EST) Message-ID: <390f2b837ced94bd325b3a0e9f272755a96e00ad.camel@mengyan1223.wang> Subject: Re: Libatomic 16B From: Xi Ruoyao To: Alexander Monakov , Florian Weimer Cc: Xi Ruoyao via Gcc-help Date: Fri, 25 Feb 2022 22:16:28 +0800 In-Reply-To: References: <6349834d9ea31f579b04ba9215b6449ce13f008e.camel@mengyan1223.wang> <1bb8ab09556727917d07ec31683996bb7e493fa6.camel@mengyan1223.wang> <20220224201334.GQ614@gate.crashing.org> <37e3b73aba3fd6dd6c109d0a06680af3577c4b41.camel@mengyan1223.wang> <874k4nvye3.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3031.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, JMQ_SPF_NEUTRAL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Feb 2022 14:16:43 -0000 On Fri, 2022-02-25 at 17:10 +0300, Alexander Monakov via Gcc-help wrote: > > > https://cdrdv2.intel.com/v1/dl/getContent/671294 TL;DR: Intel says on their CPUs with AVX, 128-bit loads (with movdqa) are atomic, see page 393 of this doc. And this is updated in Dec 2021, so you may need to re-download the Intel SDM to get a latest copy. > > > Create an issue in bugzilla then? > > > > Yes please.  I should have read the whole thread first. 8-) > > > > The AMD manual doesn't say this yet, so any optimization needs to be > > restricted to Intel CPUs for now.  I'll reach out to AMD to get > > clarification. > > This StackOverflow question has evidence that both Intel (Core Duo) > and > AMD (Opteron 2435) can tear 128-bit loads. Core Duo does not have AVX, and AMD has not make any guarantee for the atomicity of 128-bit load. So we can't use movdqa for 128-bit atomics on those old Intel and (old or new) AMD models. > So neither manufacturer can > give a retroactive guarantee. > > https://stackoverflow.com/questions/7646018/sse-instructions-which-cpus-can-do-atomic-16b-memory-operations > > Alexander -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University