Re: svn commit: r233684 - head/sys/x86/include

2012-03-30 Thread Bruce Evans
On Fri, 30 Mar 2012, Andrey Chernov wrote: On Thu, Mar 29, 2012 at 11:31:48PM +, Dimitry Andric wrote: However, the arguments are not properly masked, which results in the wrong value being calculated in some instances. For example, bswap32(0x12345678) returns 0x7c563412, and bswap64

Re: svn commit: r233684 - head/sys/x86/include

2012-03-30 Thread Andrey Chernov
On Fri, Mar 30, 2012 at 02:11:21PM +0200, Dimitry Andric wrote: > In case of the __bswapXX() macros, you can see that the argument to > __bswapXX_gen() is first explicitly cast to an unsigned type, for > example with __bswap32(): > > #define __bswap32(x)\ > (__builtin_

Re: svn commit: r233684 - head/sys/x86/include

2012-03-30 Thread Bruce Evans
On Thu, 29 Mar 2012, Dimitry Andric wrote: Log: Fix an issue introduced in sys/x86/include/endian.h with r232721. In that revision, the bswapXX_const() macros were renamed to bswapXX_gen(). Also, bswap64_gen() was implemented as two calls to bswap32(), and similarly, bswap32_gen() as two c

Re: svn commit: r233684 - head/sys/x86/include

2012-03-30 Thread Dimitry Andric
On 2012-03-30 10:25, Andrey Chernov wrote: On Thu, Mar 29, 2012 at 11:31:48PM +, Dimitry Andric wrote: However, the arguments are not properly masked, which results in the wrong value being calculated in some instances. For example, bswap32(0x12345678) returns 0x7c563412, and bswap

Re: svn commit: r233684 - head/sys/x86/include

2012-03-30 Thread Andrey Chernov
On Thu, Mar 29, 2012 at 11:31:48PM +, Dimitry Andric wrote: > However, the arguments are not properly masked, which results in the > wrong value being calculated in some instances. For example, > bswap32(0x12345678) returns 0x7c563412, and bswap64(0x123456789abcdef0) > returns 0xfcdefc