Received: from eggs.gnu.org ([2001:4830:134:3::10]:60453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beJlC-0006X1-EV for qemu-devel@nongnu.org; Mon, 29 Aug 2016 06:25:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1beJl6-0002xV-FE for qemu-devel@nongnu.org; Mon, 29 Aug 2016 06:25:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1beJl6-0002xR-3q for qemu-devel@nongnu.org; Mon, 29 Aug 2016 06:25:40 -0400 References: <20160824204424.14041-1-bobby.prani@gmail.com> <20160824204424.14041-2-bobby.prani@gmail.com> From: Paolo Bonzini Message-ID: Date: Mon, 29 Aug 2016 12:25:34 +0200 MIME-Version: 1.0 In-Reply-To: <20160824204424.14041-2-bobby.prani@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] atomics: Use __atomic_*_n() variant primitives List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pranith Kumar , qemu-devel@nongnu.org, "Emilio G. Cota" , =?UTF-8?Q?Alex_Benn=c3=a9e?= , Peter Maydell , Richard Henderson On 24/08/2016 22:44, Pranith Kumar wrote: > Use the __atomic_*_n() primitives which take the value as argument. It > is not necessary to store the value locally before calling the > primitive, hence saving us a stack store and load. If you do this, you might as well do it for __atomic_load and __atomic_compare_exchange. However, you'd still need typeof_strip_qual for __atomic_compare_exchange's "_old" local variable. The question is, does this actually cause a change in generated code? I would be very surprised if it did, but then it's perfectly possible to have a bug in GCC. Paolo