summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/arm/neon-vext.c
blob: 4a012a996a81ddbee528ac9d7e247a8a0ab25494 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/* { dg-do compile } */
/* { dg-require-effective-target arm_neon_ok } */
/* { dg-require-effective-target arm_little_endian } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_neon } */

#include <arm_neon.h>

uint8x8_t
tst_vext_u8 (uint8x8_t __a, uint8x8_t __b)
{
  uint8x8_t __mask1 = {2, 3, 4, 5, 6, 7, 8, 9};

  return __builtin_shuffle ( __a, __b, __mask1) ;
}

uint8x8_t
tst_vext_u8_rotate (uint8x8_t __a)
{
  uint8x8_t __mask1 = {2, 3, 4, 5, 6, 7, 0, 1};
  return __builtin_shuffle ( __a, __mask1) ;
}

uint16x4_t
tst_vext_u16 (uint16x4_t __a, uint16x4_t __b)
{
  uint16x4_t __mask1 = {2, 3, 4, 5};
  return __builtin_shuffle ( __a, __b, __mask1) ;
}

uint16x4_t
tst_vext_u16_rotate (uint16x4_t __a)
{
  uint16x4_t __mask1 = {2, 3, 0, 1};
  return __builtin_shuffle ( __a, __mask1) ;
}

uint32x2_t
tst_vext_u32 (uint32x2_t __a, uint32x2_t __b)
{
  uint32x2_t __mask1 = {1, 2};
  return __builtin_shuffle ( __a, __b, __mask1) ;
}

/* This one is mapped into vrev64.32.  */
uint32x2_t
tst_vext_u32_rotate (uint32x2_t __a)
{
  uint32x2_t __mask1 = {1, 0};
  return __builtin_shuffle ( __a, __mask1) ;
}

uint8x16_t
tst_vextq_u8 (uint8x16_t __a, uint8x16_t __b)
{
  uint8x16_t __mask1 = {4, 5, 6, 7, 8, 9, 10, 11,
			12, 13, 14, 15, 16, 17, 18, 19};
  return __builtin_shuffle ( __a, __b, __mask1) ;
}

uint8x16_t
tst_vextq_u8_rotate (uint8x16_t __a)
{
  uint8x16_t __mask1 = {4, 5, 6, 7, 8, 9, 10, 11,
			12, 13, 14, 15, 0, 1, 2, 3};
  return __builtin_shuffle ( __a, __mask1) ;
}

uint16x8_t
tst_vextq_u16 (uint16x8_t __a, uint16x8_t __b)
{
  uint16x8_t __mask1 = {2, 3, 4, 5, 6, 7, 8, 9};
  return __builtin_shuffle ( __a, __b, __mask1) ;
}

uint16x8_t
tst_vextq_u16_rotate (uint16x8_t __a)
{
  uint16x8_t __mask1 = {2, 3, 4, 5, 6, 7, 0, 1};
  return __builtin_shuffle ( __a, __mask1) ;
}

uint32x4_t
tst_vextq_u32 (uint32x4_t __a, uint32x4_t __b)
{
  uint32x4_t __mask1 = {1, 2, 3, 4};
  return __builtin_shuffle ( __a, __b, __mask1) ;
}

uint32x4_t
tst_vextq_u32_rotate (uint32x4_t __a)
{
  uint32x4_t __mask1 = {1, 2, 3, 0};
  return __builtin_shuffle ( __a, __mask1) ;
}

uint64x2_t
tst_vextq_u64 (uint64x2_t __a, uint64x2_t __b)
{
  uint64x2_t __mask1 = {1, 2};
  return __builtin_shuffle ( __a, __b, __mask1) ;
}

uint64x2_t
tst_vextq_u64_rotate (uint64x2_t __a)
{
  uint64x2_t __mask1 = {1, 0};
  return __builtin_shuffle ( __a, __mask1) ;
}

/* { dg-final {scan-assembler-times "vext\.8\\t" 4} }  */
/* { dg-final {scan-assembler-times "vext\.16\\t" 4} }  */
/* { dg-final {scan-assembler-times "vext\.32\\t" 3} }  */
/* { dg-final {scan-assembler-times "vrev64\.32\\t" 1} }  */
/* { dg-final {scan-assembler-times "vext\.64\\t" 2} }  */