[llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Tue May 25 15:26:01 PDT 2004
Changes in directory llvm-java/lib/Compiler:
Compiler.cpp updated: 1.26 -> 1.27
---
Log message:
Fix binary ops and conditional compilation. Values were reversed (v2
is at the top of the stack not v1).
---
Diffs of the changes: (+6 -6)
Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.26 llvm-java/lib/Compiler/Compiler.cpp:1.27
--- llvm-java/lib/Compiler/Compiler.cpp:1.26 Tue May 25 15:03:14 2004
+++ llvm-java/lib/Compiler/Compiler.cpp Tue May 25 15:23:17 2004
@@ -390,27 +390,27 @@
}
void do_shl(unsigned bcI) {
- Value* v1 = opStack_.top(); opStack_.pop();
Value* v2 = opStack_.top(); opStack_.pop();
+ Value* v1 = opStack_.top(); opStack_.pop();
Instruction* in = new ShiftInst(Instruction::Shl, v1, v2, TMP);
bc2bbMap_[bcI]->getInstList().push_back(in);
opStack_.push(in);
}
void do_shr(unsigned bcI) {
- Value* v1 = opStack_.top(); opStack_.pop();
Value* v2 = opStack_.top(); opStack_.pop();
+ Value* v1 = opStack_.top(); opStack_.pop();
Instruction* in = new ShiftInst(Instruction::Shr, v1, v2, TMP);
bc2bbMap_[bcI]->getInstList().push_back(in);
opStack_.push(in);
}
void do_ushr(unsigned bcI) {
+ Value* v2 = opStack_.top(); opStack_.pop();
Value* v1 = opStack_.top(); opStack_.pop();
Instruction* in =
new CastInst(v1, v1->getType()->getUnsignedVersion(), TMP);
bc2bbMap_[bcI]->getInstList().push_back(in);
- Value* v2 = opStack_.top(); opStack_.pop();
in = new ShiftInst(Instruction::Shr, in, v2, TMP);
bc2bbMap_[bcI]->getInstList().push_back(in);
opStack_.push(in);
@@ -429,8 +429,8 @@
}
void do_binary_op_common(unsigned bcI, Instruction::BinaryOps op) {
- Value* v1 = opStack_.top(); opStack_.pop();
Value* v2 = opStack_.top(); opStack_.pop();
+ Value* v1 = opStack_.top(); opStack_.pop();
Instruction* in = BinaryOperator::create(op, v1, v2, TMP);
bc2bbMap_[bcI]->getInstList().push_back(in);
opStack_.push(in);
@@ -462,8 +462,8 @@
void do_if(unsigned bcI, JSetCC cc, JType type,
unsigned t, unsigned f) {
- Value* v1 = opStack_.top(); opStack_.pop();
Value* v2 = llvm::Constant::getNullValue(getType(type));
+ Value* v1 = opStack_.top(); opStack_.pop();
Instruction* in = new SetCondInst(getSetCC(cc), v1, v2, TMP);
bc2bbMap_[bcI]->getInstList().push_back(in);
new BranchInst(bc2bbMap_[t],
@@ -474,8 +474,8 @@
void do_ifcmp(unsigned bcI, JSetCC cc,
unsigned t, unsigned f) {
- Value* v1 = opStack_.top(); opStack_.pop();
Value* v2 = opStack_.top(); opStack_.pop();
+ Value* v1 = opStack_.top(); opStack_.pop();
Instruction* in = new SetCondInst(getSetCC(cc), v1, v2, TMP);
bc2bbMap_[bcI]->getInstList().push_back(in);
new BranchInst(bc2bbMap_[t],
More information about the llvm-commits
mailing list