diff options
author | Ilya Tokar <tokarip@google.com> | 2019-12-12 14:04:56 -0500 |
---|---|---|
committer | Ilya Tokar <tokarip@google.com> | 2019-12-12 17:38:53 -0500 |
commit | 06e99aaf409eff4693c4256e59bb58313052818d (patch) | |
tree | 1d8c03970355f441cd3710ba49c6448db20a0108 /test/packetmath.cpp | |
parent | 73a8d572f5d2e7020b71026d48bfdf99decf8d5b (diff) |
Bug 1785: fix pround on x86 to use the same rounding mode as std::round.
This also adds pset1frombits helper to Packet[24]d.
Makes round ~45% slower for SSE: 1.65µs ± 1% before vs 2.45µs ± 2% after,
stil an order of magnitude faster than scalar version: 33.8µs ± 2%.
Diffstat (limited to 'test/packetmath.cpp')
-rw-r--r-- | test/packetmath.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 00f5f042b..ed0ec7efe 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -518,6 +518,14 @@ template<typename Scalar,typename Packet> void packetmath_real() CHECK_CWISE1_IF(PacketTraits::HasCeil, numext::ceil, internal::pceil); CHECK_CWISE1_IF(PacketTraits::HasFloor, numext::floor, internal::pfloor); + // See bug 1785. + for (int i=0; i<size; ++i) + { + data1[i] = -1.5 + i; + data2[i] = -1.5 + i; + } + CHECK_CWISE1_IF(PacketTraits::HasRound, numext::round, internal::pround); + for (int i=0; i<size; ++i) { data1[i] = internal::random<Scalar>(-1,1); |