summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAhmed Bougacha <ahmed.bougacha@gmail.com>2015-09-10 01:48:29 +0000
committerAhmed Bougacha <ahmed.bougacha@gmail.com>2015-09-10 01:48:29 +0000
commitc0ac38d584d0513e8699baa9953fdc6b11238987 (patch)
treed208b33747c97474f9cd65f67198a33e2b12d749 /llvm/lib
parent57a41913edf328cc155806639d2f33e10d3b6a6d (diff)
downloadbcm5719-llvm-c0ac38d584d0513e8699baa9953fdc6b11238987.tar.gz
bcm5719-llvm-c0ac38d584d0513e8699baa9953fdc6b11238987.zip
[AArch64] Match base+offset in STNP addressing mode.
Followup to r247231. llvm-svn: 247234
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp b/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
index 77896af196d..367bbc3a482 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
@@ -630,6 +630,22 @@ bool AArch64DAGToDAGISel::SelectAddrModeIndexed7S(SDValue N, unsigned Size,
SDValue &Base,
SDValue &OffImm) {
SDLoc dl(N);
+ // As opposed to the (12-bit) Indexed addressing mode below, the 7-bit signed
+ // selected here doesn't support labels/immediates, only base+offset.
+
+ if (CurDAG->isBaseWithConstantOffset(N)) {
+ if (ConstantSDNode *RHS = dyn_cast<ConstantSDNode>(N.getOperand(1))) {
+ int64_t RHSC = RHS->getSExtValue();
+ unsigned Scale = Log2_32(Size);
+ if ((RHSC & (Size - 1)) == 0 && RHSC >= (-0x40 << Scale) &&
+ RHSC < (0x40 << Scale)) {
+ Base = N.getOperand(0);
+ OffImm = CurDAG->getTargetConstant(RHSC >> Scale, dl, MVT::i64);
+ return true;
+ }
+ }
+ }
+
// Base only. The address will be materialized into a register before
// the memory is accessed.
// add x0, Xbase, #offset
OpenPOWER on IntegriCloud