From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756728AbbJHLsk (ORCPT ); Thu, 8 Oct 2015 07:48:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37901 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755252AbbJHLsh (ORCPT ); Thu, 8 Oct 2015 07:48:37 -0400 Message-ID: <56165812.6070101@redhat.com> Date: Thu, 08 Oct 2015 07:48:34 -0400 From: Prarit Bhargava User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "H. Peter Anvin" , Ingo Molnar CC: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , x86@kernel.org, Linus Torvalds , Andrew Morton , Peter Zijlstra Subject: Re: [PATCH] x86, bitops, variable_test_bit should return 1 not -1 on a match References: <1440004734-24290-1-git-send-email-prarit@redhat.com> <20150821065103.GA4541@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/21/2015 04:08 AM, H. Peter Anvin wrote: > Wrong fix, though. Instead we should change it to use the set instruction, which would also make it easier to use the CC_SET/CC_OUT proposed macros to use assembly out in the future. > > The downside with set is that it only sets a single byte, the upside is that it always outputs 0 or 1, and apparently if the output variable is your bool gcc can use that for optimization. > hpa, I didn't realize your comment was suggesting a change. I've done a google search on "gcc bool optimization" (and various incantations of that) and didn't find anything that lead me in the direction of making a change. Could you elaborate on what the issue is? Thanks, P.