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

Rafael Espindola espindola at google.com
Wed Sep 15 13:57:13 PDT 2010


On 14 September 2010 17:18, Michael Spencer <bigcheesegs at gmail.com> wrote:
> The attached patch adds the SwapByteOrder function template to System.
> This patch is a
> prerequisite for the object file library I am writing.
>
> I want to replace the functions in MathExtras.h with SwapByteOrder
> because it is a generic implementation that makes it easier to write
> generic byte order independent code. This patch has no functionality
> changes.
>
> The optimized versions are platform dependent, and thus belong in System anyway.

Do you have an use for sizes other than 16, 32,and 64 or are you
adding support just in case? What happens if a signed integer is used,
we get the generic code? Maybe it is better if it failed to compile?

> - Michael Spencer
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>

Cheers,
-- 
Rafael Ávila de Espíndola




More information about the llvm-commits mailing list