[llvm-commits] CVS: llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Jan 15 00:44:09 PST 2006
Changes in directory llvm/lib/Target/SparcV8:
SparcV8ISelDAGToDAG.cpp updated: 1.50 -> 1.51
---
Log message:
Implement DYNAMIC_STACKALLOC for V8
---
Diffs of the changes: (+18 -1)
SparcV8ISelDAGToDAG.cpp | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletion(-)
Index: llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp
diff -u llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp:1.50 llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp:1.51
--- llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp:1.50 Fri Jan 13 21:14:10 2006
+++ llvm/lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp Sun Jan 15 02:43:57 2006
@@ -136,6 +136,8 @@
setOperationAction(ISD::SELECT_CC, MVT::f32, Custom);
setOperationAction(ISD::SELECT_CC, MVT::f64, Custom);
+ setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32, Custom);
+
// V8 has no intrinsics for these particular operations.
setOperationAction(ISD::MEMMOVE, MVT::Other, Expand);
setOperationAction(ISD::MEMSET, MVT::Other, Expand);
@@ -699,7 +701,22 @@
return DAG.getNode(Opc, TrueVal.getValueType(), TrueVal, FalseVal,
DAG.getConstant(CC, MVT::i32), CompareFlag);
}
- }
+ case ISD::DYNAMIC_STACKALLOC: {
+ SDOperand Chain = Op.getOperand(0);
+ SDOperand Size = Op.getOperand(1);
+
+ SDOperand SP = DAG.getCopyFromReg(Chain, V8::O6, MVT::i32);
+ Chain = SP.getValue(1);
+ SDOperand Res = DAG.getNode(ISD::SUB, MVT::i32, SP, Size);
+ Chain = DAG.getCopyToReg(Chain, V8::O6, Res);
+
+ std::vector<MVT::ValueType> VTs(Op.Val->value_begin(), Op.Val->value_end());
+ std::vector<SDOperand> Ops;
+ Ops.push_back(Res);
+ Ops.push_back(Chain);
+ return DAG.getNode(ISD::MERGE_VALUES, VTs, Ops);
+ }
+ }
}
MachineBasicBlock *
More information about the llvm-commits
mailing list