| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O2 -msha" } */ |
| 3 |
/* { dg-require-effective-target sha } */ |
| 4 |
|
| 5 |
#include "sha-check.h" |
| 6 |
#include "m128-check.h" |
| 7 |
#include <x86intrin.h> |
| 8 |
#include <immintrin.h> |
| 9 |
|
| 10 |
static void |
| 11 |
compute_sha1nexte (int *s1, int *s2, int *r) |
| 12 |
{ |
| 13 |
int tmp = __rold (s1[3], 30); |
| 14 |
|
| 15 |
r[0] = s2[0]; |
| 16 |
r[1] = s2[1]; |
| 17 |
r[2] = s2[2]; |
| 18 |
r[3] = s2[3] + tmp; |
| 19 |
} |
| 20 |
|
| 21 |
static void |
| 22 |
sha_test (void) |
| 23 |
{ |
| 24 |
union128i_d s1, s2, res; |
| 25 |
int res_ref[4]; |
| 26 |
|
| 27 |
s1.x = _mm_set_epi32 (111, 0, 0, 0); |
| 28 |
s2.x = _mm_set_epi32 (222, 333, 444, 555); |
| 29 |
|
| 30 |
res.x = _mm_sha1nexte_epu32 (s1.x, s2.x); |
| 31 |
|
| 32 |
compute_sha1nexte (s1.a, s2.a, res_ref); |
| 33 |
|
| 34 |
if (check_union128i_d (res, res_ref)) |
| 35 |
abort (); |
| 36 |
} |