News for hackers. Stuff that matters.
Re:A Quiz About Integers in C by astrange on Tuesday June 05, 2012 @12:05AM (#4067272)
In fact the answer was 5 bits for 32bit and 7 bits for 64bit[1]. x86-64 uses 5 bits for 32bit and for 64bit (shld/shrd can't shift more than 31 bits).

7 bits is problematic because some code may assume that x << -y is an optimization for x << (32-y). I thought there was some architecture where this assumption didn't work on 32bit either, which led to my post above.

[1] http://pic.dhe.ibm.com/infocenter/aix/v7r1/topic/com.ibm.aix...

There are no comments on this comment yet.