Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14 pmbaty 1
//===- IntrinsicsHexagon.td - Defines Hexagon intrinsics ---*- tablegen -*-===//
2
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
3
// See https://llvm.org/LICENSE.txt for license information.
4
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5
//
6
//===----------------------------------------------------------------------===//
7
//
8
// This file defines all of the Hexagon-specific intrinsics.
9
//
10
//===----------------------------------------------------------------------===//
11
 
12
//===----------------------------------------------------------------------===//
13
// Definitions for all Hexagon intrinsics.
14
//
15
// All Hexagon intrinsics start with "llvm.hexagon.".
16
let TargetPrefix = "hexagon" in {
17
  /// Hexagon_Intrinsic - Base class for the majority of Hexagon intrinsics.
18
  class Hexagon_Intrinsic<string GCCIntSuffix, list<LLVMType> ret_types,
19
                              list<LLVMType> param_types,
20
                              list<IntrinsicProperty> properties>
21
    : ClangBuiltin<!strconcat("__builtin_", GCCIntSuffix)>,
22
      DefaultAttrsIntrinsic<ret_types, param_types, properties>;
23
 
24
  /// Hexagon_NonGCC_Intrinsic - Base class for bitcode convertible Hexagon
25
  /// intrinsics.
26
  class Hexagon_NonGCC_Intrinsic<list<LLVMType> ret_types,
27
                                 list<LLVMType> param_types,
28
                                 list<IntrinsicProperty> properties>
29
    : DefaultAttrsIntrinsic<ret_types, param_types, properties>;
30
}
31
 
32
class Hexagon_mem_memmemsi_Intrinsic<string GCCIntSuffix>
33
  : Hexagon_Intrinsic<GCCIntSuffix,
34
                          [llvm_ptr_ty], [llvm_ptr_ty, llvm_ptr_ty,
35
                           llvm_i32_ty],
36
                          [IntrArgMemOnly]>;
37
 
38
class Hexagon_mem_memsisi_Intrinsic<string GCCIntSuffix>
39
  : Hexagon_Intrinsic<GCCIntSuffix,
40
                          [llvm_ptr_ty], [llvm_ptr_ty, llvm_i32_ty,
41
                           llvm_i32_ty],
42
                          [IntrWriteMem]>;
43
 
44
class Hexagon_mem_memdisi_Intrinsic<string GCCIntSuffix>
45
  : Hexagon_Intrinsic<GCCIntSuffix,
46
                          [llvm_ptr_ty], [llvm_ptr_ty, llvm_i64_ty,
47
                           llvm_i32_ty],
48
                          [IntrWriteMem]>;
49
 
50
class Hexagon_mem_memmemsisi_Intrinsic<string GCCIntSuffix>
51
  : Hexagon_Intrinsic<GCCIntSuffix,
52
                          [llvm_ptr_ty], [llvm_ptr_ty, llvm_ptr_ty,
53
                           llvm_i32_ty, llvm_i32_ty],
54
                          [IntrArgMemOnly, ImmArg<ArgIndex<3>>]>;
55
 
56
class Hexagon_mem_memsisisi_Intrinsic<string GCCIntSuffix>
57
  : Hexagon_Intrinsic<GCCIntSuffix,
58
                          [llvm_ptr_ty], [llvm_ptr_ty, llvm_i32_ty,
59
                           llvm_i32_ty, llvm_i32_ty],
60
                          [IntrWriteMem, ImmArg<ArgIndex<3>>]>;
61
 
62
class Hexagon_mem_memdisisi_Intrinsic<string GCCIntSuffix>
63
  : Hexagon_Intrinsic<GCCIntSuffix,
64
                          [llvm_ptr_ty], [llvm_ptr_ty, llvm_i64_ty,
65
                           llvm_i32_ty, llvm_i32_ty],
66
                          [IntrWriteMem, ImmArg<ArgIndex<3>>]>;
67
 
