From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423308AbcFHJUs (ORCPT ); Wed, 8 Jun 2016 05:20:48 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33954 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161804AbcFHJUp (ORCPT ); Wed, 8 Jun 2016 05:20:45 -0400 Date: Wed, 8 Jun 2016 11:20:40 +0200 From: Ingo Molnar To: "H. Peter Anvin" Cc: Peter Zijlstra , "H. Peter Anvin" , Thomas Gleixner , Linux Kernel Mailing List , Andy Lutomirski , Borislav Petkov , Linus Torvalds , Arnd Bergmann Subject: Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly outputs Message-ID: <20160608092040.GA17389@gmail.com> References: <1465342269-492350-1-git-send-email-hpa@linux.intel.com> <1465342269-492350-3-git-send-email-hpa@linux.intel.com> <20160608074956.GO30154@twins.programming.kicks-ass.net> <20160608082835.GB9645@gmail.com> <20160608083340.GC9645@gmail.com> <02ee64ce-257a-ba93-1f49-6877f5e4f6db@zytor.com> <20160608090111.GA11390@gmail.com> <88387994-fbf1-83dd-d58d-343498776a11@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <88387994-fbf1-83dd-d58d-343498776a11@zytor.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * H. Peter Anvin wrote: > On 06/08/16 02:01, Ingo Molnar wrote: > > > > That's a divergence with an underlying reason - but not harmonizing the return > > code is an unforced error AFAICS and can be fixed. > > > > Perhaps. It is also no real question that "bool" is the right return > type for a single bit. Changing that in all architectures at one time > is a major undertaking, however, and it seems to me that it would be > better to leave that to the respective architecture maintainers. Yeah, so extrapolating from past performance in most cases that is really a shorthand for 'it will never happen' :-/ Also, unless I'm missing something it's not really 'hard' or dangerous per se to do that change for every architecture, just incredibly boring! ;-) I'm not sure how much it matters though, given other asymmetries in the bitops API signatures - does anyone have any preferences? > Perhaps I'm wrong, but I'd really like to avoid the upcasting to "int" > which isn't needed, because in my testing I find that it definitely > encourages gcc to generate poor code. Yeah, absolutely. I hate 'bool' with a vengence but if 'int' generates worse code with modern compilers then I'm not going to argue for worse code. Would a 'char' return type be very weird? Thanks, Ingo