summaryrefslogtreecommitdiff
path: root/lib/msan/tests
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-06-18 12:02:29 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-06-18 12:02:29 +0000
commit55efb03eed0b37bc415cc1a56341b45d16e44cb7 (patch)
tree899efe282deed5d4ce5235963f6ee6b149f04766 /lib/msan/tests
parent81e7ea500d79e4e1a8ceb6f8446d4f46d029e9fa (diff)
[msan] Handle X86 *.psad.* and *.pmadd.* intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@211156 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan/tests')
-rw-r--r--lib/msan/tests/msan_test.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/msan/tests/msan_test.cc b/lib/msan/tests/msan_test.cc
index f1fca19c9..438a74af5 100644
--- a/lib/msan/tests/msan_test.cc
+++ b/lib/msan/tests/msan_test.cc
@@ -3526,11 +3526,13 @@ TEST(MemorySanitizer, UnalignedStore64_precise2) {
}
namespace {
+typedef U1 V16x8 __attribute__((__vector_size__(16)));
typedef U2 V8x16 __attribute__((__vector_size__(16)));
typedef U4 V4x32 __attribute__((__vector_size__(16)));
typedef U8 V2x64 __attribute__((__vector_size__(16)));
typedef U4 V8x32 __attribute__((__vector_size__(32)));
typedef U8 V4x64 __attribute__((__vector_size__(32)));
+typedef U4 V2x32 __attribute__((__vector_size__(8)));
typedef U2 V4x16 __attribute__((__vector_size__(8)));
typedef U1 V8x8 __attribute__((__vector_size__(8)));
@@ -3661,6 +3663,29 @@ TEST(VectorPackTest, mmx_packuswb) {
EXPECT_EQ(c[7], U1_max);
}
+TEST(VectorSadTest, sse2_psad_bw) {
+ V16x8 a = {Poisoned<U1>(), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+ V16x8 b = {100, 101, 102, 103, 104, 105, 106, 107,
+ 108, 109, 110, 111, 112, 113, 114, 115};
+ V2x64 c = _mm_sad_epu8(a, b);
+
+ EXPECT_POISONED(c[0]);
+ EXPECT_NOT_POISONED(c[1]);
+
+ EXPECT_EQ(800U, c[1]);
+}
+
+TEST(VectorMaddTest, mmx_pmadd_wd) {
+ V4x16 a = {Poisoned<U2>(), 1, 2, 3};
+ V4x16 b = {100, 101, 102, 103};
+ V2x32 c = _mm_madd_pi16(a, b);
+
+ EXPECT_POISONED(c[0]);
+ EXPECT_NOT_POISONED(c[1]);
+
+ EXPECT_EQ((unsigned)(2 * 102 + 3 * 103), c[1]);
+}
+
TEST(MemorySanitizerDr, StoreInDSOTest) {
if (!__msan_has_dynamic_component()) return;
char* s = new char[10];