summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-10-19 00:16:32 +0000
committerBob Wilson <bob.wilson@apple.com>2010-10-19 00:16:32 +0000
commitb6d61dc291d5c2cfec8890ca7ba7270e228cb4d7 (patch)
treed5b15d961920a3fbd6433d4ffe189c76b060ff22 /llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
parent92b9e6e323654d4ac2219b2c6b87845e31051c60 (diff)
downloadbcm5719-llvm-b6d61dc291d5c2cfec8890ca7ba7270e228cb4d7.tar.gz
bcm5719-llvm-b6d61dc291d5c2cfec8890ca7ba7270e228cb4d7.zip
Support alignment for NEON vld-lane and vst-lane instructions.
llvm-svn: 116776
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
index 4485da42ce9..aa65a48bcc4 100644
--- a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
+++ b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
@@ -1298,6 +1298,17 @@ SDNode *ARMDAGToDAGISel::SelectVLDSTLane(SDNode *N, bool IsLoad,
EVT VT = IsLoad ? N->getValueType(0) : N->getOperand(3).getValueType();
bool is64BitVector = VT.is64BitVector();
+ if (NumVecs != 3) {
+ unsigned Alignment = cast<MemIntrinsicSDNode>(N)->getAlignment();
+ unsigned NumBytes = NumVecs * VT.getVectorElementType().getSizeInBits()/8;
+ if (Alignment > NumBytes)
+ Alignment = NumBytes;
+ // Alignment must be a power of two; make sure of that.
+ Alignment = (Alignment & -Alignment);
+ if (Alignment > 1)
+ Align = CurDAG->getTargetConstant(Alignment, MVT::i32);
+ }
+
unsigned OpcodeIndex;
switch (VT.getSimpleVT().SimpleTy) {
default: llvm_unreachable("unhandled vld/vst lane type");
OpenPOWER on IntegriCloud