68
//
69
// BUILTIN_INFO_NONCONST(circ_ldd,PTR_ftype_PTRPTRSISI,4)
70
//
71
def int_hexagon_circ_ldd :
72
Hexagon_mem_memmemsisi_Intrinsic<"circ_ldd">;
73
//
74
// BUILTIN_INFO_NONCONST(circ_ldw,PTR_ftype_PTRPTRSISI,4)
75
//
76
def int_hexagon_circ_ldw :
77
Hexagon_mem_memmemsisi_Intrinsic<"circ_ldw">;
78
//
79
// BUILTIN_INFO_NONCONST(circ_ldh,PTR_ftype_PTRPTRSISI,4)
80
//
81
def int_hexagon_circ_ldh :
82
Hexagon_mem_memmemsisi_Intrinsic<"circ_ldh">;
83
//
84
// BUILTIN_INFO_NONCONST(circ_lduh,PTR_ftype_PTRPTRSISI,4)
85
//
86
def int_hexagon_circ_lduh :
87
Hexagon_mem_memmemsisi_Intrinsic<"circ_lduh">;
88
//
89
// BUILTIN_INFO_NONCONST(circ_ldb,PTR_ftype_PTRPTRSISI,4)
90
//
91
def int_hexagon_circ_ldb :
92
Hexagon_mem_memmemsisi_Intrinsic<"circ_ldb">;
93
//
94
// BUILTIN_INFO_NONCONST(circ_ldub,PTR_ftype_PTRPTRSISI,4)
95
//
96
def int_hexagon_circ_ldub :
97
Hexagon_mem_memmemsisi_Intrinsic<"circ_ldub">;
98
 
99
//
100
// BUILTIN_INFO_NONCONST(circ_std,PTR_ftype_PTRDISISI,4)
101
//
102
def int_hexagon_circ_std :
103
Hexagon_mem_memdisisi_Intrinsic<"circ_std">;
104
//
105
// BUILTIN_INFO_NONCONST(circ_stw,PTR_ftype_PTRSISISI,4)
106
//
107
def int_hexagon_circ_stw :
108
Hexagon_mem_memsisisi_Intrinsic<"circ_stw">;
109
//
110
// BUILTIN_INFO_NONCONST(circ_sth,PTR_ftype_PTRSISISI,4)
111
//
112
def int_hexagon_circ_sth :
113
Hexagon_mem_memsisisi_Intrinsic<"circ_sth">;
114
//
115
// BUILTIN_INFO_NONCONST(circ_sthhi,PTR_ftype_PTRSISISI,4)
116
//
117
def int_hexagon_circ_sthhi :
118
Hexagon_mem_memsisisi_Intrinsic<"circ_sthhi">;
119
//
120
// BUILTIN_INFO_NONCONST(circ_stb,PTR_ftype_PTRSISISI,4)
121
//
122
def int_hexagon_circ_stb :
123
Hexagon_mem_memsisisi_Intrinsic<"circ_stb">;
124
 
125
def int_hexagon_prefetch :
126
Hexagon_Intrinsic<"HEXAGON_prefetch", [], [llvm_ptr_ty], []>;
127
 
128
def llvm_ptr32_ty : LLVMPointerType<llvm_i32_ty>;
129
def llvm_ptr64_ty : LLVMPointerType<llvm_i64_ty>;
130
 
131
// Mark locked loads as read/write to prevent any accidental reordering.
132
// These don't use Hexagon_Intrinsic, because they are not nosync, and as such
133
// cannot use default attributes.
134
let TargetPrefix = "hexagon" in {
135
  def int_hexagon_L2_loadw_locked :
136
  ClangBuiltin<"__builtin_HEXAGON_L2_loadw_locked">,
137
  Intrinsic<[llvm_i32_ty], [llvm_ptr32_ty],
138
        [IntrArgMemOnly, NoCapture<ArgIndex<0>>]>;
139
  def int_hexagon_L4_loadd_locked :
140
  ClangBuiltin<"__builtin__HEXAGON_L4_loadd_locked">,
141
  Intrinsic<[llvm_i64_ty], [llvm_ptr64_ty],
142
        [IntrArgMemOnly, NoCapture<ArgIndex<0>>]>;
143
 
144
  def int_hexagon_S2_storew_locked :
145
  ClangBuiltin<"__builtin_HEXAGON_S2_storew_locked">,
146
  Intrinsic<[llvm_i32_ty],
147
        [llvm_ptr32_ty, llvm_i32_ty], [IntrArgMemOnly, NoCapture<ArgIndex<0>>]>;
148
  def int_hexagon_S4_stored_locked :
149
  ClangBuiltin<"__builtin_HEXAGON_S4_stored_locked">,
150
  Intrinsic<[llvm_i32_ty],
151
        [llvm_ptr64_ty, llvm_i64_ty], [IntrArgMemOnly, NoCapture<ArgIndex<0>>]>;
152
}
153
 
