[llvm-dev] Endianness for multi-word types

Tim Shen via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 1 16:39:40 PST 2015


On Tue, Dec 1, 2015 at 3:20 PM Hal Finkel <hfinkel at anl.gov> wrote:

> No; and how does this even help? As was pointed out, there are actually
> two sign bits to flip.
>

Sorry, I should have read the "Extended precision" format. It turns out
(bitcast (fabs x)) should translate to something like (pseudo code):

i128 x;
populate x...
u64 hi_signbit_mask = 0x8000000000000000;
x.lo ^= x.hi & hi_signbit_mask;
x.hi &= ~hi_signbit_mask;
return x;

...and (bitcast (fneg x)) should translate to (xor (bitcast x)
0x80000000000000008000000000000000).

These are quite different from the current generic combiners and probably
deserve separate code.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151202/2c2909c7/attachment.html>


More information about the llvm-dev mailing list