diff options
author | Dale Johannesen <dalej@apple.com> | 2008-10-02 18:53:47 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-10-02 18:53:47 +0000 |
commit | f160d80930ec8dc8f94df6010b562bd03e28f325 (patch) | |
tree | 415c0f43e5c715afbe4b5209c9da1fadbe232080 /lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | |
parent | fae00fe5d6b235c99fc8836b7af36ff5d7d8de93 (diff) | |
download | external_llvm-f160d80930ec8dc8f94df6010b562bd03e28f325.zip external_llvm-f160d80930ec8dc8f94df6010b562bd03e28f325.tar.gz external_llvm-f160d80930ec8dc8f94df6010b562bd03e28f325.tar.bz2 |
Handle some 64-bit atomics on x86-32, some of the time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56963 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 0a0a06b..243b21c 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -6212,21 +6212,26 @@ void SelectionDAGLegalize::ExpandOp(SDValue Op, SDValue &Lo, SDValue &Hi){ break; } - // FIXME: should the LOAD_BIN and SWAP atomics get here too? Probably. - case ISD::ATOMIC_CMP_SWAP_8: - case ISD::ATOMIC_CMP_SWAP_16: - case ISD::ATOMIC_CMP_SWAP_32: + case ISD::ATOMIC_LOAD_ADD_64: + case ISD::ATOMIC_LOAD_SUB_64: + case ISD::ATOMIC_LOAD_AND_64: + case ISD::ATOMIC_LOAD_OR_64: + case ISD::ATOMIC_LOAD_XOR_64: + case ISD::ATOMIC_LOAD_NAND_64: + case ISD::ATOMIC_SWAP_64: case ISD::ATOMIC_CMP_SWAP_64: { - SDValue Tmp = TLI.LowerOperation(Op, DAG); - assert(Tmp.getNode() && "Node must be custom expanded!"); - ExpandOp(Tmp.getValue(0), Lo, Hi); - AddLegalizedOperand(SDValue(Node, 1), // Remember we legalized the chain. - LegalizeOp(Tmp.getValue(1))); + SDValue In2Lo, In2Hi, In2; + ExpandOp(Op.getOperand(2), In2Lo, In2Hi); + In2 = DAG.getNode(ISD::BUILD_PAIR, VT, In2Lo, In2Hi); + SDValue Result = TLI.LowerOperation( + DAG.getNode(Op.getOpcode(), VT, Op.getOperand(0), Op.getOperand(1), In2), + DAG); + ExpandOp(Result.getValue(0), Lo, Hi); + // Remember that we legalized the chain. + AddLegalizedOperand(SDValue(Node,1), LegalizeOp(Result.getValue(1))); break; } - - // These operators cannot be expanded directly, emit them as calls to // library functions. case ISD::FP_TO_SINT: { |