154
def int_hexagon_vmemcpy : Hexagon_Intrinsic<"hexagon_vmemcpy",
155
    [], [llvm_ptr_ty, llvm_ptr_ty, llvm_i32_ty],
156
    [IntrArgMemOnly, NoCapture<ArgIndex<0>>, NoCapture<ArgIndex<1>>, WriteOnly<ArgIndex<0>>, ReadOnly<ArgIndex<1>>]>;
157
 
158
def int_hexagon_vmemset : Hexagon_Intrinsic<"hexagon_vmemset",
159
    [], [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty],
160
    [IntrArgMemOnly, NoCapture<ArgIndex<0>>, WriteOnly<ArgIndex<0>>]>;
161
 
162
multiclass Hexagon_custom_circ_ld_Intrinsic<LLVMType ElTy> {
163
  def NAME#_pci : Hexagon_NonGCC_Intrinsic<
164
    [ElTy, llvm_ptr_ty],
165
    [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty, llvm_ptr_ty],
166
    [IntrArgMemOnly, NoCapture<ArgIndex<3>>]>;
167
  def NAME#_pcr : Hexagon_NonGCC_Intrinsic<
168
    [ElTy, llvm_ptr_ty], [llvm_ptr_ty, llvm_i32_ty, llvm_ptr_ty],
169
    [IntrArgMemOnly, NoCapture<ArgIndex<2>>]>;
170
}
171
 
172
defm int_hexagon_L2_loadrub : Hexagon_custom_circ_ld_Intrinsic<llvm_i32_ty>;
173
defm int_hexagon_L2_loadrb : Hexagon_custom_circ_ld_Intrinsic<llvm_i32_ty>;
174
defm int_hexagon_L2_loadruh : Hexagon_custom_circ_ld_Intrinsic<llvm_i32_ty>;
175
defm int_hexagon_L2_loadrh : Hexagon_custom_circ_ld_Intrinsic<llvm_i32_ty>;
176
defm int_hexagon_L2_loadri : Hexagon_custom_circ_ld_Intrinsic<llvm_i32_ty>;
177
defm int_hexagon_L2_loadrd : Hexagon_custom_circ_ld_Intrinsic<llvm_i64_ty>;
178
 
179
multiclass Hexagon_custom_circ_st_Intrinsic<LLVMType ElTy> {
180
  def NAME#_pci : Hexagon_NonGCC_Intrinsic<
181
    [llvm_ptr_ty],
182
    [llvm_ptr_ty, llvm_i32_ty, llvm_i32_ty, ElTy, llvm_ptr_ty],
183
    [IntrArgMemOnly, NoCapture<ArgIndex<4>>]>;
184
  def NAME#_pcr : Hexagon_NonGCC_Intrinsic<
185
    [llvm_ptr_ty], [llvm_ptr_ty, llvm_i32_ty, ElTy, llvm_ptr_ty],
186
    [IntrArgMemOnly, NoCapture<ArgIndex<3>>]>;
187
}
188
 
189
defm int_hexagon_S2_storerb : Hexagon_custom_circ_st_Intrinsic<llvm_i32_ty>;
190
defm int_hexagon_S2_storerh : Hexagon_custom_circ_st_Intrinsic<llvm_i32_ty>;
191
defm int_hexagon_S2_storerf : Hexagon_custom_circ_st_Intrinsic<llvm_i32_ty>;
192
defm int_hexagon_S2_storeri : Hexagon_custom_circ_st_Intrinsic<llvm_i32_ty>;
193
defm int_hexagon_S2_storerd : Hexagon_custom_circ_st_Intrinsic<llvm_i64_ty>;
194
 
195
// The front-end emits the intrinsic call with only two arguments. The third
196
// argument from the builtin is already used by front-end to write to memory
197
// by generating a store.
198
class Hexagon_custom_brev_ld_Intrinsic<LLVMType ElTy>
199
 : Hexagon_NonGCC_Intrinsic<
