From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aswLw-0002T2-Bu for qemu-devel@nongnu.org; Wed, 20 Apr 2016 13:55:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aswLt-0000k1-5r for qemu-devel@nongnu.org; Wed, 20 Apr 2016 13:55:52 -0400 Received: from mail-qk0-x229.google.com ([2607:f8b0:400d:c09::229]:34356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aswLs-0000jx-VW for qemu-devel@nongnu.org; Wed, 20 Apr 2016 13:55:49 -0400 Received: by mail-qk0-x229.google.com with SMTP id r184so16870374qkc.1 for ; Wed, 20 Apr 2016 10:55:48 -0700 (PDT) Sender: Richard Henderson References: <1461107270-19234-1-git-send-email-cota@braap.org> <1461107270-19234-6-git-send-email-cota@braap.org> <57179DE0.5080701@twiddle.net> <20160420171734.GA1124@flamenco> From: Richard Henderson Message-ID: <5717C2A1.9010805@twiddle.net> Date: Wed, 20 Apr 2016 10:55:45 -0700 MIME-Version: 1.0 In-Reply-To: <20160420171734.GA1124@flamenco> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 05/11] qemu-thread: add simple test-and-set spinlock List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Emilio G. Cota" Cc: QEMU Developers , MTTCG Devel , =?UTF-8?Q?Alex_Benn=c3=a9e?= , Paolo Bonzini , Peter Crosthwaite , Peter Maydell , Sergey Fedorov On 04/20/2016 10:17 AM, Emilio G. Cota wrote: > I've tried to find a GCC intrinsic for test-and-set, and I've only found > lock_test_and_set, which is what we use for atomic_xchg (except on ppc) > because it really is an atomic exchange: > "This builtin, as described by Intel, is not a traditional test-and-set > operation, but rather an atomic exchange operation." > https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html Please read the entire documentation, not just the first sentence. r~