[llvm-commits] [vmkit] r50641 - in /vmkit/trunk/lib: JnJVM/VMCore/JavaJIT.cpp Mvm/JIT.cpp N3/VMCore/Opcodes.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Mon May 5 02:09:55 PDT 2008
Author: geoffray
Date: Mon May 5 04:09:53 2008
New Revision: 50641
URL: http://llvm.org/viewvc/llvm-project?rev=50641&view=rev
Log:
Use new APFloat interface.
Modified:
vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp
vmkit/trunk/lib/Mvm/JIT.cpp
vmkit/trunk/lib/N3/VMCore/Opcodes.cpp
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp?rev=50641&r1=50640&r2=50641&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaJIT.cpp Mon May 5 04:09:53 2008
@@ -1053,7 +1053,7 @@
mvm::jit::unprotectConstants();//->unlock();
} else if (type == JavaCtpInfo::ConstantDouble) {
mvm::jit::protectConstants();//->lock();
- push(ConstantFP::get(Type::DoubleTy, APFloat(ctpInfo->DoubleAt(index))),
+ push(ConstantFP::get(Type::DoubleTy, ctpInfo->DoubleAt(index)),
AssessorDesc::dDouble);
mvm::jit::unprotectConstants();//->unlock();
} else if (type == JavaCtpInfo::ConstantInteger) {
@@ -1063,7 +1063,7 @@
mvm::jit::unprotectConstants();//->unlock();
} else if (type == JavaCtpInfo::ConstantFloat) {
mvm::jit::protectConstants();//->lock();
- push(ConstantFP::get(Type::FloatTy, APFloat(ctpInfo->FloatAt(index))),
+ push(ConstantFP::get(Type::FloatTy, ctpInfo->FloatAt(index)),
AssessorDesc::dFloat);
mvm::jit::unprotectConstants();//->unlock();
} else if (type == JavaCtpInfo::ConstantClass) {
Modified: vmkit/trunk/lib/Mvm/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/Mvm/JIT.cpp?rev=50641&r1=50640&r2=50641&view=diff
==============================================================================
--- vmkit/trunk/lib/Mvm/JIT.cpp (original)
+++ vmkit/trunk/lib/Mvm/JIT.cpp Mon May 5 04:09:53 2008
@@ -529,26 +529,26 @@
constantMaxInt = ConstantInt::get(Type::Int32Ty, MaxInt);
constantMinLong = ConstantInt::get(Type::Int64Ty, MinLong);
constantMaxLong = ConstantInt::get(Type::Int64Ty, MaxLong);
- constantFloatZero = ConstantFP::get(Type::FloatTy, APFloat(0.0f));
- constantFloatOne = ConstantFP::get(Type::FloatTy, APFloat(1.0f));
- constantFloatTwo = ConstantFP::get(Type::FloatTy, APFloat(2.0f));
- constantDoubleZero = ConstantFP::get(Type::DoubleTy, APFloat(0.0));
- constantDoubleOne = ConstantFP::get(Type::DoubleTy, APFloat(1.0));
- constantMaxIntFloat = ConstantFP::get(Type::FloatTy, APFloat(MaxIntFloat));
- constantMinIntFloat = ConstantFP::get(Type::FloatTy, APFloat(MinIntFloat));
- constantMinLongFloat = ConstantFP::get(Type::FloatTy, APFloat(MinLongFloat));
- constantMinLongDouble = ConstantFP::get(Type::DoubleTy, APFloat(MinLongDouble));
- constantMaxLongFloat = ConstantFP::get(Type::FloatTy, APFloat(MaxLongFloat));
- constantMaxIntDouble = ConstantFP::get(Type::DoubleTy, APFloat(MaxIntDouble));
- constantMinIntDouble = ConstantFP::get(Type::DoubleTy, APFloat(MinIntDouble));
- constantMaxLongDouble = ConstantFP::get(Type::DoubleTy, APFloat(MaxLongDouble));
- constantMaxLongDouble = ConstantFP::get(Type::DoubleTy, APFloat(MaxLongDouble));
- constantFloatInfinity = ConstantFP::get(Type::FloatTy, APFloat(MaxFloat));
- constantFloatMinusInfinity = ConstantFP::get(Type::FloatTy, APFloat(MinFloat));
- constantDoubleInfinity = ConstantFP::get(Type::DoubleTy, APFloat(MaxDouble));
- constantDoubleMinusInfinity = ConstantFP::get(Type::DoubleTy, APFloat(MinDouble));
- constantDoubleMinusZero = ConstantFP::get(Type::DoubleTy, APFloat(-0.0));
- constantFloatMinusZero = ConstantFP::get(Type::FloatTy, APFloat(-0.0f));
+ constantFloatZero = ConstantFP::get(Type::FloatTy, 0.0f);
+ constantFloatOne = ConstantFP::get(Type::FloatTy, 1.0f);
+ constantFloatTwo = ConstantFP::get(Type::FloatTy, 2.0f);
+ constantDoubleZero = ConstantFP::get(Type::DoubleTy, 0.0);
+ constantDoubleOne = ConstantFP::get(Type::DoubleTy, 1.0);
+ constantMaxIntFloat = ConstantFP::get(Type::FloatTy, MaxIntFloat);
+ constantMinIntFloat = ConstantFP::get(Type::FloatTy, MinIntFloat);
+ constantMinLongFloat = ConstantFP::get(Type::FloatTy, MinLongFloat);
+ constantMinLongDouble = ConstantFP::get(Type::DoubleTy, MinLongDouble);
+ constantMaxLongFloat = ConstantFP::get(Type::FloatTy, MaxLongFloat);
+ constantMaxIntDouble = ConstantFP::get(Type::DoubleTy, MaxIntDouble);
+ constantMinIntDouble = ConstantFP::get(Type::DoubleTy, MinIntDouble);
+ constantMaxLongDouble = ConstantFP::get(Type::DoubleTy, MaxLongDouble);
+ constantMaxLongDouble = ConstantFP::get(Type::DoubleTy, MaxLongDouble);
+ constantFloatInfinity = ConstantFP::get(Type::FloatTy, MaxFloat);
+ constantFloatMinusInfinity = ConstantFP::get(Type::FloatTy, MinFloat);
+ constantDoubleInfinity = ConstantFP::get(Type::DoubleTy, MaxDouble);
+ constantDoubleMinusInfinity = ConstantFP::get(Type::DoubleTy, MinDouble);
+ constantDoubleMinusZero = ConstantFP::get(Type::DoubleTy, -0.0);
+ constantFloatMinusZero = ConstantFP::get(Type::FloatTy, -0.0f);
constantPtrNull = Constant::getNullValue(ptrType);
arrayPtrType = PointerType::getUnqual(ArrayType::get(Type::Int8Ty, 0));
Modified: vmkit/trunk/lib/N3/VMCore/Opcodes.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Opcodes.cpp?rev=50641&r1=50640&r2=50641&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/Opcodes.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/Opcodes.cpp Mon May 5 04:09:53 2008
@@ -768,14 +768,14 @@
case LDC_R4 : {
mvm::jit::protectConstants();
- push(ConstantFP::get(Type::FloatTy, APFloat(readFloat(bytecodes, i))));
+ push(ConstantFP::get(Type::FloatTy, readFloat(bytecodes, i)));
mvm::jit::unprotectConstants();
break;
}
case LDC_R8 : {
mvm::jit::protectConstants();
- push(ConstantFP::get(Type::DoubleTy, APFloat(readDouble(bytecodes, i))));
+ push(ConstantFP::get(Type::DoubleTy, readDouble(bytecodes, i)));
mvm::jit::unprotectConstants();
break;
}
More information about the llvm-commits
mailing list