200
    [ElTy, llvm_ptr_ty], [llvm_ptr_ty, llvm_i32_ty],
201
    [IntrReadMem]>;
202
 
203
def int_hexagon_L2_loadrub_pbr : Hexagon_custom_brev_ld_Intrinsic<llvm_i32_ty>;
204
def int_hexagon_L2_loadrb_pbr : Hexagon_custom_brev_ld_Intrinsic<llvm_i32_ty>;
205
def int_hexagon_L2_loadruh_pbr : Hexagon_custom_brev_ld_Intrinsic<llvm_i32_ty>;
206
def int_hexagon_L2_loadrh_pbr : Hexagon_custom_brev_ld_Intrinsic<llvm_i32_ty>;
207
def int_hexagon_L2_loadri_pbr : Hexagon_custom_brev_ld_Intrinsic<llvm_i32_ty>;
208
def int_hexagon_L2_loadrd_pbr : Hexagon_custom_brev_ld_Intrinsic<llvm_i64_ty>;
209
 
210
def int_hexagon_S2_storerb_pbr : Hexagon_mem_memsisi_Intrinsic<"brev_stb">;
211
def int_hexagon_S2_storerh_pbr : Hexagon_mem_memsisi_Intrinsic<"brev_sth">;
212
def int_hexagon_S2_storerf_pbr : Hexagon_mem_memsisi_Intrinsic<"brev_sthhi">;
213
def int_hexagon_S2_storeri_pbr : Hexagon_mem_memsisi_Intrinsic<"brev_stw">;
214
def int_hexagon_S2_storerd_pbr : Hexagon_mem_memdisi_Intrinsic<"brev_std">;
215
 
216
// tag : V6_vrmpybub_rtt
217
class Hexagon_v32i32_v16i32i64_rtt_Intrinsic<string GCCIntSuffix>
218
  : Hexagon_Intrinsic<GCCIntSuffix,
219
       [llvm_v32i32_ty], [llvm_v16i32_ty,llvm_i64_ty],
220
       [IntrNoMem]>;
221
 
222
// tag : V6_vrmpybub_rtt_128B
223
class Hexagon_v64i32_v32i32i64_rtt_Intrinsic<string GCCIntSuffix>
224
  : Hexagon_Intrinsic<GCCIntSuffix,
225
       [llvm_v64i32_ty], [llvm_v32i32_ty,llvm_i64_ty],
226
       [IntrNoMem]>;
227
 
228
// tag : V6_vrmpybub_rtt_acc
229
class Hexagon_v32i32_v32i32v16i32i64_rtt_Intrinsic<string GCCIntSuffix>
230
  : Hexagon_Intrinsic<GCCIntSuffix,
231
       [llvm_v32i32_ty], [llvm_v32i32_ty,llvm_v16i32_ty,llvm_i64_ty],
232
       [IntrNoMem]>;
233
 
234
// tag : V6_vrmpybub_rtt_acc_128B
235
class Hexagon_v64i32_v64i32v32i32i64_rtt_Intrinsic<string GCCIntSuffix>
236
  : Hexagon_Intrinsic<GCCIntSuffix,
237
       [llvm_v64i32_ty], [llvm_v64i32_ty,llvm_v32i32_ty,llvm_i64_ty],
238
       [IntrNoMem]>;
239
 
240
def int_hexagon_V6_vrmpybub_rtt :
241
Hexagon_v32i32_v16i32i64_rtt_Intrinsic<"HEXAGON_V6_vrmpybub_rtt">;
242
 
243
def int_hexagon_V6_vrmpybub_rtt_128B :
244
Hexagon_v64i32_v32i32i64_rtt_Intrinsic<"HEXAGON_V6_vrmpybub_rtt_128B">;
245
 
246
def int_hexagon_V6_vrmpybub_rtt_acc :
247
Hexagon_v32i32_v32i32v16i32i64_rtt_Intrinsic<"HEXAGON_V6_vrmpybub_rtt_acc">;
248
 
