| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2" } */ |
| 3 |
|
| 4 |
#include <arm_neon.h> |
| 5 |
|
| 6 |
#pragma GCC target "+sha3" |
| 7 |
|
| 8 |
static inline uint64x2_t |
| 9 |
rotr64_vec(uint64x2_t x, const int b) |
| 10 |
{ |
| 11 |
int64x2_t neg_b = vdupq_n_s64(-b); |
| 12 |
int64x2_t left_shift = vsubq_s64(vdupq_n_s64(64), vdupq_n_s64(b)); |
| 13 |
|
| 14 |
uint64x2_t right_shifted = vshlq_u64(x, neg_b); |
| 15 |
uint64x2_t left_shifted = vshlq_u64(x, left_shift); |
| 16 |
|
| 17 |
return vorrq_u64(right_shifted, left_shifted); |
| 18 |
} |
| 19 |
|
| 20 |
void G( |
| 21 |
int64_t* v, |
| 22 |
int64x2_t& m1_01, |
| 23 |
int64x2_t& m1_23, |
| 24 |
int64x2_t& m2_01, |
| 25 |
int64x2_t& m2_23 |
| 26 |
) { |
| 27 |
int64x2_t vd01 = {v[12],v[13]}; |
| 28 |
vd01 = veorq_s64(vd01, m1_01); |
| 29 |
vd01 = vreinterpretq_s64_u64(rotr64_vec( vreinterpretq_u64_s64 (vd01), 32)); |
| 30 |
v[12] = vgetq_lane_s64(vd01, 0); |
| 31 |
} |
| 32 |
|
| 33 |
/* { dg-final { scan-assembler {\txar\tv[0-9]+\.2d, v[0-9]+\.2d, v[0-9]+\.2d, 32\n} } } */ |
| 34 |
|