Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1417161

Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly outputs

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly outputs
Date 2016-06-08 11:30 +0200
Message-ID <rHHYf-6M4-49@gated-at.bofh.it> (permalink)
References (3 earlier) <rHH29-6b9-5@gated-at.bofh.it> <rHHbQ-6et-11@gated-at.bofh.it> <rHHvc-6mU-17@gated-at.bofh.it> <rHHER-6Fd-5@gated-at.bofh.it> <rHHOy-6Iz-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* 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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 02/10] x86, asm: use bool for bitops and other assembly outputs "H. Peter Anvin" <hpa@linux.intel.com> - 2016-06-08 01:40 +0200
  [tip:x86/asm] x86, asm: use bool for bitops and other assembly  outputs "tip-bot for H. Peter Anvin" <tipbot@zytor.com> - 2016-06-08 01:50 +0200
  Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly  outputs Peter Zijlstra <peterz@infradead.org> - 2016-06-08 10:00 +0200
    Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly  outputs Ingo Molnar <mingo@kernel.org> - 2016-06-08 10:30 +0200
      Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly  outputs Ingo Molnar <mingo@kernel.org> - 2016-06-08 10:40 +0200
        Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly  outputs "H. Peter Anvin" <hpa@zytor.com> - 2016-06-08 11:00 +0200
          Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly  outputs Ingo Molnar <mingo@kernel.org> - 2016-06-08 11:10 +0200
            Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly  outputs "H. Peter Anvin" <hpa@zytor.com> - 2016-06-08 11:20 +0200
              Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly  outputs Ingo Molnar <mingo@kernel.org> - 2016-06-08 11:30 +0200
                Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly  outputs "H. Peter Anvin" <hpa@zytor.com> - 2016-06-08 11:40 +0200
                Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly  outputs Peter Zijlstra <peterz@infradead.org> - 2016-06-08 11:50 +0200
                Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly  outputs "H. Peter Anvin" <hpa@zytor.com> - 2016-06-08 11:50 +0200
                Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly  outputs "H. Peter Anvin" <hpa@zytor.com> - 2016-06-08 11:50 +0200
      Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly  outputs "H. Peter Anvin" <hpa@zytor.com> - 2016-06-08 11:00 +0200
        Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly  outputs Ingo Molnar <mingo@kernel.org> - 2016-06-08 11:10 +0200

csiph-web