lkml.org 
[lkml]   [2013]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: The type of bitops
On Tue, May 7, 2013 at 4:18 PM, H. Peter Anvin <hpa@zytor.com> wrote:
> 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...

Sure... but would some important data structure that only need 32 bits
get shorter if there were 32-bit bitops?

--Andy


\
 
 \ /
  Last update: 2013-05-08 03:21    [W:0.025 / U:1.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site