From 3822ff5c71478c7c90a50ca57045fb676fcb5005 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Wed, 8 Nov 2006 06:47:33 +0000 Subject: For PR950: This patch converts the old SHR instruction into two instructions, AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not dependent on the sign of their operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31542 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm2cpp/CppWriter.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tools/llvm2cpp/CppWriter.cpp') diff --git a/tools/llvm2cpp/CppWriter.cpp b/tools/llvm2cpp/CppWriter.cpp index 1512af66e8..79c3d9d1c1 100644 --- a/tools/llvm2cpp/CppWriter.cpp +++ b/tools/llvm2cpp/CppWriter.cpp @@ -788,7 +788,8 @@ void CppWriter::printConstant(const Constant *CV) { case Instruction::SetLT: Out << "getSetLT"; break; case Instruction::SetGT: Out << "getSetGT"; break; case Instruction::Shl: Out << "getShl"; break; - case Instruction::Shr: Out << "getShr"; break; + case Instruction::LShr: Out << "getLShr"; break; + case Instruction::AShr: Out << "getAShr"; break; case Instruction::Select: Out << "getSelect"; break; case Instruction::ExtractElement: Out << "getExtractElement"; break; case Instruction::InsertElement: Out << "getInsertElement"; break; @@ -1034,7 +1035,8 @@ CppWriter::printInstruction(const Instruction *I, const std::string& bbname) { case Instruction::Or: case Instruction::Xor: case Instruction::Shl: - case Instruction::Shr:{ + case Instruction::LShr: + case Instruction::AShr:{ Out << "BinaryOperator* " << iName << " = BinaryOperator::create("; switch (I->getOpcode()) { case Instruction::Add: Out << "Instruction::Add"; break; @@ -1050,7 +1052,8 @@ CppWriter::printInstruction(const Instruction *I, const std::string& bbname) { case Instruction::Or: Out << "Instruction::Or"; break; case Instruction::Xor: Out << "Instruction::Xor"; break; case Instruction::Shl: Out << "Instruction::Shl"; break; - case Instruction::Shr: Out << "Instruction::Shr"; break; + case Instruction::LShr:Out << "Instruction::LShr"; break; + case Instruction::AShr:Out << "Instruction::AShr"; break; default: Out << "Instruction::BadOpCode"; break; } Out << ", " << opNames[0] << ", " << opNames[1] << ", \""; -- cgit v1.2.3-18-g5258