[llvm-commits] [llvm-gcc-4.2] r46039 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Bill Wendling
isanbard at gmail.com
Tue Jan 15 23:27:20 PST 2008
Hi Anton,
>> + if (BigEndian == FLOAT_WORDS_BIG_ENDIAN) {
>> + UArr[0] = RealArr[0]; // Long -> int convert
>> + UArr[1] = RealArr[1];
>> + } else {
>> + UArr[0] = RealArr[1]; // Long -> int convert
>> + UArr[1] = RealArr[0];
>> + }
>> +
> Why don't do just something like this:
> UArr[0] = RealArr[0]; // Long -> int convert
> UArr[1] = RealArr[1];
>
> if (BigEndian == FLOAT_WORDS_BIG_ENDIAN)
> std::swap(UArr[0], UArr[1]);
>
> This looks to me pretty much readable.
Either way is fine. You're correct that your way is a bit more
readable. Done.
-bw
More information about the llvm-commits
mailing list