From ae4d9434e23e62d9403e570c20aeb3b8b44a2dd3 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 25 Apr 2014 11:21:18 +0200 Subject: [PATCH] Add unit test for pbroadcast4/2 --- test/packetmath.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/packetmath.cpp b/test/packetmath.cpp index b4815629e..eb2cf7ebe 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -171,6 +171,30 @@ template void packetmath() VERIFY(areApprox(ref, data2, PacketSize) && "internal::pset1"); } + for(int offset=0;offset<3;++offset) + { + for (int i=0; i(&data1[offset], A0, A1, A2, A3); + internal::pstore(data2+0*PacketSize, A0); + internal::pstore(data2+1*PacketSize, A1); + internal::pstore(data2+2*PacketSize, A2); + internal::pstore(data2+3*PacketSize, A3); + VERIFY(areApprox(ref, data2, 4*PacketSize) && "internal::pbroadcast4"); + } + + for(int offset=0;offset<3;++offset) + { + for (int i=0; i(&data1[offset], A0, A1); + internal::pstore(data2+0*PacketSize, A0); + internal::pstore(data2+1*PacketSize, A1); + VERIFY(areApprox(ref, data2, 2*PacketSize) && "internal::pbroadcast2"); + } + VERIFY(internal::isApprox(data1[0], internal::pfirst(internal::pload(data1))) && "internal::pfirst"); if(PacketSize>1)