diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-11-08 06:47:33 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-11-08 06:47:33 +0000 |
commit | fdff938a7e4988da80be038acb1c6717d61b531a (patch) | |
tree | 2270b132b8a1fe22f63b56653ebf71dac480ad84 /llvm/tools/llvm2cpp/CppWriter.cpp | |
parent | 41f6c7cfb24169288c69d0dc5abf5518c142b76e (diff) | |
download | bcm5719-llvm-fdff938a7e4988da80be038acb1c6717d61b531a.tar.gz bcm5719-llvm-fdff938a7e4988da80be038acb1c6717d61b531a.zip |
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.
llvm-svn: 31542
Diffstat (limited to 'llvm/tools/llvm2cpp/CppWriter.cpp')
-rw-r--r-- | llvm/tools/llvm2cpp/CppWriter.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/tools/llvm2cpp/CppWriter.cpp b/llvm/tools/llvm2cpp/CppWriter.cpp index 1512af66e8d..79c3d9d1c11 100644 --- a/llvm/tools/llvm2cpp/CppWriter.cpp +++ b/llvm/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] << ", \""; |