1 //===- IntrinsicsAArch64.td - Defines AArch64 intrinsics -----------*- tablegen -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines all of the AArch64-specific intrinsics.
12 //===----------------------------------------------------------------------===//
14 //===----------------------------------------------------------------------===//
15 // Advanced SIMD (NEON)
17 let TargetPrefix = "aarch64" in { // All intrinsics start with "llvm.aarch64.".
19 // Vector Absolute Compare (Floating Point)
20 def int_aarch64_neon_vacgeq :
21 Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
22 def int_aarch64_neon_vacgtq :
23 Intrinsic<[llvm_v2i64_ty], [llvm_v2f64_ty, llvm_v2f64_ty], [IntrNoMem]>;
25 // Vector maxNum (Floating Point)
26 def int_aarch64_neon_vmaxnm : Neon_2Arg_Intrinsic;
28 // Vector minNum (Floating Point)
29 def int_aarch64_neon_vminnm : Neon_2Arg_Intrinsic;
31 // Vector Pairwise maxNum (Floating Point)
32 def int_aarch64_neon_vpmaxnm : Neon_2Arg_Intrinsic;
34 // Vector Pairwise minNum (Floating Point)
35 def int_aarch64_neon_vpminnm : Neon_2Arg_Intrinsic;
37 // Vector Multiply Extended (Floating Point)
38 def int_aarch64_neon_vmulx : Neon_2Arg_Intrinsic;
40 class Neon_N2V_Intrinsic
41 : Intrinsic<[llvm_anyvector_ty], [LLVMMatchType<0>, llvm_i32_ty],
43 class Neon_N3V_Intrinsic
44 : Intrinsic<[llvm_anyvector_ty],
45 [LLVMMatchType<0>, LLVMMatchType<0>, llvm_i32_ty],
47 class Neon_N2V_Narrow_Intrinsic
48 : Intrinsic<[llvm_anyvector_ty],
49 [LLVMExtendedElementVectorType<0>, llvm_i32_ty],
52 // Vector rounding shift right by immediate (Signed)
53 def int_aarch64_neon_vsrshr : Neon_N2V_Intrinsic;
54 def int_aarch64_neon_vurshr : Neon_N2V_Intrinsic;
55 def int_aarch64_neon_vsqshlu : Neon_N2V_Intrinsic;
57 def int_aarch64_neon_vsri : Neon_N3V_Intrinsic;
58 def int_aarch64_neon_vsli : Neon_N3V_Intrinsic;
60 def int_aarch64_neon_vsqshrun : Neon_N2V_Narrow_Intrinsic;
61 def int_aarch64_neon_vrshrn : Neon_N2V_Narrow_Intrinsic;
62 def int_aarch64_neon_vsqrshrun : Neon_N2V_Narrow_Intrinsic;
63 def int_aarch64_neon_vsqshrn : Neon_N2V_Narrow_Intrinsic;
64 def int_aarch64_neon_vuqshrn : Neon_N2V_Narrow_Intrinsic;
65 def int_aarch64_neon_vsqrshrn : Neon_N2V_Narrow_Intrinsic;
66 def int_aarch64_neon_vuqrshrn : Neon_N2V_Narrow_Intrinsic;
69 class Neon_Across_Intrinsic
70 : Intrinsic<[llvm_anyvector_ty], [llvm_anyvector_ty], [IntrNoMem]>;
72 class Neon_2Arg_Across_Float_Intrinsic
73 : Intrinsic<[llvm_anyvector_ty], [llvm_v4f32_ty], [IntrNoMem]>;
75 def int_aarch64_neon_saddlv : Neon_Across_Intrinsic;
76 def int_aarch64_neon_uaddlv : Neon_Across_Intrinsic;
77 def int_aarch64_neon_smaxv : Neon_Across_Intrinsic;
78 def int_aarch64_neon_umaxv : Neon_Across_Intrinsic;
79 def int_aarch64_neon_sminv : Neon_Across_Intrinsic;
80 def int_aarch64_neon_uminv : Neon_Across_Intrinsic;
81 def int_aarch64_neon_vaddv : Neon_Across_Intrinsic;
82 def int_aarch64_neon_vmaxv : Neon_Across_Intrinsic;
83 def int_aarch64_neon_vminv : Neon_Across_Intrinsic;
84 def int_aarch64_neon_vmaxnmv : Neon_Across_Intrinsic;
85 def int_aarch64_neon_vminnmv : Neon_Across_Intrinsic;
88 def int_aarch64_neon_vaddds :
89 Intrinsic<[llvm_v1i64_ty], [llvm_v1i64_ty, llvm_v1i64_ty], [IntrNoMem]>;
90 def int_aarch64_neon_vadddu :
91 Intrinsic<[llvm_v1i64_ty], [llvm_v1i64_ty, llvm_v1i64_ty], [IntrNoMem]>;
93 // Scalar Saturating Add (Signed, Unsigned)
94 def int_aarch64_neon_vqadds : Neon_2Arg_Intrinsic;
95 def int_aarch64_neon_vqaddu : Neon_2Arg_Intrinsic;
98 def int_aarch64_neon_vsubds :
99 Intrinsic<[llvm_v1i64_ty], [llvm_v1i64_ty, llvm_v1i64_ty], [IntrNoMem]>;
100 def int_aarch64_neon_vsubdu :
101 Intrinsic<[llvm_v1i64_ty], [llvm_v1i64_ty, llvm_v1i64_ty], [IntrNoMem]>;
103 // Scalar Saturating Sub (Signed, Unsigned)
104 def int_aarch64_neon_vqsubs : Neon_2Arg_Intrinsic;
105 def int_aarch64_neon_vqsubu : Neon_2Arg_Intrinsic;
109 def int_aarch64_neon_vshlds :
110 Intrinsic<[llvm_v1i64_ty], [llvm_v1i64_ty, llvm_v1i64_ty], [IntrNoMem]>;
111 def int_aarch64_neon_vshldu :
112 Intrinsic<[llvm_v1i64_ty], [llvm_v1i64_ty, llvm_v1i64_ty], [IntrNoMem]>;
114 // Scalar Saturating Shift Left
115 def int_aarch64_neon_vqshls : Neon_2Arg_Intrinsic;
116 def int_aarch64_neon_vqshlu : Neon_2Arg_Intrinsic;
118 // Scalar Shift Rouding Left
119 def int_aarch64_neon_vrshlds :
120 Intrinsic<[llvm_v1i64_ty], [llvm_v1i64_ty, llvm_v1i64_ty], [IntrNoMem]>;
121 def int_aarch64_neon_vrshldu :
122 Intrinsic<[llvm_v1i64_ty], [llvm_v1i64_ty, llvm_v1i64_ty], [IntrNoMem]>;
124 // Scalar Saturating Rounding Shift Left
125 def int_aarch64_neon_vqrshls : Neon_2Arg_Intrinsic;
126 def int_aarch64_neon_vqrshlu : Neon_2Arg_Intrinsic;
128 // Scalar Reduce Pairwise Add.
129 def int_aarch64_neon_vpadd :
130 Intrinsic<[llvm_v1i64_ty], [llvm_v2i64_ty],[IntrNoMem]>;
131 def int_aarch64_neon_vpfadd :
132 Intrinsic<[llvm_v1f32_ty], [llvm_v2f32_ty], [IntrNoMem]>;
133 def int_aarch64_neon_vpfaddq :
134 Intrinsic<[llvm_v1f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
136 // Scalar Reduce Pairwise Floating Point Max/Min.
137 def int_aarch64_neon_vpmax :
138 Intrinsic<[llvm_v1f32_ty], [llvm_v2f32_ty], [IntrNoMem]>;
139 def int_aarch64_neon_vpmaxq :
140 Intrinsic<[llvm_v1f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
141 def int_aarch64_neon_vpmin :
142 Intrinsic<[llvm_v1f32_ty], [llvm_v2f32_ty], [IntrNoMem]>;
143 def int_aarch64_neon_vpminq :
144 Intrinsic<[llvm_v1f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
146 // Scalar Reduce Pairwise Floating Point Maxnm/Minnm.
147 def int_aarch64_neon_vpfmaxnm :
148 Intrinsic<[llvm_v1f32_ty], [llvm_v2f32_ty], [IntrNoMem]>;
149 def int_aarch64_neon_vpfmaxnmq :
150 Intrinsic<[llvm_v1f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
151 def int_aarch64_neon_vpfminnm :
152 Intrinsic<[llvm_v1f32_ty], [llvm_v2f32_ty], [IntrNoMem]>;
153 def int_aarch64_neon_vpfminnmq :
154 Intrinsic<[llvm_v1f64_ty], [llvm_v2f64_ty], [IntrNoMem]>;
156 // Scalar Signed Integer Convert To Floating-point
157 def int_aarch64_neon_vcvtf32_s32 :
158 Intrinsic<[llvm_v1f32_ty], [llvm_v1i32_ty], [IntrNoMem]>;
159 def int_aarch64_neon_vcvtf64_s64 :
160 Intrinsic<[llvm_v1f64_ty], [llvm_v1i64_ty], [IntrNoMem]>;
162 // Scalar Unsigned Integer Convert To Floating-point
163 def int_aarch64_neon_vcvtf32_u32 :
164 Intrinsic<[llvm_v1f32_ty], [llvm_v1i32_ty], [IntrNoMem]>;
165 def int_aarch64_neon_vcvtf64_u64 :
166 Intrinsic<[llvm_v1f64_ty], [llvm_v1i64_ty], [IntrNoMem]>;
168 // Scalar Floating-point Reciprocal Exponent
169 def int_aarch64_neon_vrecpx : Neon_1Arg_Intrinsic;
171 class Neon_Cmp_Intrinsic
172 : Intrinsic<[llvm_anyvector_ty], [llvm_anyvector_ty, llvm_anyvector_ty],
175 // Scalar Compare Equal
176 def int_aarch64_neon_vceq : Neon_Cmp_Intrinsic;
178 // Scalar Compare Greater-Than or Equal
179 def int_aarch64_neon_vcge : Neon_Cmp_Intrinsic;
180 def int_aarch64_neon_vchs : Neon_Cmp_Intrinsic;
182 // Scalar Compare Less-Than or Equal
183 def int_aarch64_neon_vclez : Neon_Cmp_Intrinsic;
185 // Scalar Compare Less-Than
186 def int_aarch64_neon_vcltz : Neon_Cmp_Intrinsic;
188 // Scalar Compare Greater-Than
189 def int_aarch64_neon_vcgt : Neon_Cmp_Intrinsic;
190 def int_aarch64_neon_vchi : Neon_Cmp_Intrinsic;
192 // Scalar Compare Bitwise Test Bits
193 def int_aarch64_neon_vtstd : Neon_Cmp_Intrinsic;
195 // Scalar Floating-point Absolute Compare Greater Than Or Equal
196 def int_aarch64_neon_vcage : Neon_Cmp_Intrinsic;
198 // Scalar Floating-point Absolute Compare Greater Than
199 def int_aarch64_neon_vcagt : Neon_Cmp_Intrinsic;
201 // Scalar Signed Saturating Accumulated of Unsigned Value
202 def int_aarch64_neon_vuqadd : Neon_2Arg_Intrinsic;
204 // Scalar Unsigned Saturating Accumulated of Signed Value
205 def int_aarch64_neon_vsqadd : Neon_2Arg_Intrinsic;
207 // Scalar Absolute Value
208 def int_aarch64_neon_vabs :
209 Intrinsic<[llvm_v1i64_ty], [llvm_v1i64_ty], [IntrNoMem]>;
211 // Scalar Negate Value
212 def int_aarch64_neon_vneg :
213 Intrinsic<[llvm_v1i64_ty], [llvm_v1i64_ty], [IntrNoMem]>;
215 // Signed Saturating Doubling Multiply-Add Long
216 def int_aarch64_neon_vqdmlal : Neon_3Arg_Long_Intrinsic;
218 // Signed Saturating Doubling Multiply-Subtract Long
219 def int_aarch64_neon_vqdmlsl : Neon_3Arg_Long_Intrinsic;
221 // Signed Saturating Doubling Multiply Long
222 def int_aarch64_neon_vqdmull : Neon_2Arg_Long_Intrinsic;