Re: [PATCH] D21343: Implement `lcm` and `gcd` from library fundamentals V2

2016-09-22 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added a subscriber: Eugene.Zelenko. Eugene.Zelenko closed this revision. Eugene.Zelenko added a comment. Committed in r276750. https://reviews.llvm.org/D21343 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.o

Re: [PATCH] D21343: Implement `lcm` and `gcd` from library fundamentals V2

2016-07-25 Thread Eric Fiselier via cfe-commits
EricWF accepted this revision. EricWF added a comment. This revision is now accepted and ready to land. LGTM. https://reviews.llvm.org/D21343 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

Re: [PATCH] D21343: Implement `lcm` and `gcd` from library fundamentals V2

2016-07-25 Thread Marshall Clow via cfe-commits
mclow.lists updated this revision to Diff 65463. mclow.lists added a comment. Updated with Eric's constexpr tests. Once this is approved, it will be applied twice - once in ``, and once in `` https://reviews.llvm.org/D21343 Files: include/experimental/numeric test/std/experimental/numeric/

Re: [PATCH] D21343: Implement `lcm` and `gcd` from library fundamentals V2

2016-06-15 Thread Marshall Clow via cfe-commits
mclow.lists marked 8 inline comments as done. mclow.lists added a comment. http://reviews.llvm.org/D21343 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D21343: Implement `lcm` and `gcd` from library fundamentals V2

2016-06-15 Thread Marshall Clow via cfe-commits
mclow.lists updated this revision to Diff 60856. mclow.lists added a comment. Updated based on comments here and elsewhere. - Do the abs once, rather than at every level of recursion - Add tests for `bool`. - Constexpr Also, add an assertion to detect overflow in `lcm`. I have not yet incorpora

Re: [PATCH] D21343: Implement `lcm` and `gcd` from library fundamentals V2

2016-06-14 Thread Eric Fiselier via cfe-commits
EricWF added a comment. Gosh darn it Howard. Your like 10 minutes ahead of me. Here is a constexpr gcd test. https://gist.github.com/EricWF/46ea4489f405ec9f83325a278fe99535 Comment at: include/experimental/numeric:50 @@ +49,3 @@ +struct __abs<_Tp, true> { + _LIBCPP_INLINE

Re: [PATCH] D21343: Implement `lcm` and `gcd` from library fundamentals V2

2016-06-14 Thread Howard Hinnant via cfe-commits
howard.hinnant added a comment. Can't call `std::abs` as it isn't `constexpr`. You'll have to roll your own. http://reviews.llvm.org/D21343 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

Re: [PATCH] D21343: Implement `lcm` and `gcd` from library fundamentals V2

2016-06-14 Thread Eric Fiselier via cfe-commits
EricWF added inline comments. Comment at: include/experimental/numeric:44 @@ +43,3 @@ + +_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL + This should be `_LIBCPP_BEGIN_NAMESPACE_LFTS`. Comment at: include/experimental/numeric:46 @@ +45,3 @@ + +template ::v

Re: [PATCH] D21343: Implement `lcm` and `gcd` from library fundamentals V2

2016-06-14 Thread Howard Hinnant via cfe-commits
howard.hinnant added a comment. I created a top-level `gcd` which did nothing but make everything unsigned and do the abs once, and then called a `__gcd` specialized for unsigned and only one kind of unsigned, and got measurably faster results (about 10%). template constexpr std::enable_i