249
def int_hexagon_V6_vrmpybub_rtt_acc_128B :
250
Hexagon_v64i32_v64i32v32i32i64_rtt_Intrinsic<"HEXAGON_V6_vrmpybub_rtt_acc_128B">;
251
 
252
def int_hexagon_V6_vrmpyub_rtt :
253
Hexagon_v32i32_v16i32i64_rtt_Intrinsic<"HEXAGON_V6_vrmpyub_rtt">;
254
 
255
def int_hexagon_V6_vrmpyub_rtt_128B :
256
Hexagon_v64i32_v32i32i64_rtt_Intrinsic<"HEXAGON_V6_vrmpyub_rtt_128B">;
257
 
258
def int_hexagon_V6_vrmpyub_rtt_acc :
259
Hexagon_v32i32_v32i32v16i32i64_rtt_Intrinsic<"HEXAGON_V6_vrmpyub_rtt_acc">;
260
 
261
def int_hexagon_V6_vrmpyub_rtt_acc_128B :
262
Hexagon_v64i32_v64i32v32i32i64_rtt_Intrinsic<"HEXAGON_V6_vrmpyub_rtt_acc_128B">;
263
 
264
// HVX conditional loads/stores
265
 
266
class Hexagon_pred_vload_imm<LLVMType ValTy>
267
  : Hexagon_NonGCC_Intrinsic<
268
      [ValTy],
269
      [llvm_i1_ty, LLVMPointerType<ValTy>, llvm_i32_ty],
270
      [IntrReadMem, IntrArgMemOnly, NoCapture<ArgIndex<1>>,
271
       ImmArg<ArgIndex<2>>]>;
272
 
273
class Hexagon_pred_vload_imm_64B:  Hexagon_pred_vload_imm<llvm_v16i32_ty>;
274
class Hexagon_pred_vload_imm_128B: Hexagon_pred_vload_imm<llvm_v32i32_ty>;
275
 
276
def int_hexagon_V6_vL32b_pred_ai:            Hexagon_pred_vload_imm_64B;
277
def int_hexagon_V6_vL32b_npred_ai:           Hexagon_pred_vload_imm_64B;
278
def int_hexagon_V6_vL32b_nt_pred_ai:         Hexagon_pred_vload_imm_64B;
279
def int_hexagon_V6_vL32b_nt_npred_ai:        Hexagon_pred_vload_imm_64B;
280
def int_hexagon_V6_vL32b_pred_ai_128B:      Hexagon_pred_vload_imm_128B;
281
def int_hexagon_V6_vL32b_npred_ai_128B:     Hexagon_pred_vload_imm_128B;
282
def int_hexagon_V6_vL32b_nt_pred_ai_128B:   Hexagon_pred_vload_imm_128B;
283
def int_hexagon_V6_vL32b_nt_npred_ai_128B:  Hexagon_pred_vload_imm_128B;
284
 
285
class Hexagom_pred_vload_upd<LLVMType ValTy, bit TakesImm>
286
  : Hexagon_NonGCC_Intrinsic<
287
      [ValTy, LLVMPointerType<ValTy>],
288
      [llvm_i1_ty, LLVMPointerType<ValTy>, llvm_i32_ty],
289
      !if(TakesImm,
290
          [IntrReadMem, IntrArgMemOnly, NoCapture<ArgIndex<1>>,
291
           ImmArg<ArgIndex<2>>],
292
          [IntrReadMem, IntrArgMemOnly, NoCapture<ArgIndex<1>>])>;
293
 
294
class Hexagom_pred_vload_upd_64B<bit TakesImm>
295
  : Hexagom_pred_vload_upd<llvm_v16i32_ty, TakesImm>;
296
class Hexagom_pred_vload_upd_128B<bit TakesImm>
297
  : Hexagom_pred_vload_upd<llvm_v32i32_ty, TakesImm>;
298
 
