On 13 February 2012 02:29, Peter C. Wallace <p...@mesanet.com> wrote:
> http://stackoverflow.com/questions/7401888/why-doesnt-left-bit-shift-for-32-bit-integers-work-as-expected-when-used

This is more interesting than it seems. The actual problem is that the
original "1" should be a "1LL" as the bitmasks are 64 bits wide.
The reason this is interesting is that according to the linked
stackoverflow, the Intel hardware bitmasks bit shifts to 5 bits, so
that 32 = 0 and 33 = 1 shift position.

Shifts on 64 bit values must compile to more complex code?

This just moves my error to conf->datalength = 64 though, because it
fails there too:

http://codepad.org/m4GaXuCS

 i = 63: f1 = 7fffffffffffffff: f2 = 7fffffffffffffff
 i = 64: f1 = 0: f2 = ffffffffffffffff

This makes the mask generator look like:
& (0xFFFFFFFFFFFFFFFFull >> (64 - conf->DataLength))

Would this be a good use for a #define? It looks ugly, but is very
clear. I can't decide.

-- 
atp
The idea that there is no such thing as objective truth is, quite simply, wrong.

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to