2015-12-10 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sha1nexte-2.c
blobf0dc6cbc6a460ebf73955be2bb4dbf9ff55cc315
1 /* { dg-do run } */
2 /* { dg-options "-O2 -msha" } */
3 /* { dg-require-effective-target sha } */
5 #include "sha-check.h"
6 #include "m128-check.h"
7 #include <x86intrin.h>
8 #include <immintrin.h>
10 static void
11 compute_sha1nexte (int *s1, int *s2, int *r)
13 int tmp = __rold (s1[3], 30);
15 r[0] = s2[0];
16 r[1] = s2[1];
17 r[2] = s2[2];
18 r[3] = s2[3] + tmp;
21 static void
22 sha_test (void)
24 union128i_d s1, s2, res;
25 int res_ref[4];
27 s1.x = _mm_set_epi32 (111, 0, 0, 0);
28 s2.x = _mm_set_epi32 (222, 333, 444, 555);
30 res.x = _mm_sha1nexte_epu32 (s1.x, s2.x);
32 compute_sha1nexte (s1.a, s2.a, res_ref);
34 if (check_union128i_d (res, res_ref))
35 abort ();