[llvm-commits] [PATCH][System] Add SwapByteOrder and move implementation from Support/MathExtras.h.
Michael Spencer
bigcheesegs at gmail.com
Wed Sep 15 15:02:47 PDT 2010
On Wed, Sep 15, 2010 at 4:57 PM, Rafael Espindola <espindola at google.com> wrote:
> 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?
The generic code is actually being used for both COFF and ELF with
signed types, but it hasn't been tested because I've only tried out
x86{,-64} so far (and thus this function isn't called). If someone
could send me a small bigendian ELF file I could add a test for it and
make sure everything works.
Thanks for the review!
- Michael Spencer
>> - 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