Re: How to clear compile error when using rdrand64_step due to typedef'ing a 64-bit type?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> $ cat test.cc
>> #include <x86intrin.h>
>>
>> #if _LP64 || __LP64__
>> typedef unsigned long my_u64;
>> #else
>> typedef unsigned long long my_u64;
>> #endif
>
> The definition doesn't depend on ILP32 or LP64:
>
> ../gcc/config/i386/immintrin.h:_rdrand64_step (unsigned long long *__P)
>
> Looks like you want unsigned long long for Intel. If that doesn't work
> for Neon then use the preprocessor to check for that, not for LP64.

Thanks.

Forgive my ignorance... 'unsigned long' is 64 bits, which is what that
interface needs (if I am reading the docs correctly). It looks like
'unsigned long long' is 64-bits too (other wise, GCC would not be
using it).

Is it safe to cast a pointer of type 'unsigned long' to a pointer of
'unsigned long long' when using this particular function? Does UL and
ULL provide the same alignment guarantees?

Jeff



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux