From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: The type of bitops Date: Tue, 07 May 2013 16:18:53 -0700 Message-ID: <51898BDD.90705@zytor.com> References: <51884263.4020608@zytor.com> <51898B87.9020005@mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51898B87.9020005@mit.edu> Sender: linux-kernel-owner@vger.kernel.org To: Andy Lutomirski Cc: Linus Torvalds , linux-arch , Linux Kernel Mailing List , Ingo Molnar , Thomas Gleixner List-Id: linux-arch.vger.kernel.org On 05/07/2013 04:17 PM, Andy Lutomirski wrote: > > The one and only time I tried to use this, I thought this was odd. Long > has a different size on 32 vs 64 bit architectures, and bit ops seem > like they'd want to be the same size everywhere so you can allocate the > appropriate number of bits. (Also, if you only want 32 bits, you have > to do some evil cheating, and I don't trust casting int* to long* on > big-endian architectures.) > > Would offering a u32* option make sense? > Honestly, the only thing that makes sense on bigendian architectures is either byte-by-byte elements or counting bit numbers from the MSB, but that is serious water under the bridge at this point... -hpa From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from terminus.zytor.com ([198.137.202.10]:33159 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752219Ab3EGXTG (ORCPT ); Tue, 7 May 2013 19:19:06 -0400 Message-ID: <51898BDD.90705@zytor.com> Date: Tue, 07 May 2013 16:18:53 -0700 From: "H. Peter Anvin" MIME-Version: 1.0 Subject: Re: The type of bitops References: <51884263.4020608@zytor.com> <51898B87.9020005@mit.edu> In-Reply-To: <51898B87.9020005@mit.edu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Andy Lutomirski Cc: Linus Torvalds , linux-arch , Linux Kernel Mailing List , Ingo Molnar , Thomas Gleixner Message-ID: <20130507231853.MMn5F0a0FcshEaIKutyeT8zYV0B_86wohFcqzp0qNU0@z> On 05/07/2013 04:17 PM, Andy Lutomirski wrote: > > The one and only time I tried to use this, I thought this was odd. Long > has a different size on 32 vs 64 bit architectures, and bit ops seem > like they'd want to be the same size everywhere so you can allocate the > appropriate number of bits. (Also, if you only want 32 bits, you have > to do some evil cheating, and I don't trust casting int* to long* on > big-endian architectures.) > > Would offering a u32* option make sense? > Honestly, the only thing that makes sense on bigendian architectures is either byte-by-byte elements or counting bit numbers from the MSB, but that is serious water under the bridge at this point... -hpa