diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-10-10 10:14:47 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-10-10 10:14:47 +0000 |
commit | 2fcfd83cb4b10c072186949ee39326f236c9f1b3 (patch) | |
tree | 3b3cf5c398efba4618a627b93965454baa5c3ca0 /lib/Target/Sparc | |
parent | a43e51d0fea8b1a6148934633012351a0432a4a6 (diff) | |
download | external_llvm-2fcfd83cb4b10c072186949ee39326f236c9f1b3.zip external_llvm-2fcfd83cb4b10c072186949ee39326f236c9f1b3.tar.gz external_llvm-2fcfd83cb4b10c072186949ee39326f236c9f1b3.tar.bz2 |
Add dummy 'm' inline asm constraint handler for Sparc. I'm not sure, whether it is correct, however :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57345 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc')
-rw-r--r-- | lib/Target/Sparc/SparcISelDAGToDAG.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/Target/Sparc/SparcISelDAGToDAG.cpp b/lib/Target/Sparc/SparcISelDAGToDAG.cpp index 691f283..66e143d 100644 --- a/lib/Target/Sparc/SparcISelDAGToDAG.cpp +++ b/lib/Target/Sparc/SparcISelDAGToDAG.cpp @@ -45,6 +45,12 @@ public: bool SelectADDRri(SDValue Op, SDValue N, SDValue &Base, SDValue &Offset); + /// SelectInlineAsmMemoryOperand - Implement addressing mode selection for + /// inline asm expressions. + virtual bool SelectInlineAsmMemoryOperand(const SDValue &Op, + char ConstraintCode, + std::vector<SDValue> &OutOps); + /// InstructionSelect - This callback is invoked by /// SelectionDAGISel when it has created a SelectionDAG for us to codegen. virtual void InstructionSelect(); @@ -184,6 +190,26 @@ SDNode *SparcDAGToDAGISel::Select(SDValue Op) { } +/// SelectInlineAsmMemoryOperand - Implement addressing mode selection for +/// inline asm expressions. +bool +SparcDAGToDAGISel::SelectInlineAsmMemoryOperand(const SDValue &Op, + char ConstraintCode, + std::vector<SDValue> &OutOps) { + SDValue Op0, Op1; + switch (ConstraintCode) { + default: return true; + case 'm': // memory + if (!SelectADDRrr(Op, Op, Op0, Op1)) + SelectADDRri(Op, Op, Op0, Op1); + break; + } + + OutOps.push_back(Op0); + OutOps.push_back(Op1); + return false; +} + /// createSparcISelDag - This pass converts a legalized DAG into a /// SPARC-specific DAG, ready for instruction scheduling. /// |