Skip to content

Commit

Permalink
Merge pull request JuliaLang#7883 from JuliaLang/kf/7868
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Aug 7, 2014
2 parents a537bd8 + 45b0106 commit 04034ca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/intrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,15 @@ static Value *emit_intrinsic(intrinsic f, jl_value_t **args, size_t nargs,
HANDLE(smod_int,2)
return emit_smod(JL_INT(x), JL_INT(y), ctx);

// Implements IEEE negate. Unfortunately there is no compliant way
// to implement this in LLVM 3.4, though there are two different idioms
// that do the correct thing on LLVM <= 3.3 and >= 3.5 respectively.
// See issue #7868
#ifdef LLVM35
HANDLE(neg_float,1) return builder.CreateFSub(ConstantFP::get(FT(t), -0.0), FP(x));
#else
HANDLE(neg_float,1) return builder.CreateFMul(ConstantFP::get(FT(t), -1.0), FP(x));
#endif
HANDLE(add_float,2) return builder.CreateFAdd(FP(x), FP(y));
HANDLE(sub_float,2) return builder.CreateFSub(FP(x), FP(y));
HANDLE(mul_float,2) return builder.CreateFMul(FP(x), FP(y));
Expand Down

0 comments on commit 04034ca

Please sign in to comment.