299
def int_hexagon_V6_vL32b_pred_pi:            Hexagom_pred_vload_upd_64B<1>;
300
def int_hexagon_V6_vL32b_npred_pi:           Hexagom_pred_vload_upd_64B<1>;
301
def int_hexagon_V6_vL32b_nt_pred_pi:         Hexagom_pred_vload_upd_64B<1>;
302
def int_hexagon_V6_vL32b_nt_npred_pi:        Hexagom_pred_vload_upd_64B<1>;
303
def int_hexagon_V6_vL32b_pred_pi_128B:      Hexagom_pred_vload_upd_128B<1>;
304
def int_hexagon_V6_vL32b_npred_pi_128B:     Hexagom_pred_vload_upd_128B<1>;
305
def int_hexagon_V6_vL32b_nt_pred_pi_128B:   Hexagom_pred_vload_upd_128B<1>;
306
def int_hexagon_V6_vL32b_nt_npred_pi_128B:  Hexagom_pred_vload_upd_128B<1>;
307
 
308
def int_hexagon_V6_vL32b_pred_ppu:           Hexagom_pred_vload_upd_64B<0>;
309
def int_hexagon_V6_vL32b_npred_ppu:          Hexagom_pred_vload_upd_64B<0>;
310
def int_hexagon_V6_vL32b_nt_pred_ppu:        Hexagom_pred_vload_upd_64B<0>;
311
def int_hexagon_V6_vL32b_nt_npred_ppu:       Hexagom_pred_vload_upd_64B<0>;
312
def int_hexagon_V6_vL32b_pred_ppu_128B:     Hexagom_pred_vload_upd_128B<0>;
313
def int_hexagon_V6_vL32b_npred_ppu_128B:    Hexagom_pred_vload_upd_128B<0>;
314
def int_hexagon_V6_vL32b_nt_pred_ppu_128B:  Hexagom_pred_vload_upd_128B<0>;
315
def int_hexagon_V6_vL32b_nt_npred_ppu_128B: Hexagom_pred_vload_upd_128B<0>;
316
 
317
 
318
class Hexagon_pred_vstore_imm<LLVMType ValTy>
319
  : Hexagon_NonGCC_Intrinsic<
320
      [],
321
      [llvm_i1_ty, LLVMPointerType<ValTy>, llvm_i32_ty, ValTy],
322
      [IntrWriteMem, IntrArgMemOnly, NoCapture<ArgIndex<1>>,
323
       ImmArg<ArgIndex<2>>]>;
324
 
325
class Hexagon_pred_vstore_imm_64B:  Hexagon_pred_vstore_imm<llvm_v16i32_ty>;
326
class Hexagon_pred_vstore_imm_128B: Hexagon_pred_vstore_imm<llvm_v32i32_ty>;
327
 
328
def int_hexagon_V6_vS32b_pred_ai:            Hexagon_pred_vstore_imm_64B;
329
def int_hexagon_V6_vS32b_npred_ai:           Hexagon_pred_vstore_imm_64B;
330
def int_hexagon_V6_vS32Ub_pred_ai:           Hexagon_pred_vstore_imm_64B;
331
def int_hexagon_V6_vS32Ub_npred_ai:          Hexagon_pred_vstore_imm_64B;
332
def int_hexagon_V6_vS32b_nt_pred_ai:         Hexagon_pred_vstore_imm_64B;
333
def int_hexagon_V6_vS32b_nt_npred_ai:        Hexagon_pred_vstore_imm_64B;
334
def int_hexagon_V6_vS32b_pred_ai_128B:      Hexagon_pred_vstore_imm_128B;
335
def int_hexagon_V6_vS32b_npred_ai_128B:     Hexagon_pred_vstore_imm_128B;
336
def int_hexagon_V6_vS32Ub_pred_ai_128B:     Hexagon_pred_vstore_imm_128B;
337
def int_hexagon_V6_vS32Ub_npred_ai_128B:    Hexagon_pred_vstore_imm_128B;
338
def int_hexagon_V6_vS32b_nt_pred_ai_128B:   Hexagon_pred_vstore_imm_128B;
339
def int_hexagon_V6_vS32b_nt_npred_ai_128B:  Hexagon_pred_vstore_imm_128B;
340
 
341
class Hexagon_pred_vstore_upd<LLVMType ValTy, bit TakesImm>
342
  : Hexagon_NonGCC_Intrinsic<
343
      [LLVMPointerType<ValTy>],
344
      [llvm_i1_ty, LLVMPointerType<ValTy>, llvm_i32_ty, ValTy],
