diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2009-09-01 04:19:44 +0000 | 
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2009-09-01 04:19:44 +0000 | 
| commit | 1c277d0fe896a120766e6df990acdeb9f143e21f (patch) | |
| tree | 96c7fb64a6a710d1617753e649f49815591ccc47 /clang/lib/CodeGen/CGBuiltin.cpp | |
| parent | 33b408a10f0c5fb0909975fb7da7b82c13fa2ffb (diff) | |
| download | bcm5719-llvm-1c277d0fe896a120766e6df990acdeb9f143e21f.tar.gz bcm5719-llvm-1c277d0fe896a120766e6df990acdeb9f143e21f.zip | |
PR4836, part 2: CodeGen for __builtin_isnan.
llvm-svn: 80655
Diffstat (limited to 'clang/lib/CodeGen/CGBuiltin.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGBuiltin.cpp | 5 | 
1 files changed, 5 insertions, 0 deletions
| diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index 9ba5f71f3c6..bfb6be8b791 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -271,6 +271,11 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,      return RValue::get(Builder.CreateZExt(LHS, ConvertType(E->getType()),                                            "tmp"));    } +  case Builtin::BI__builtin_isnan: { +    Value *V = EmitScalarExpr(E->getArg(0)); +    V = Builder.CreateFCmpUNO(V, V, "cmp"); +    return RValue::get(Builder.CreateZExt(V, ConvertType(E->getType()), "tmp")); +  }    case Builtin::BIalloca:    case Builtin::BI__builtin_alloca: {      // FIXME: LLVM IR Should allow alloca with an i64 size! | 

