This revision was automatically updated to reflect the committed changes.
Closed by commit rL318093: [CodeGen] fix const-ness of cbrt and fma (authored
by spatel).
Changed prior to commit:
https://reviews.llvm.org/D39641?vs=122584=122727#toc
Repository:
rL LLVM
efriedma accepted this revision.
efriedma added a comment.
LGTM
https://reviews.llvm.org/D39641
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
spatel updated this revision to Diff 122584.
spatel marked an inline comment as done.
spatel added a comment.
Patch updated:
1. Fix predicate for detecting MSVC - isOSMSVCRT().
2. Use switch on BuiltinID instead of string matching for "fma".
https://reviews.llvm.org/D39641
Files:
efriedma added inline comments.
Comment at: lib/Sema/SemaDecl.cpp:12853
+ const llvm::Triple = Context.getTargetInfo().getTriple();
+ if ((Trip.isGNUEnvironment() || Trip.isKnownWindowsMSVCEnvironment()) &&
+ (Name->isStr("fma") || Name->isStr("fmaf") ||
spatel updated this revision to Diff 122545.
spatel added a comment.
Patch updated:
cbrt() is always const. fma() is always const with GNU or Win+MSVC.
https://reviews.llvm.org/D39641
Files:
include/clang/Basic/Builtins.def
lib/CodeGen/CGBuiltin.cpp
lib/Sema/SemaDecl.cpp
efriedma added a comment.
cbrt() can't underflow; that's not how cube roots work. If 0 x.
See also the definition of rootn() in IEEE 754 (which specifies no exceptions
for n=3).
For fma(), sure, I guess we could whitelist glibc and msvcrt, if you're worried
there's some
spatel added a comment.
Based on the comments in https://reviews.llvm.org/D39611, I think we have to
change this (although I'd be happy to be wrong).
1. cbrt() can underflow and could set errno to ERANGE.
2. fma() can overflow or underflow and set errno to ERANGE.
We could still make an
spatel updated this revision to Diff 121898.
spatel added a comment.
Patch updated - no code or functional changes from the last rev.
I split the and test files up, so I can update those
independently and not incur svn conflicts.
https://reviews.llvm.org/D39641
Files:
efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.
LGTM, but wait a couple days before you commit to see if anyone else wants to
comment.
https://reviews.llvm.org/D39641
___
cfe-commits
spatel created this revision.
Herald added a subscriber: mcrosier.
Splitting cbrt and fma off from https://reviews.llvm.org/D39611, so we can deal
with complex.h separately.
I've also gone ahead with a 'fix' for the fma case in
CodeGenFunction::EmitBuiltinExpr(). But as noted previously,
10 matches
Mail list logo