1*bc921b27SJoseph Myers /* Test pcmpistri instruction. */ 2*bc921b27SJoseph Myers 3*bc921b27SJoseph Myers #include <nmmintrin.h> 4*bc921b27SJoseph Myers #include <stdio.h> 5*bc921b27SJoseph Myers 6*bc921b27SJoseph Myers union u { 7*bc921b27SJoseph Myers __m128i x; 8*bc921b27SJoseph Myers unsigned char uc[16]; 9*bc921b27SJoseph Myers }; 10*bc921b27SJoseph Myers 11*bc921b27SJoseph Myers union u s0 = { .uc = { 0 } }; 12*bc921b27SJoseph Myers union u s1 = { .uc = "abcdefghijklmnop" }; 13*bc921b27SJoseph Myers union u s2 = { .uc = "bcdefghijklmnopa" }; 14*bc921b27SJoseph Myers union u s3 = { .uc = "bcdefghijklmnab" }; 15*bc921b27SJoseph Myers 16*bc921b27SJoseph Myers int 17*bc921b27SJoseph Myers main(void) 18*bc921b27SJoseph Myers { 19*bc921b27SJoseph Myers int ret = 0; 20*bc921b27SJoseph Myers if (_mm_cmpistri(s0.x, s0.x, 0x4c) != 15) { 21*bc921b27SJoseph Myers printf("FAIL: pcmpistri test 1\n"); 22*bc921b27SJoseph Myers ret = 1; 23*bc921b27SJoseph Myers } 24*bc921b27SJoseph Myers if (_mm_cmpistri(s1.x, s2.x, 0x4c) != 15) { 25*bc921b27SJoseph Myers printf("FAIL: pcmpistri test 2\n"); 26*bc921b27SJoseph Myers ret = 1; 27*bc921b27SJoseph Myers } 28*bc921b27SJoseph Myers if (_mm_cmpistri(s1.x, s3.x, 0x4c) != 16) { 29*bc921b27SJoseph Myers printf("FAIL: pcmpistri test 3\n"); 30*bc921b27SJoseph Myers ret = 1; 31*bc921b27SJoseph Myers } 32*bc921b27SJoseph Myers return ret; 33*bc921b27SJoseph Myers } 34