[llvm-commits] [PATCH][System] Add SwapByteOrder and move implementation from Support/MathExtras.h.

Rafael Espindola espindola at google.com
Fri Oct 1 12:28:02 PDT 2010


> I added unittests to verify signed swaps work, and modified the
> implementation to error out if any type is used other than
> {signed,unsigned} {8,16,32,64}bit integer types.
>
> New patch attached.

Sorry for the ultra long delay.  My only comment on the implementation
now is that it might be a good idea to just remove ByteSwap_XX and use
sys::SwapByteOrder directly, but that can be done in another patch.

As for the test, I really like that you added it, but please don't use
random numbers :-)

Can you also add quick test that x = swap(swap(x)) even for signed x?

> - Michael Spencer
>

Thanks,
-- 
Rafael Ávila de Espíndola




More information about the llvm-commits mailing list