summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-02 02:16:23 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-02 02:16:23 +0000
commit2341c22ec71aed773101eef6bc725df2047e5154 (patch)
tree453d820479bbe83769e54e01abc702ac8ef71312 /llvm/lib/ExecutionEngine
parent48b094d9ddbca690da41f5711d8e1fcb46c50e05 (diff)
downloadbcm5719-llvm-2341c22ec71aed773101eef6bc725df2047e5154.tar.gz
bcm5719-llvm-2341c22ec71aed773101eef6bc725df2047e5154.zip
Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits on large integer types. This changes the syntax for llvm assembly to make shl, ashr and lshr instructions look like a binary operator: shl i32 %X, 1 instead of shl i32 %X, i8 1 Additionally, this should help a few passes perform additional optimizations. llvm-svn: 33776
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/Execution.cpp6
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/Interpreter.h7
2 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
index 2e36875e492..565915bb5a4 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -1275,7 +1275,7 @@ static GenericValue executeAShrInst(GenericValue Src1, GenericValue Src2,
return Dest;
}
-void Interpreter::visitShl(ShiftInst &I) {
+void Interpreter::visitShl(BinaryOperator &I) {
ExecutionContext &SF = ECStack.back();
const Type *Ty = I.getOperand(0)->getType();
GenericValue Src1 = getOperandValue(I.getOperand(0), SF);
@@ -1285,7 +1285,7 @@ void Interpreter::visitShl(ShiftInst &I) {
SetValue(&I, Dest, SF);
}
-void Interpreter::visitLShr(ShiftInst &I) {
+void Interpreter::visitLShr(BinaryOperator &I) {
ExecutionContext &SF = ECStack.back();
const Type *Ty = I.getOperand(0)->getType();
GenericValue Src1 = getOperandValue(I.getOperand(0), SF);
@@ -1295,7 +1295,7 @@ void Interpreter::visitLShr(ShiftInst &I) {
SetValue(&I, Dest, SF);
}
-void Interpreter::visitAShr(ShiftInst &I) {
+void Interpreter::visitAShr(BinaryOperator &I) {
ExecutionContext &SF = ECStack.back();
const Type *Ty = I.getOperand(0)->getType();
GenericValue Src1 = getOperandValue(I.getOperand(0), SF);
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h
index 3007b0adb2a..a8deb01b21c 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h
+++ b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h
@@ -165,9 +165,10 @@ public:
void visitUnwindInst(UnwindInst &I);
void visitUnreachableInst(UnreachableInst &I);
- void visitShl(ShiftInst &I);
- void visitLShr(ShiftInst &I);
- void visitAShr(ShiftInst &I);
+ void visitShl(BinaryOperator &I);
+ void visitLShr(BinaryOperator &I);
+ void visitAShr(BinaryOperator &I);
+
void visitVAArgInst(VAArgInst &I);
void visitInstruction(Instruction &I) {
cerr << I;
OpenPOWER on IntegriCloud