summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vdot-3-2.c
blob: 61c7c51f5ec905e68b211962929708fd87a85598 (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/* { dg-do assemble { target { aarch64*-*-* } } } */
/* { dg-require-effective-target stdint_types_mbig_endian } */
/* { dg-require-effective-target arm_v8_2a_i8mm_ok } */
/* { dg-add-options arm_v8_2a_i8mm }  */
/* { dg-additional-options "-mbig-endian -save-temps" } */
/* { dg-final { check-function-bodies "**" "" {-O[^0]} } } */
/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } } */

#include <arm_neon.h>

/* Unsigned-Signed Dot Product instructions.  */

/*
**ufoo:
**	usdot	v0\.2s, v1\.8b, v2\.8b
**	ret
*/
int32x2_t ufoo (int32x2_t r, uint8x8_t x, int8x8_t y)
{
  return vusdot_s32 (r, x, y);
}

/*
**ufooq:
**	usdot	v0\.4s, v1\.16b, v2\.16b
**	ret
*/
int32x4_t ufooq (int32x4_t r, uint8x16_t x, int8x16_t y)
{
  return vusdotq_s32 (r, x, y);
}

/*
**ufoo_lane:
**	usdot	v0\.2s, v1\.8b, v2\.4b\[0\]
**	ret
*/
int32x2_t ufoo_lane (int32x2_t r, uint8x8_t x, int8x8_t y)
{
  return vusdot_lane_s32 (r, x, y, 0);
}

/*
**ufoo_laneq:
**	usdot	v0\.2s, v1\.8b, v2\.4b\[2\]
**	ret
*/
int32x2_t ufoo_laneq (int32x2_t r, uint8x8_t x, int8x16_t y)
{
  return vusdot_laneq_s32 (r, x, y, 2);
}

/*
**ufooq_lane:
**	usdot	v0\.4s, v1\.16b, v2\.4b\[1\]
**	ret
*/
int32x4_t ufooq_lane (int32x4_t r, uint8x16_t x, int8x8_t y)
{
  return vusdotq_lane_s32 (r, x, y, 1);
}

/*
**ufooq_laneq:
**	usdot	v0\.4s, v1\.16b, v2\.4b\[3\]
**	ret
*/
int32x4_t ufooq_laneq (int32x4_t r, uint8x16_t x, int8x16_t y)
{
  return vusdotq_laneq_s32 (r, x, y, 3);
}


/* Signed-Unsigned Dot Product instructions.  */

/*
**sfoo_lane:
**	sudot	v0\.2s, v1\.8b, v2\.4b\[0\]
**	ret
*/
int32x2_t sfoo_lane (int32x2_t r, int8x8_t x, uint8x8_t y)
{
  return vsudot_lane_s32 (r, x, y, 0);
}

/*
**sfoo_laneq:
**	sudot	v0\.2s, v1\.8b, v2\.4b\[2\]
**	ret
*/
int32x2_t sfoo_laneq (int32x2_t r, int8x8_t x, uint8x16_t y)
{
  return vsudot_laneq_s32 (r, x, y, 2);
}

/*
**sfooq_lane:
**	sudot	v0\.4s, v1\.16b, v2\.4b\[1\]
**	ret
*/
int32x4_t sfooq_lane (int32x4_t r, int8x16_t x, uint8x8_t y)
{
  return vsudotq_lane_s32 (r, x, y, 1);
}

/*
**sfooq_laneq:
**	sudot	v0\.4s, v1\.16b, v2\.4b\[3\]
**	ret
*/
int32x4_t sfooq_laneq (int32x4_t r, int8x16_t x, uint8x16_t y)
{
  return vsudotq_laneq_s32 (r, x, y, 3);
}

/*
**ufoo_untied:
**	mov	v0\.8b, v1\.8b
**	usdot	v0\.2s, v2\.8b, v3\.8b
**	ret
*/
int32x2_t ufoo_untied (int32x2_t unused, int32x2_t r, uint8x8_t x, int8x8_t y)
{
  return vusdot_s32 (r, x, y);
}

/*
**ufooq_laneq_untied:
**	mov	v0\.16b, v1\.16b
**	usdot	v0\.4s, v2\.16b, v3\.4b\[3\]
**	ret
*/
int32x4_t ufooq_laneq_untied (int32x2_t unused, int32x4_t r, uint8x16_t x, int8x16_t y)
{
  return vusdotq_laneq_s32 (r, x, y, 3);
}