https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57157
Jeffrey Walton <noloader at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |noloader at gmail dot com --- Comment #6 from Jeffrey Walton <noloader at gmail dot com> --- (In reply to Jakub Jelinek from comment #4) > Created attachment 30075 [details] > /tmp/gcc49-pr57157.patch > > Untested tiny i386 improvement, instead of roll $31, %eax we can emit > rorl %eax which is shorter. Forgive my ignorance... Why not put the shift amount in %ecx, %cx or %cl? The x86 processor will only use the low-order 5-bits (low order 6-bits for x86_64). That means you get the mask for free. With a free mask, you don't even have to worry about the ranges in C/C++ or the assembler's "I" or "J" constraints.