OSDN Git Service

[Sparc] Fix double-float fabs and fneg on little endian CPUs.
authorJames Y Knight <jyknight@google.com>
Mon, 25 Apr 2016 22:54:09 +0000 (22:54 +0000)
committerJames Y Knight <jyknight@google.com>
Mon, 25 Apr 2016 22:54:09 +0000 (22:54 +0000)
commit90cc544fef3b9f81d9ec913ab79444e7fa65e6eb
tree380dc8b4ae7f38d9655335acf007ed3e44650303
parent426203a86d141f34d6c171271c80a352fc6461ec
[Sparc] Fix double-float fabs and fneg on little endian CPUs.

The SparcV8 fneg and fabs instructions interestingly come only in a
single-float variant. Since the sign bit is always the topmost bit no
matter what size float it is, you simply operate on the high
subregister, as if it were a single float.

However, the layout of double-floats in the float registers is reversed
on little-endian CPUs, so that the high bits are in the second
subregister, rather than the first.

Thus, this expansion must check the endianness to use the correct
subregister.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267489 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Sparc/SparcISelLowering.cpp
test/CodeGen/SPARC/float.ll
test/CodeGen/SPARC/fp128.ll