summaryrefslogtreecommitdiff
path: root/gcc/config/aarch64/aarch64-simd-builtins.def
blob: d441417b00ff084586f441d10960ad1f699e8bdf (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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235

/* In the list below, the BUILTIN_<ITERATOR> macros should
   correspond to the iterator used to construct the instruction's
   patterns in aarch64-simd.md.  A helpful idiom to follow when
   adding new builtins is to add a line for each pattern in the md
   file.  Thus, ADDP, which has one pattern defined for the VD_BHSI
   iterator, and one for DImode, has two entries below.  */

  BUILTIN_VD_RE (CREATE, create)
  BUILTIN_VQ_S (GETLANE, get_lane_signed)
  BUILTIN_VDQ (GETLANE, get_lane_unsigned)
  BUILTIN_VDQF (GETLANE, get_lane)
  VAR1 (GETLANE, get_lane, di)
  BUILTIN_VDC (COMBINE, combine)
  BUILTIN_VB (BINOP, pmul)
  BUILTIN_VDQF (UNOP, sqrt)
  BUILTIN_VD_BHSI (BINOP, addp)
  VAR1 (UNOP, addp, di)

  BUILTIN_VD_RE (REINTERP, reinterpretdi)
  BUILTIN_VDC (REINTERP, reinterpretv8qi)
  BUILTIN_VDC (REINTERP, reinterpretv4hi)
  BUILTIN_VDC (REINTERP, reinterpretv2si)
  BUILTIN_VDC (REINTERP, reinterpretv2sf)
  BUILTIN_VQ (REINTERP, reinterpretv16qi)
  BUILTIN_VQ (REINTERP, reinterpretv8hi)
  BUILTIN_VQ (REINTERP, reinterpretv4si)
  BUILTIN_VQ (REINTERP, reinterpretv4sf)
  BUILTIN_VQ (REINTERP, reinterpretv2di)
  BUILTIN_VQ (REINTERP, reinterpretv2df)

  BUILTIN_VDQ_I (BINOP, dup_lane)
  BUILTIN_SDQ_I (BINOP, dup_lane)
  /* Implemented by aarch64_<sur>q<r>shl<mode>.  */
  BUILTIN_VSDQ_I (BINOP, sqshl)
  BUILTIN_VSDQ_I (BINOP, uqshl)
  BUILTIN_VSDQ_I (BINOP, sqrshl)
  BUILTIN_VSDQ_I (BINOP, uqrshl)
  /* Implemented by aarch64_<su_optab><optab><mode>.  */
  BUILTIN_VSDQ_I (BINOP, sqadd)
  BUILTIN_VSDQ_I (BINOP, uqadd)
  BUILTIN_VSDQ_I (BINOP, sqsub)
  BUILTIN_VSDQ_I (BINOP, uqsub)
  /* Implemented by aarch64_<sur>qadd<mode>.  */
  BUILTIN_VSDQ_I (BINOP, suqadd)
  BUILTIN_VSDQ_I (BINOP, usqadd)

  /* Implemented by aarch64_get_dreg<VSTRUCT:mode><VDC:mode>.  */
  BUILTIN_VDC (GETLANE, get_dregoi)
  BUILTIN_VDC (GETLANE, get_dregci)
  BUILTIN_VDC (GETLANE, get_dregxi)
  /* Implemented by aarch64_get_qreg<VSTRUCT:mode><VQ:mode>.  */
  BUILTIN_VQ (GETLANE, get_qregoi)
  BUILTIN_VQ (GETLANE, get_qregci)
  BUILTIN_VQ (GETLANE, get_qregxi)
  /* Implemented by aarch64_set_qreg<VSTRUCT:mode><VQ:mode>.  */
  BUILTIN_VQ (SETLANE, set_qregoi)
  BUILTIN_VQ (SETLANE, set_qregci)
  BUILTIN_VQ (SETLANE, set_qregxi)
  /* Implemented by aarch64_ld<VSTRUCT:nregs><VDC:mode>.  */
  BUILTIN_VDC (LOADSTRUCT, ld2)
  BUILTIN_VDC (LOADSTRUCT, ld3)
  BUILTIN_VDC (LOADSTRUCT, ld4)
  /* Implemented by aarch64_ld<VSTRUCT:nregs><VQ:mode>.  */
  BUILTIN_VQ (LOADSTRUCT, ld2)
  BUILTIN_VQ (LOADSTRUCT, ld3)
  BUILTIN_VQ (LOADSTRUCT, ld4)
  /* Implemented by aarch64_st<VSTRUCT:nregs><VDC:mode>.  */
  BUILTIN_VDC (STORESTRUCT, st2)
  BUILTIN_VDC (STORESTRUCT, st3)
  BUILTIN_VDC (STORESTRUCT, st4)
  /* Implemented by aarch64_st<VSTRUCT:nregs><VQ:mode>.  */
  BUILTIN_VQ (STORESTRUCT, st2)
  BUILTIN_VQ (STORESTRUCT, st3)
  BUILTIN_VQ (STORESTRUCT, st4)

  BUILTIN_VQW (BINOP, saddl2)
  BUILTIN_VQW (BINOP, uaddl2)
  BUILTIN_VQW (BINOP, ssubl2)
  BUILTIN_VQW (BINOP, usubl2)
  BUILTIN_VQW (BINOP, saddw2)
  BUILTIN_VQW (BINOP, uaddw2)
  BUILTIN_VQW (BINOP, ssubw2)
  BUILTIN_VQW (BINOP, usubw2)
  /* Implemented by aarch64_<ANY_EXTEND:su><ADDSUB:optab>l<mode>.  */
  BUILTIN_VDW (BINOP, saddl)
  BUILTIN_VDW (BINOP, uaddl)
  BUILTIN_VDW (BINOP, ssubl)
  BUILTIN_VDW (BINOP, usubl)
  /* Implemented by aarch64_<ANY_EXTEND:su><ADDSUB:optab>w<mode>.  */
  BUILTIN_VDW (BINOP, saddw)
  BUILTIN_VDW (BINOP, uaddw)
  BUILTIN_VDW (BINOP, ssubw)
  BUILTIN_VDW (BINOP, usubw)
  /* Implemented by aarch64_<sur>h<addsub><mode>.  */
  BUILTIN_VQ_S (BINOP, shadd)
  BUILTIN_VQ_S (BINOP, uhadd)
  BUILTIN_VQ_S (BINOP, srhadd)
  BUILTIN_VQ_S (BINOP, urhadd)
  /* Implemented by aarch64_<sur><addsub>hn<mode>.  */
  BUILTIN_VQN (BINOP, addhn)
  BUILTIN_VQN (BINOP, raddhn)
  /* Implemented by aarch64_<sur><addsub>hn2<mode>.  */
  BUILTIN_VQN (TERNOP, addhn2)
  BUILTIN_VQN (TERNOP, raddhn2)

  BUILTIN_VSQN_HSDI (UNOP, sqmovun)
  /* Implemented by aarch64_<sur>qmovn<mode>.  */
  BUILTIN_VSQN_HSDI (UNOP, sqmovn)
  BUILTIN_VSQN_HSDI (UNOP, uqmovn)
  /* Implemented by aarch64_s<optab><mode>.  */
  BUILTIN_VSDQ_I_BHSI (UNOP, sqabs)
  BUILTIN_VSDQ_I_BHSI (UNOP, sqneg)

  BUILTIN_VSD_HSI (QUADOP, sqdmlal_lane)
  BUILTIN_VSD_HSI (QUADOP, sqdmlsl_lane)
  BUILTIN_VSD_HSI (QUADOP, sqdmlal_laneq)
  BUILTIN_VSD_HSI (QUADOP, sqdmlsl_laneq)
  BUILTIN_VQ_HSI (TERNOP, sqdmlal2)
  BUILTIN_VQ_HSI (TERNOP, sqdmlsl2)
  BUILTIN_VQ_HSI (QUADOP, sqdmlal2_lane)
  BUILTIN_VQ_HSI (QUADOP, sqdmlsl2_lane)
  BUILTIN_VQ_HSI (QUADOP, sqdmlal2_laneq)
  BUILTIN_VQ_HSI (QUADOP, sqdmlsl2_laneq)
  BUILTIN_VQ_HSI (TERNOP, sqdmlal2_n)
  BUILTIN_VQ_HSI (TERNOP, sqdmlsl2_n)
  /* Implemented by aarch64_sqdml<SBINQOPS:as>l<mode>.  */
  BUILTIN_VSD_HSI (TERNOP, sqdmlal)
  BUILTIN_VSD_HSI (TERNOP, sqdmlsl)
  /* Implemented by aarch64_sqdml<SBINQOPS:as>l_n<mode>.  */
  BUILTIN_VD_HSI (TERNOP, sqdmlal_n)
  BUILTIN_VD_HSI (TERNOP, sqdmlsl_n)

  BUILTIN_VSD_HSI (BINOP, sqdmull)
  BUILTIN_VSD_HSI (TERNOP, sqdmull_lane)
  BUILTIN_VD_HSI (TERNOP, sqdmull_laneq)
  BUILTIN_VD_HSI (BINOP, sqdmull_n)
  BUILTIN_VQ_HSI (BINOP, sqdmull2)
  BUILTIN_VQ_HSI (TERNOP, sqdmull2_lane)
  BUILTIN_VQ_HSI (TERNOP, sqdmull2_laneq)
  BUILTIN_VQ_HSI (BINOP, sqdmull2_n)
  /* Implemented by aarch64_sq<r>dmulh<mode>.  */
  BUILTIN_VSDQ_HSI (BINOP, sqdmulh)
  BUILTIN_VSDQ_HSI (BINOP, sqrdmulh)
  /* Implemented by aarch64_sq<r>dmulh_lane<mode>.  */
  BUILTIN_VSDQ_HSI (TERNOP, sqdmulh_lane)
  BUILTIN_VSDQ_HSI (TERNOP, sqrdmulh_lane)

  BUILTIN_VSDQ_I_DI (BINOP, sshl_n)
  BUILTIN_VSDQ_I_DI (BINOP, ushl_n)
  /* Implemented by aarch64_<sur>shl<mode>.  */
  BUILTIN_VSDQ_I_DI (BINOP, sshl)
  BUILTIN_VSDQ_I_DI (BINOP, ushl)
  BUILTIN_VSDQ_I_DI (BINOP, srshl)
  BUILTIN_VSDQ_I_DI (BINOP, urshl)

  BUILTIN_VSDQ_I_DI (SHIFTIMM, sshr_n)
  BUILTIN_VSDQ_I_DI (SHIFTIMM, ushr_n)
  /* Implemented by aarch64_<sur>shr_n<mode>.  */
  BUILTIN_VSDQ_I_DI (SHIFTIMM, srshr_n)
  BUILTIN_VSDQ_I_DI (SHIFTIMM, urshr_n)
  /* Implemented by aarch64_<sur>sra_n<mode>.  */
  BUILTIN_VSDQ_I_DI (SHIFTACC, ssra_n)
  BUILTIN_VSDQ_I_DI (SHIFTACC, usra_n)
  BUILTIN_VSDQ_I_DI (SHIFTACC, srsra_n)
  BUILTIN_VSDQ_I_DI (SHIFTACC, ursra_n)
  /* Implemented by aarch64_<sur>shll_n<mode>.  */
  BUILTIN_VDW (SHIFTIMM, sshll_n)
  BUILTIN_VDW (SHIFTIMM, ushll_n)
  /* Implemented by aarch64_<sur>shll2_n<mode>.  */
  BUILTIN_VQW (SHIFTIMM, sshll2_n)
  BUILTIN_VQW (SHIFTIMM, ushll2_n)
  /* Implemented by aarch64_<sur>q<r>shr<u>n_n<mode>.  */
  BUILTIN_VSQN_HSDI (SHIFTIMM, sqshrun_n)
  BUILTIN_VSQN_HSDI (SHIFTIMM, sqrshrun_n)
  BUILTIN_VSQN_HSDI (SHIFTIMM, sqshrn_n)
  BUILTIN_VSQN_HSDI (SHIFTIMM, uqshrn_n)
  BUILTIN_VSQN_HSDI (SHIFTIMM, sqrshrn_n)
  BUILTIN_VSQN_HSDI (SHIFTIMM, uqrshrn_n)
  /* Implemented by aarch64_<sur>s<lr>i_n<mode>.  */
  BUILTIN_VSDQ_I_DI (SHIFTINSERT, ssri_n)
  BUILTIN_VSDQ_I_DI (SHIFTINSERT, usri_n)
  BUILTIN_VSDQ_I_DI (SHIFTINSERT, ssli_n)
  BUILTIN_VSDQ_I_DI (SHIFTINSERT, usli_n)
  /* Implemented by aarch64_<sur>qshl<u>_n<mode>.  */
  BUILTIN_VSDQ_I (SHIFTIMM, sqshlu_n)
  BUILTIN_VSDQ_I (SHIFTIMM, sqshl_n)
  BUILTIN_VSDQ_I (SHIFTIMM, uqshl_n)

  /* Implemented by aarch64_cm<cmp><mode>.  */
  BUILTIN_VSDQ_I_DI (BINOP, cmeq)
  BUILTIN_VSDQ_I_DI (BINOP, cmge)
  BUILTIN_VSDQ_I_DI (BINOP, cmgt)
  BUILTIN_VSDQ_I_DI (BINOP, cmle)
  BUILTIN_VSDQ_I_DI (BINOP, cmlt)
  /* Implemented by aarch64_cm<cmp><mode>.  */
  BUILTIN_VSDQ_I_DI (BINOP, cmhs)
  BUILTIN_VSDQ_I_DI (BINOP, cmhi)
  BUILTIN_VSDQ_I_DI (BINOP, cmtst)

  /* Implemented by aarch64_<fmaxmin><mode>.  */
  BUILTIN_VDQF (BINOP, fmax)
  BUILTIN_VDQF (BINOP, fmin)
  /* Implemented by aarch64_<maxmin><mode>.  */
  BUILTIN_VDQ_BHSI (BINOP, smax)
  BUILTIN_VDQ_BHSI (BINOP, smin)
  BUILTIN_VDQ_BHSI (BINOP, umax)
  BUILTIN_VDQ_BHSI (BINOP, umin)

  /* Implemented by aarch64_frint<frint_suffix><mode>.  */
  BUILTIN_VDQF (UNOP, frintz)
  BUILTIN_VDQF (UNOP, frintp)
  BUILTIN_VDQF (UNOP, frintm)
  BUILTIN_VDQF (UNOP, frinti)
  BUILTIN_VDQF (UNOP, frintx)
  BUILTIN_VDQF (UNOP, frinta)

  /* Implemented by aarch64_fcvt<frint_suffix><su><mode>.  */
  BUILTIN_VDQF (UNOP, fcvtzs)
  BUILTIN_VDQF (UNOP, fcvtzu)
  BUILTIN_VDQF (UNOP, fcvtas)
  BUILTIN_VDQF (UNOP, fcvtau)
  BUILTIN_VDQF (UNOP, fcvtps)
  BUILTIN_VDQF (UNOP, fcvtpu)
  BUILTIN_VDQF (UNOP, fcvtms)
  BUILTIN_VDQF (UNOP, fcvtmu)

  /* Implemented by
     aarch64_<PERMUTE:perm_insn><PERMUTE:perm_hilo><mode>.  */
  BUILTIN_VALL (BINOP, zip1)
  BUILTIN_VALL (BINOP, zip2)
  BUILTIN_VALL (BINOP, uzp1)
  BUILTIN_VALL (BINOP, uzp2)
  BUILTIN_VALL (BINOP, trn1)
  BUILTIN_VALL (BINOP, trn2)