commit | e72dfeb8b9fa5662831b5d0bb9d132521f9173dd | [log] [tgz] |
---|---|---|
author | Antonio Sanchez <cantonios@google.com> | Wed Mar 03 09:41:46 2021 -0800 |
committer | Antonio Sanchez <cantonios@google.com> | Wed Mar 03 09:41:46 2021 -0800 |
tree | bdc7a7bd7f8fa13a65bd71897282bcc4e3bc87d5 | |
parent | 199c5f2b47eb1f8e5a2d20e60f07e97cd95a6ba6 [diff] |
Fix rint for SSE/NEON. It seems *sometimes* with aggressive optimizations the combination `psub(padd(a, b), b)` trick to force rounding is compiled away. Here we replace with inline assembly to prevent this (I tried `volatile`, but that leads to additional loads from memory). Also fixed an edge case for large inputs `a` where adding `b` bumps the value 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.
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.