Fix rint SSE/NEON again, using optimization barrier.

This is a new version of !423, which failed for MSVC.

Defined `EIGEN_OPTIMIZATION_BARRIER(X)` that uses inline assembly to
prevent operations involving `X` from crossing that barrier. Should
work on most `GNUC` compatible compilers (MSVC doesn't seem to need
this). This is a modified version adapted from what was used in
`psincos_float` and tested on more platforms
(see #1674, https://godbolt.org/z/73ezTG).

Modified `rint` to use the barrier to prevent the add/subtract rounding
trick from being optimized away.

Also fixed an edge case for large inputs that get bumped up a power of two
and ends up rounding away more than just the fractional part.  If we are
over `2^digits` then just return the input.  This edge case was missed in
the test since the test was comparing approximate equality, which was still
satisfied.  Adding a strict equality option catches it.
6 files changed
tree: 9137169da76e43ef4908ab87dc5990d801c48eda
  1. bench/
  2. blas/
  3. ci/
  4. cmake/
  5. debug/
  6. demos/
  7. doc/
  8. Eigen/
  9. failtest/
  10. lapack/
  11. scripts/
  12. test/
  13. unsupported/
  14. .gitignore
  15. .gitlab-ci.yml
  16. .hgeol
  17. CMakeLists.txt
  18. COPYING.APACHE
  19. COPYING.BSD
  20. COPYING.GPL
  21. COPYING.LGPL
  22. COPYING.MINPACK
  23. COPYING.MPL2
  24. COPYING.README
  25. CTestConfig.cmake
  26. CTestCustom.cmake.in
  27. eigen3.pc.in
  28. INSTALL
  29. README.md
  30. signature_of_eigen3_matrix_library
README.md

Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.

For more information go to http://eigen.tuxfamily.org/.

For pull request, bug reports, and feature requests, go to https://gitlab.com/libeigen/eigen.