svn commit: r328159 - head/sys/modules

Conrad Meyer cem at freebsd.org
Fri Jan 19 17:24:59 UTC 2018


On Fri, Jan 19, 2018 at 6:56 AM, David Chisnall <theraven at freebsd.org> wrote:
> In C, a right-shift of a signed type propagates the sign bit.  Right shifting a negative 32-bit int by 16 and then again by 16 is not undefined behaviour (though doing the shift as a single operation is) and will give you a value of -1.

The left hand operand under discussion is unsigned.  In LLVM/assembler
terms, this is a logical right shift, not an arithmetic right shift.
It is by definition zero filled from the left.


More information about the svn-src-head mailing list