345
      !if(TakesImm,
346
          [IntrWriteMem, IntrArgMemOnly, NoCapture<ArgIndex<1>>,
347
           ImmArg<ArgIndex<2>>],
348
          [IntrWriteMem, IntrArgMemOnly, NoCapture<ArgIndex<1>>])>;
349
 
350
class Hexagon_pred_vstore_upd_64B<bit TakesImm>
351
  : Hexagon_pred_vstore_upd<llvm_v16i32_ty, TakesImm>;
352
class Hexagon_pred_vstore_upd_128B<bit TakesImm>
353
  : Hexagon_pred_vstore_upd<llvm_v32i32_ty, TakesImm>;
354
 
355
def int_hexagon_V6_vS32b_pred_pi:            Hexagon_pred_vstore_upd_64B<1>;
356
def int_hexagon_V6_vS32b_npred_pi:           Hexagon_pred_vstore_upd_64B<1>;
357
def int_hexagon_V6_vS32Ub_pred_pi:           Hexagon_pred_vstore_upd_64B<1>;
358
def int_hexagon_V6_vS32Ub_npred_pi:          Hexagon_pred_vstore_upd_64B<1>;
359
def int_hexagon_V6_vS32b_nt_pred_pi:         Hexagon_pred_vstore_upd_64B<1>;
360
def int_hexagon_V6_vS32b_nt_npred_pi:        Hexagon_pred_vstore_upd_64B<1>;
361
def int_hexagon_V6_vS32b_pred_pi_128B:      Hexagon_pred_vstore_upd_128B<1>;
362
def int_hexagon_V6_vS32b_npred_pi_128B:     Hexagon_pred_vstore_upd_128B<1>;
363
def int_hexagon_V6_vS32Ub_pred_pi_128B:     Hexagon_pred_vstore_upd_128B<1>;
364
def int_hexagon_V6_vS32Ub_npred_pi_128B:    Hexagon_pred_vstore_upd_128B<1>;
365
def int_hexagon_V6_vS32b_nt_pred_pi_128B:   Hexagon_pred_vstore_upd_128B<1>;
366
def int_hexagon_V6_vS32b_nt_npred_pi_128B:  Hexagon_pred_vstore_upd_128B<1>;
367
 
368
def int_hexagon_V6_vS32b_pred_ppu:           Hexagon_pred_vstore_upd_64B<0>;
369
def int_hexagon_V6_vS32b_npred_ppu:          Hexagon_pred_vstore_upd_64B<0>;
370
def int_hexagon_V6_vS32Ub_pred_ppu:          Hexagon_pred_vstore_upd_64B<0>;
371
def int_hexagon_V6_vS32Ub_npred_ppu:         Hexagon_pred_vstore_upd_64B<0>;
372
def int_hexagon_V6_vS32b_nt_pred_ppu:        Hexagon_pred_vstore_upd_64B<0>;
373
def int_hexagon_V6_vS32b_nt_npred_ppu:       Hexagon_pred_vstore_upd_64B<0>;
374
def int_hexagon_V6_vS32b_pred_ppu_128B:     Hexagon_pred_vstore_upd_128B<0>;
375
def int_hexagon_V6_vS32b_npred_ppu_128B:    Hexagon_pred_vstore_upd_128B<0>;
376
def int_hexagon_V6_vS32Ub_pred_ppu_128B:    Hexagon_pred_vstore_upd_128B<0>;
377
def int_hexagon_V6_vS32Ub_npred_ppu_128B:   Hexagon_pred_vstore_upd_128B<0>;
378
def int_hexagon_V6_vS32b_nt_pred_ppu_128B:  Hexagon_pred_vstore_upd_128B<0>;
379
def int_hexagon_V6_vS32b_nt_npred_ppu_128B: Hexagon_pred_vstore_upd_128B<0>;
380
 
381
 
382
// HVX Vector predicate casts.
383
// These intrinsics do not emit (nor do they correspond to) any instructions,
384
// they are no-ops.
385
 
386
def int_hexagon_V6_pred_typecast :
387
Hexagon_NonGCC_Intrinsic<[llvm_anyvector_ty], [llvm_anyvector_ty], [IntrNoMem]>;
388
 
