diff options
author | Chris Lattner <sabre@nondot.org> | 2002-12-20 04:18:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-12-20 04:18:13 +0000 |
commit | dbcda22bf31e60e197f526fd3546cd196386937a (patch) | |
tree | 5b253bf9bc70b703f3c8049c20b33e7ed72e722f /lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | |
parent | 2560bd8cdb3d721a8e6ddf8663b4d402b22b3d07 (diff) |
Add support for isnan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5111 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp')
-rw-r--r-- | lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index 89f64b1b9b..79e730f0ec 100644 --- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -272,6 +272,14 @@ GenericValue lle_X_log(FunctionType *M, const vector<GenericValue> &Args) { return GV; } +// int isnan(double value); +GenericValue lle_X_isnan(FunctionType *F, const vector<GenericValue> &Args) { + assert(Args.size() == 1); + GenericValue GV; + GV.IntVal = isnan(Args[0].DoubleVal); + return GV; +} + // double floor(double) GenericValue lle_X_floor(FunctionType *M, const vector<GenericValue> &Args) { assert(Args.size() == 1); @@ -627,6 +635,7 @@ void Interpreter::initializeExternalMethods() { FuncNames["lle_X_pow"] = lle_X_pow; FuncNames["lle_X_exp"] = lle_X_exp; FuncNames["lle_X_log"] = lle_X_log; + FuncNames["lle_X_isnan"] = lle_X_isnan; FuncNames["lle_X_floor"] = lle_X_floor; FuncNames["lle_X_srand"] = lle_X_srand; FuncNames["lle_X_drand48"] = lle_X_drand48; |