Re: an inconsistency in generated code?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 15 Aug 2011, Pavel Tolkachev wrote:

I needed to write portable and
fast C/C++ function to bit-negate the most significant byte of a 32-bit
integer. Currently, my target is i386. First, I wrote this function:

uint32_t
BitNegMsb_1(uint32_t v)
{
  return (v & 0xFFFFFFu) | (~v &0xFF000000u);
}

Did you try with a xor?
return v^0xFF000000u;

--
Marc Glisse


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux