From e5d8861126959d01cf847b6ef280dd9ef38d33cf Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 24 Feb 2006 02:13:12 +0000 Subject: [PATCH] Implement selection of inline asm memory operands git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26348 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPCISelDAGToDAG.cpp | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp index 78dbaa64a3d..27e0afd34bb 100644 --- a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp +++ b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp @@ -83,6 +83,35 @@ namespace { /// represented as an indexed [r+r] operation. bool SelectAddrIdxOnly(SDOperand N, SDOperand &Base, SDOperand &Index); + /// SelectInlineAsmMemoryOperand - Implement addressing mode selection for + /// inline asm expressions. + virtual bool SelectInlineAsmMemoryOperand(const SDOperand &Op, + char ConstraintCode, + std::vector &OutOps, + SelectionDAG &DAG) { + SDOperand Op0, Op1; + switch (ConstraintCode) { + default: return true; + case 'm': // memory + if (!SelectAddrIdx(Op, Op0, Op1)) + SelectAddrImm(Op, Op0, Op1); + break; + case 'o': // offsetable + if (!SelectAddrImm(Op, Op0, Op1)) { + Select(Op0, Op); // r+0. + Op1 = getI32Imm(0); + } + break; + case 'v': // not offsetable + SelectAddrIdxOnly(Op, Op0, Op1); + break; + } + + OutOps.push_back(Op0); + OutOps.push_back(Op1); + return false; + } + SDOperand BuildSDIVSequence(SDNode *N); SDOperand BuildUDIVSequence(SDNode *N); -- 2.34.1