389
def int_hexagon_V6_pred_typecast_128B :
390
Hexagon_NonGCC_Intrinsic<[llvm_anyvector_ty], [llvm_anyvector_ty], [IntrNoMem]>;
391
 
392
// HVX full-precision multiplication.
393
// V6_vmpyss_parts(Vu,Vv) = (MulHS(Vu,Vv),  Mul(Vu,Vv))
394
// V6_vmpyuu_parts(Vu,Vv) = (MulHU(Vu,Vv),  Mul(Vu,Vv))
395
// V6_vmpyus_parts(Vu,Vv) = (MulHUS(Vu,Vv), Mul(Vu,Vv))
396
//
397
// Both, the (purportedly) 64b and the _128B versions are exactly equivalent
398
// regardless of the HVX mode, they are both defined for consistency.
399
// The purpose of these intrinsics is to have a uniform way of multiplying two
400
// integer vectors in the LLVM IR. Many HVX multiply operations interleave
401
// the even-odd results, except for 32x32 multiplications. Also, different
402
// HVX versions have different instructions that can be used, so defer the
403
// instruction choice to the isel.
404
class Hexagon_vv_vv_pure:
405
  Hexagon_NonGCC_Intrinsic<
406
    [llvm_anyvector_ty, LLVMMatchType<0>],
407
    [LLVMMatchType<0>, LLVMMatchType<0>],
408
    [IntrNoMem]>;
409
 
410
def int_hexagon_V6_vmpyss_parts:      Hexagon_vv_vv_pure;
411
def int_hexagon_V6_vmpyss_parts_128B: Hexagon_vv_vv_pure;
412
def int_hexagon_V6_vmpyuu_parts:      Hexagon_vv_vv_pure;
413
def int_hexagon_V6_vmpyuu_parts_128B: Hexagon_vv_vv_pure;
414
def int_hexagon_V6_vmpyus_parts:      Hexagon_vv_vv_pure;
415
def int_hexagon_V6_vmpyus_parts_128B: Hexagon_vv_vv_pure;
416
 
417
 
418
// Masked vector stores
419
//
420
// These are all deprecated, the intrinsics matching instruction names
421
// should be used instead, e.g. int_hexagon_V6_vS32b_qpred_ai, etc.
422
 
423
class Hexagon_custom_vms_Intrinsic
424
  : Hexagon_NonGCC_Intrinsic<
425
       [], [llvm_v64i1_ty,llvm_ptr_ty,llvm_v16i32_ty], [IntrWriteMem]>;
426
 
427
class Hexagon_custom_vms_Intrinsic_128B
428
  : Hexagon_NonGCC_Intrinsic<
429
       [], [llvm_v128i1_ty,llvm_ptr_ty,llvm_v32i32_ty], [IntrWriteMem]>;
430
 
431
def int_hexagon_V6_vmaskedstoreq: Hexagon_custom_vms_Intrinsic;
432
def int_hexagon_V6_vmaskedstorenq: Hexagon_custom_vms_Intrinsic;
433
def int_hexagon_V6_vmaskedstorentq: Hexagon_custom_vms_Intrinsic;
434
def int_hexagon_V6_vmaskedstorentnq: Hexagon_custom_vms_Intrinsic;
435
 
436
def int_hexagon_V6_vmaskedstoreq_128B: Hexagon_custom_vms_Intrinsic_128B;
437
def int_hexagon_V6_vmaskedstorenq_128B: Hexagon_custom_vms_Intrinsic_128B;
438
def int_hexagon_V6_vmaskedstorentq_128B: Hexagon_custom_vms_Intrinsic_128B;
439
def int_hexagon_V6_vmaskedstorentnq_128B: Hexagon_custom_vms_Intrinsic_128B;
440
 
441
 
442
// Intrinsic for instrumentation based profiling using a custom handler. The
443
// name of the handler is passed as the first operand to the intrinsic. The
444
// handler can take only one int32 input which is passed as the second
445
// operand to the intrinsic.
446
def int_hexagon_instrprof_custom
447
    : Hexagon_NonGCC_Intrinsic<[],
448
                               [llvm_ptr_ty, llvm_i32_ty],
449
                               [IntrInaccessibleMemOnly]>;
450
 
451
 
452
include "llvm/IR/IntrinsicsHexagonDep.td"