lkml.org 
[lkml]   [2016]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/10] x86, asm: use bool for bitops and other assembly outputs

* H. Peter Anvin <hpa@zytor.com> 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

\
 
 \ /
  Last update: 2016-06-08 11:41    [W:0.154 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site