summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-28 22:29:18 +0000
committerChris Lattner <sabre@nondot.org>2005-01-28 22:29:18 +0000
commita4cfafe31a0d75a491d01096da85f0f3f012ef53 (patch)
treea9b02ba457e77452a959e319966a388199a19d5d /llvm/lib/CodeGen
parent3a46875e5460ab4c3d4cc60b2fe6b3bcc9eb0345 (diff)
downloadbcm5719-llvm-a4cfafe31a0d75a491d01096da85f0f3f012ef53.tar.gz
bcm5719-llvm-a4cfafe31a0d75a491d01096da85f0f3f012ef53.zip
Get alpha working with memset/memcpy/memmove
llvm-svn: 19878
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp34
1 files changed, 29 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index b48c1b6aaba..32cf5970726 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -706,11 +706,35 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
case ISD::MEMSET:
case ISD::MEMCPY:
case ISD::MEMMOVE: {
- Tmp1 = LegalizeOp(Node->getOperand(0));
- Tmp2 = LegalizeOp(Node->getOperand(1));
- Tmp3 = LegalizeOp(Node->getOperand(2));
- SDOperand Tmp4 = LegalizeOp(Node->getOperand(3));
- SDOperand Tmp5 = LegalizeOp(Node->getOperand(4));
+ Tmp1 = LegalizeOp(Node->getOperand(0)); // Function
+ Tmp2 = LegalizeOp(Node->getOperand(1)); // Pointer
+
+ if (Node->getOpcode() == ISD::MEMSET) { // memset = ubyte
+ switch (getTypeAction(Node->getOperand(2).getValueType())) {
+ case Expand: assert(0 && "Cannot expand a byte!");
+ case Legal:
+ Tmp3 = LegalizeOp(Node->getOperand(1));
+ break;
+ case Promote:
+ Tmp3 = PromoteOp(Node->getOperand(1));
+ break;
+ }
+ } else {
+ Tmp3 = LegalizeOp(Node->getOperand(2)); // memcpy/move = pointer,
+ }
+ SDOperand Tmp4, Tmp5;
+
+ switch (getTypeAction(Node->getOperand(3).getValueType())) { // uint
+ case Expand: assert(0 && "Cannot expand this yet!");
+ case Legal:
+ Tmp4 = LegalizeOp(Node->getOperand(3));
+ Tmp5 = LegalizeOp(Node->getOperand(4));
+ break;
+ case Promote:
+ Tmp4 = PromoteOp(Node->getOperand(3));
+ Tmp5 = PromoteOp(Node->getOperand(4));
+ break;
+ }
switch (TLI.getOperationAction(Node->getOpcode(), MVT::Other)) {
default: assert(0 && "This action not implemented for this operation!");
OpenPOWER on IntegriCloud