From: Andrew Lenharth Date: Sun, 3 Aug 2008 20:17:34 +0000 (+0000) Subject: Add atomic sub for other sizes X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=08ca62bb6f1da313ac0fd3ae80c9cf6caa0dd3c6;p=oota-llvm.git Add atomic sub for other sizes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54314 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 6f8b1ec7cc0..7870cb0c164 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -296,6 +296,8 @@ X86TargetLowering::X86TargetLowering(X86TargetMachine &TM) setOperationAction(ISD::ATOMIC_CMP_SWAP , MVT::i16, Custom); setOperationAction(ISD::ATOMIC_CMP_SWAP , MVT::i32, Custom); setOperationAction(ISD::ATOMIC_CMP_SWAP , MVT::i64, Custom); + setOperationAction(ISD::ATOMIC_LOAD_SUB , MVT::i8, Expand); + setOperationAction(ISD::ATOMIC_LOAD_SUB , MVT::i16, Expand); setOperationAction(ISD::ATOMIC_LOAD_SUB , MVT::i32, Expand); // Use the default ISD::DBG_STOPPOINT, ISD::DECLARE expansion. @@ -5880,7 +5882,6 @@ SDNode* X86TargetLowering::ExpandATOMIC_CMP_SWAP(SDNode* Op, SelectionDAG &DAG) SDNode* X86TargetLowering::ExpandATOMIC_LOAD_SUB(SDNode* Op, SelectionDAG &DAG) { MVT T = Op->getValueType(0); - assert (T == MVT::i32 && "Only know how to expand i32 Atomic Load Sub"); SDValue negOp = DAG.getNode(ISD::SUB, T, DAG.getConstant(0, T), Op->getOperand(2)); return DAG.getAtomic(ISD::ATOMIC_LOAD_ADD, Op->getOperand(0),