aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-11-06 22:53:25 +0000
committerChris Lattner <sabre@nondot.org>2001-11-06 22:53:25 +0000
commit8679005193a8a3f8c0eb975a321bd08dec4793d7 (patch)
treea1dd9796735d9b968dd065a3061251f800ed4285 /lib/ExecutionEngine
parent4bf36bb67f924621a2b39696c9b312f28a97e023 (diff)
downloadexternal_llvm-8679005193a8a3f8c0eb975a321bd08dec4793d7.zip
external_llvm-8679005193a8a3f8c0eb975a321bd08dec4793d7.tar.gz
external_llvm-8679005193a8a3f8c0eb975a321bd08dec4793d7.tar.bz2
Implement log and drand48 for TSP bm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r--lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
index f40205b..08158d2 100644
--- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
+++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
@@ -229,6 +229,23 @@ GenericValue lle_X_sqrt(MethodType *M, const vector<GenericValue> &Args) {
return GV;
}
+// double log(double)
+GenericValue lle_X_log(MethodType *M, const vector<GenericValue> &Args) {
+ assert(Args.size() == 1);
+ GenericValue GV;
+ GV.DoubleVal = log(Args[0].DoubleVal);
+ return GV;
+}
+
+// double drand48()
+GenericValue lle_X_drand48(MethodType *M, const vector<GenericValue> &Args) {
+ assert(Args.size() == 0);
+ GenericValue GV;
+ GV.DoubleVal = drand48();
+ return GV;
+}
+
+
// int printf(sbyte *, ...) - a very rough implementation to make output useful.
GenericValue lle_X_printf(MethodType *M, const vector<GenericValue> &Args) {
const char *FmtStr = (const char *)Args[0].PointerVal;