[llvm-commits] [vmkit] r52281 - /vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Sat Jun 14 11:19:17 PDT 2008
Author: geoffray
Date: Sat Jun 14 13:19:17 2008
New Revision: 52281
URL: http://llvm.org/viewvc/llvm-project?rev=52281&view=rev
Log:
IUSHR and LUSHR use a mask before doing the shift.
Modified:
vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp?rev=52281&r1=52280&r2=52281&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaJITOpcodes.cpp Sat Jun 14 13:19:17 2008
@@ -1007,6 +1007,8 @@
case IUSHR : {
Value* val2 = popAsInt();
Value* val1 = popAsInt();
+ Value* mask = ConstantInt::get(Type::Int32Ty, 0x1F);
+ val2 = BinaryOperator::CreateAnd(val2, mask, "", currentBlock);
push(BinaryOperator::createLShr(val1, val2, "", currentBlock),
AssessorDesc::dInt);
break;
@@ -1014,6 +1016,8 @@
case LUSHR : {
Value* val2 = new ZExtInst(pop(), Type::Int64Ty, "", currentBlock);
+ Value* mask = ConstantInt::get(Type::Int64Ty, 0x3F);
+ val2 = BinaryOperator::CreateAnd(val2, mask, "", currentBlock);
pop(); // remove the 0 on the stack
Value* val1 = pop();
push(BinaryOperator::createLShr(val1, val2, "", currentBlock),
More information about the llvm-commits
mailing list