summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitc23094efb4b211f20a8e4aa877c2b9f5abffe09f (patch)
treee3fb721d30e0cc7f7b337951afe398c28ad9d806 /llvm/lib/ExecutionEngine
parent74a4698aaaa359655d52b8df6316261bf5c1e8d9 (diff)
downloadbcm5719-llvm-c23094efb4b211f20a8e4aa877c2b9f5abffe09f.tar.gz
bcm5719-llvm-c23094efb4b211f20a8e4aa877c2b9f5abffe09f.zip
Implement log and drand48 for TSP bm
llvm-svn: 1165
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
index f40205bce14..08158d2be57 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud