Add support for call instructions (0-ary only for now).
authorBrian Gaeke <gaeke@uiuc.edu>
Fri, 2 Apr 2004 20:53:33 +0000 (20:53 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Fri, 2 Apr 2004 20:53:33 +0000 (20:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12629 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/InstSelectSimple.cpp
lib/Target/Sparc/SparcV8ISelSimple.cpp
lib/Target/SparcV8/InstSelectSimple.cpp
lib/Target/SparcV8/SparcV8ISelSimple.cpp

index 890e55d4d3db8696a32c9d9b6f56c0e6d0cbee04..05a1920946d1a857e06fed87d2514c3198ce8a52 100644 (file)
@@ -58,7 +58,8 @@ namespace {
     }
 
        void visitBinaryOperator(BinaryOperator &I);
-    void visitReturnInst(ReturnInst &RI);
+       void visitCallInst(CallInst &I);
+       void visitReturnInst(ReturnInst &RI);
 
     void visitInstruction(Instruction &I) {
       std::cerr << "Unhandled instruction: " << I;
@@ -226,6 +227,11 @@ bool V8ISel::runOnFunction(Function &Fn) {
   return true;
 }
 
+void V8ISel::visitCallInst(CallInst &I) {
+  assert (I.getNumOperands () == 1 && "Can't handle call args yet");
+  BuildMI (BB, V8::CALL, 1).addPCDisp (I.getOperand (0));
+  BuildMI (BB, V8::NOP, 0); // NOP in delay slot
+}
 
 void V8ISel::visitReturnInst(ReturnInst &I) {
   if (I.getNumOperands () == 1) {
index 890e55d4d3db8696a32c9d9b6f56c0e6d0cbee04..05a1920946d1a857e06fed87d2514c3198ce8a52 100644 (file)
@@ -58,7 +58,8 @@ namespace {
     }
 
        void visitBinaryOperator(BinaryOperator &I);
-    void visitReturnInst(ReturnInst &RI);
+       void visitCallInst(CallInst &I);
+       void visitReturnInst(ReturnInst &RI);
 
     void visitInstruction(Instruction &I) {
       std::cerr << "Unhandled instruction: " << I;
@@ -226,6 +227,11 @@ bool V8ISel::runOnFunction(Function &Fn) {
   return true;
 }
 
+void V8ISel::visitCallInst(CallInst &I) {
+  assert (I.getNumOperands () == 1 && "Can't handle call args yet");
+  BuildMI (BB, V8::CALL, 1).addPCDisp (I.getOperand (0));
+  BuildMI (BB, V8::NOP, 0); // NOP in delay slot
+}
 
 void V8ISel::visitReturnInst(ReturnInst &I) {
   if (I.getNumOperands () == 1) {
index 890e55d4d3db8696a32c9d9b6f56c0e6d0cbee04..05a1920946d1a857e06fed87d2514c3198ce8a52 100644 (file)
@@ -58,7 +58,8 @@ namespace {
     }
 
        void visitBinaryOperator(BinaryOperator &I);
-    void visitReturnInst(ReturnInst &RI);
+       void visitCallInst(CallInst &I);
+       void visitReturnInst(ReturnInst &RI);
 
     void visitInstruction(Instruction &I) {
       std::cerr << "Unhandled instruction: " << I;
@@ -226,6 +227,11 @@ bool V8ISel::runOnFunction(Function &Fn) {
   return true;
 }
 
+void V8ISel::visitCallInst(CallInst &I) {
+  assert (I.getNumOperands () == 1 && "Can't handle call args yet");
+  BuildMI (BB, V8::CALL, 1).addPCDisp (I.getOperand (0));
+  BuildMI (BB, V8::NOP, 0); // NOP in delay slot
+}
 
 void V8ISel::visitReturnInst(ReturnInst &I) {
   if (I.getNumOperands () == 1) {
index 890e55d4d3db8696a32c9d9b6f56c0e6d0cbee04..05a1920946d1a857e06fed87d2514c3198ce8a52 100644 (file)
@@ -58,7 +58,8 @@ namespace {
     }
 
        void visitBinaryOperator(BinaryOperator &I);
-    void visitReturnInst(ReturnInst &RI);
+       void visitCallInst(CallInst &I);
+       void visitReturnInst(ReturnInst &RI);
 
     void visitInstruction(Instruction &I) {
       std::cerr << "Unhandled instruction: " << I;
@@ -226,6 +227,11 @@ bool V8ISel::runOnFunction(Function &Fn) {
   return true;
 }
 
+void V8ISel::visitCallInst(CallInst &I) {
+  assert (I.getNumOperands () == 1 && "Can't handle call args yet");
+  BuildMI (BB, V8::CALL, 1).addPCDisp (I.getOperand (0));
+  BuildMI (BB, V8::NOP, 0); // NOP in delay slot
+}
 
 void V8ISel::visitReturnInst(ReturnInst &I) {
   if (I.getNumOperands () == 1) {