aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/packetmath.cpp
diff options
context:
space:
mode:
authorGravatar Ilya Tokar <tokarip@google.com>2019-12-12 14:04:56 -0500
committerGravatar Ilya Tokar <tokarip@google.com>2019-12-12 17:38:53 -0500
commit06e99aaf409eff4693c4256e59bb58313052818d (patch)
tree1d8c03970355f441cd3710ba49c6448db20a0108 /test/packetmath.cpp
parent73a8d572f5d2e7020b71026d48bfdf99decf8d5b (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.cpp8
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);