Simplify range-op shift mask generation
[official-gcc.git] / gcc / testsuite / gcc.target / arm / crypto-vsha1cq_u32.c
blob0cadd19c4dccad85294d9bdc14d0050115ab6fd4
1 /* { dg-do compile } */
2 /* { dg-require-effective-target arm_crypto_ok } */
3 /* { dg-add-options arm_crypto } */
4 /* { dg-additional-options "-O3" } */
6 #include "arm_neon.h"
8 uint32_t foo (void)
11 uint32_t hash = 0xdeadbeef;
12 uint32x4_t a = {0, 1, 2, 3};
13 uint32x4_t b = {3, 2, 1, 0};
15 uint32x4_t res = vsha1cq_u32 (a, hash, b);
16 return res[0];
19 #define GET_LANE(lane) \
20 uint32x4_t foo_lane##lane (uint32x4_t val,uint32x4_t a, uint32x4_t b)\
21 { \
22 return vsha1cq_u32 (a, vgetq_lane_u32 (val, lane), b); \
25 #define TEST_SHA1C_VEC_SELECT(FUNC) \
26 FUNC (0) \
27 FUNC (1) \
28 FUNC (2) \
29 FUNC (3) \
31 TEST_SHA1C_VEC_SELECT (GET_LANE)
33 /* { dg-final { scan-assembler-times {sha1c.32\tq[0-9]+, q[0-9]+} 5 } } */
34 /* { dg-final { scan-assembler-times {vdup.32\tq[0-9]+, r[0-9]+} 4 } } */
35 /* { dg-final { scan-assembler-times {vmov.32\tr[0-9]+, d[0-9]+\[[0-9]+\]+} 3 } } */