Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jan 2018 09:00:17 -0800
From:      Conrad Meyer <cem@freebsd.org>
To:        David Chisnall <theraven@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r328159 - head/sys/modules
Message-ID:  <CAG6CVpV6Suft3v-=08f5UH6BTH2NEJgU_4kYd-UphLZ6yoJB4Q@mail.gmail.com>
In-Reply-To: <244014BB-C492-48A9-9F28-0A5E713DE5EB@FreeBSD.org>
References:  <201801190434.w0J4Y6i7086677@repo.freebsd.org> <CAJ5_RoAhGgkQTLXgHpYYOiupA=c6wK%2BpeAdT0Zjaw0n-ggAd1g@mail.gmail.com> <CAG6CVpVhLcY5ohnHW32raKic7MT5Q%2B7C9EA9dzwpQvbUXVH%2Big@mail.gmail.com> <CAJ5_RoDQqBkPoDh5RH452zswKTX34O5eYeimGUwBps50FHE3Hw@mail.gmail.com> <CAG6CVpWVstTHW2OkNTu9Yj7eZgcFNUvyZhB-P6EOB1gwLOcuBQ@mail.gmail.com> <244014BB-C492-48A9-9F28-0A5E713DE5EB@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 19, 2018 at 6:56 AM, David Chisnall <theraven@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpV6Suft3v-=08f5UH6BTH2NEJgU_4kYd-UphLZ6yoJB4Q>