llvm-6502/lib/CodeGen/SelectionDAG
Ulrich Weigand 7bbb9c7b4a Fix big-endian codegen bug in DAGTypeLegalizer::ExpandRes_BITCAST
On PowerPC, a bitcast of <16 x i8> to i128 may run through a code
path in ExpandRes_BITCAST that attempts to do an intermediate
bitcast to a <4 x i32> vector, and then construct the Hi and Lo parts
of the resulting i128 by pairing up two of those i32 vector elements
each.  The code already recognizes that on a big-endian system, the
first two vector elements form the Hi part, and the final two vector
elements form the Lo part (vice-versa from the little-endian situation).

However, we also need to take endianness into account when forming each
of those separate pairs:  on a big-endian system, vector element 0 is
the *high* part of the pair making up the Hi part of the result, and
vector element 1 is the low part of the pair.  The code currently always
uses vector element 0 as the low part and vector element 1 as the high
part, as is appropriate for little-endian platforms only.

This patch fixes this by swapping the vector elements as they are
paired up as appropriate.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165802 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12 15:42:58 +00:00
..
CMakeLists.txt llvm/lib: [CMake] Add explicit dependency to intrinsics_gen. 2012-06-24 13:32:01 +00:00
DAGCombiner.cpp Refactor the AddrMode class out of TLI to its own header file. 2012-10-08 23:06:34 +00:00
FastISel.cpp Move TargetData to DataLayout. 2012-10-08 16:38:25 +00:00
FunctionLoweringInfo.cpp Move TargetData to DataLayout. 2012-10-08 16:38:25 +00:00
InstrEmitter.cpp Move TargetData to DataLayout. 2012-10-08 16:38:25 +00:00
InstrEmitter.h Allow trailing physreg RegisterSDNode operands on non-variadic instructions. 2012-07-04 23:53:23 +00:00
LegalizeDAG.cpp Legalizer optimize a pair of div / mod to a call to divrem libcall if they are 2012-10-12 01:15:47 +00:00
LegalizeFloatTypes.cpp Follow the same routine to add target float expansion hook 2012-10-11 07:22:01 +00:00
LegalizeIntegerTypes.cpp Fix PR13991: legalizing an overflowing multiplication operation is harder than 2012-10-02 15:03:49 +00:00
LegalizeTypes.cpp Move TargetData to DataLayout. 2012-10-08 16:38:25 +00:00
LegalizeTypes.h Add alternative support for FP_ROUND from v2f32 to v2f64 2012-10-10 16:32:15 +00:00
LegalizeTypesGeneric.cpp Fix big-endian codegen bug in DAGTypeLegalizer::ExpandRes_BITCAST 2012-10-12 15:42:58 +00:00
LegalizeVectorOps.cpp Fix a typo. 2012-09-02 12:21:50 +00:00
LegalizeVectorTypes.cpp Add alternative support for FP_ROUND from v2f32 to v2f64 2012-10-10 16:32:15 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Makefile
ResourcePriorityQueue.cpp I'm introducing a new machine model to simultaneously allow simple 2012-07-07 04:00:00 +00:00
ScheduleDAGFast.cpp Move TargetData to DataLayout. 2012-10-08 16:38:25 +00:00
ScheduleDAGRRList.cpp Move TargetData to DataLayout. 2012-10-08 16:38:25 +00:00
ScheduleDAGSDNodes.cpp Release build: guard dump functions with 2012-09-11 22:23:19 +00:00
ScheduleDAGSDNodes.h misched: remove forceUnitLatencies. Defaults are handled by the default SchedModel 2012-10-08 18:53:57 +00:00
ScheduleDAGVLIW.cpp Move TargetData to DataLayout. 2012-10-08 16:38:25 +00:00
SDNodeDbgValue.h
SDNodeOrdering.h Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION. 2012-09-18 02:01:41 +00:00
SelectionDAG.cpp Revert 165732 for further review. 2012-10-11 21:27:41 +00:00
SelectionDAGBuilder.cpp Issue description: 2012-10-10 11:37:36 +00:00
SelectionDAGBuilder.h Move TargetData to DataLayout. 2012-10-08 16:38:25 +00:00
SelectionDAGDumper.cpp Fix PR11985 2012-09-12 21:43:09 +00:00
SelectionDAGISel.cpp Fix bad comment. No functional change. 2012-09-16 16:48:25 +00:00
SelectionDAGPrinter.cpp Constify SDNodeIterator an stop its only non-const user being cast stripped 2012-09-05 22:03:34 +00:00
TargetLowering.cpp Add in the first step of the multiple pointer support. This adds in support to the data layout for specifying a per address space pointer size. 2012-10-09 16:06:12 +00:00
TargetSelectionDAGInfo.cpp Move TargetData to DataLayout. 2012-10-08 16:38:25 +00:00