aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-11-13 05:46:08 +0000
committerChris Lattner <sabre@nondot.org>2001-11-13 05:46:08 +0000
commit1b600144bda9717804ae3b998c95223947200075 (patch)
treea8414479c9fe65b09506eb08572ad6bfef9c6724 /lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
parent02b5d1386e3386fa6e35a2cbe294a4ce94bd0024 (diff)
Implement some more rand functions for em3d benchmark
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1291 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp')
-rw-r--r--lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
index 8dd7c36326..00549a41be 100644
--- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
+++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
@@ -245,6 +245,21 @@ GenericValue lle_X_drand48(MethodType *M, const vector<GenericValue> &Args) {
return GV;
}
+// long lrand48()
+GenericValue lle_X_lrand48(MethodType *M, const vector<GenericValue> &Args) {
+ assert(Args.size() == 0);
+ GenericValue GV;
+ GV.IntVal = lrand48();
+ return GV;
+}
+
+// void srand48(long)
+GenericValue lle_X_srand48(MethodType *M, const vector<GenericValue> &Args) {
+ assert(Args.size() == 1);
+ srand48(Args[0].IntVal);
+ return GenericValue();
+}
+
// int printf(sbyte *, ...) - a very rough implementation to make output useful.
GenericValue lle_X_printf(MethodType *M, const vector<GenericValue> &Args) {
@@ -338,6 +353,10 @@ void Interpreter::initializeExternalMethods() {
FuncNames["lle_X_malloc"] = lle_X_malloc;
FuncNames["lle_X_free"] = lle_X_free;
FuncNames["lle_X_pow"] = lle_X_pow;
+ FuncNames["lle_X_log"] = lle_X_log;
+ FuncNames["lle_X_drand48"] = lle_X_drand48;
+ FuncNames["lle_X_srand48"] = lle_X_srand48;
+ FuncNames["lle_X_lrand48"] = lle_X_lrand48;
FuncNames["lle_X_sqrt"] = lle_X_sqrt;
FuncNames["lle_X_printf"] = lle_X_printf;
}