cppalliance / decimal

A C++14 implementation of IEEE 754 decimal floating point numbers
https://cppalliance.org/decimal/decimal.html
Boost Software License 1.0
17 stars 1 forks source link

Offer fast math macro #627

Closed mborland closed 1 month ago

mborland commented 1 month ago

Closes: #623

Take an apporach similar to intel where isnan, isinf return false but go one step further and just completely remove the branches to maximize speedup. We also have no control over what -ffast-math does. Benchmarks are up to 20% faster without these checks enabled.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 98.83721% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.1%. Comparing base (c53c4db) to head (11a329f). Report is 3 commits behind head on develop.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/cppalliance/decimal/pull/627/graphs/tree.svg?width=650&height=150&src=pr&token=drvY8nnV5S&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance)](https://app.codecov.io/gh/cppalliance/decimal/pull/627?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance) ```diff @@ Coverage Diff @@ ## develop #627 +/- ## ========================================= - Coverage 99.1% 99.1% -0.0% ========================================= Files 214 215 +1 Lines 14794 14880 +86 Branches 1619 1632 +13 ========================================= + Hits 14653 14738 +85 - Misses 141 142 +1 ``` | [Files](https://app.codecov.io/gh/cppalliance/decimal/pull/627?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance) | Coverage Δ | | |---|---|---| | [include/boost/decimal/decimal128.hpp](https://app.codecov.io/gh/cppalliance/decimal/pull/627?src=pr&el=tree&filepath=include%2Fboost%2Fdecimal%2Fdecimal128.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance#diff-aW5jbHVkZS9ib29zdC9kZWNpbWFsL2RlY2ltYWwxMjguaHBw) | `97.6% <100.0%> (+0.1%)` | :arrow_up: | | [include/boost/decimal/decimal32.hpp](https://app.codecov.io/gh/cppalliance/decimal/pull/627?src=pr&el=tree&filepath=include%2Fboost%2Fdecimal%2Fdecimal32.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance#diff-aW5jbHVkZS9ib29zdC9kZWNpbWFsL2RlY2ltYWwzMi5ocHA=) | `99.8% <100.0%> (+0.1%)` | :arrow_up: | | [include/boost/decimal/decimal64.hpp](https://app.codecov.io/gh/cppalliance/decimal/pull/627?src=pr&el=tree&filepath=include%2Fboost%2Fdecimal%2Fdecimal64.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance#diff-aW5jbHVkZS9ib29zdC9kZWNpbWFsL2RlY2ltYWw2NC5ocHA=) | `99.3% <100.0%> (+0.1%)` | :arrow_up: | | [include/boost/decimal/decimal64\_fast.hpp](https://app.codecov.io/gh/cppalliance/decimal/pull/627?src=pr&el=tree&filepath=include%2Fboost%2Fdecimal%2Fdecimal64_fast.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance#diff-aW5jbHVkZS9ib29zdC9kZWNpbWFsL2RlY2ltYWw2NF9mYXN0LmhwcA==) | `99.2% <100.0%> (+0.1%)` | :arrow_up: | | [test/test\_fast\_math.cpp](https://app.codecov.io/gh/cppalliance/decimal/pull/627?src=pr&el=tree&filepath=test%2Ftest_fast_math.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance#diff-dGVzdC90ZXN0X2Zhc3RfbWF0aC5jcHA=) | `100.0% <100.0%> (ø)` | | | [include/boost/decimal/decimal32\_fast.hpp](https://app.codecov.io/gh/cppalliance/decimal/pull/627?src=pr&el=tree&filepath=include%2Fboost%2Fdecimal%2Fdecimal32_fast.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance#diff-aW5jbHVkZS9ib29zdC9kZWNpbWFsL2RlY2ltYWwzMl9mYXN0LmhwcA==) | `97.1% <66.7%> (-0.3%)` | :arrow_down: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/cppalliance/decimal/pull/627?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/cppalliance/decimal/pull/627?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance). Last update [c53c4db...11a329f](https://app.codecov.io/gh/cppalliance/decimal/pull/627?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cppalliance).