1 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -target-feature +avx512f -target-feature +avx512er -emit-llvm -o - -Werror | FileCheck %s 2 3 // Don't include mm_malloc.h, it's system specific. 4 #define __MM_MALLOC_H 5 6 #include <immintrin.h> 7 8 __m512d test_mm512_rsqrt28_round_pd(__m512d a) { 9 // CHECK-LABEL: @test_mm512_rsqrt28_round_pd 10 // CHECK: @llvm.x86.avx512.rsqrt28.pd 11 return _mm512_rsqrt28_round_pd(a, _MM_FROUND_TO_NEAREST_INT); 12 } 13 14 __m512d test_mm512_mask_rsqrt28_round_pd(__m512d s, __mmask8 m, __m512d a) { 15 // CHECK-LABEL: @test_mm512_mask_rsqrt28_round_pd 16 // CHECK: @llvm.x86.avx512.rsqrt28.pd 17 return _mm512_mask_rsqrt28_round_pd(s, m, a, _MM_FROUND_TO_NEAREST_INT); 18 } 19 20 __m512d test_mm512_maskz_rsqrt28_round_pd(__mmask8 m, __m512d a) { 21 // CHECK-LABEL: @test_mm512_maskz_rsqrt28_round_pd 22 // CHECK: @llvm.x86.avx512.rsqrt28.pd 23 return _mm512_maskz_rsqrt28_round_pd(m, a, _MM_FROUND_TO_NEAREST_INT); 24 } 25 26 __m512d test_mm512_rsqrt28_pd(__m512d a) { 27 // CHECK-LABEL: @test_mm512_rsqrt28_pd 28 // CHECK: @llvm.x86.avx512.rsqrt28.pd 29 return _mm512_rsqrt28_pd(a); 30 } 31 32 __m512d test_mm512_mask_rsqrt28_pd(__m512d s, __mmask8 m, __m512d a) { 33 // CHECK-LABEL: @test_mm512_mask_rsqrt28_pd 34 // CHECK: @llvm.x86.avx512.rsqrt28.pd 35 return _mm512_mask_rsqrt28_pd(s, m, a); 36 } 37 38 __m512d test_mm512_maskz_rsqrt28_pd(__mmask8 m, __m512d a) { 39 // CHECK-LABEL: @test_mm512_maskz_rsqrt28_pd 40 // CHECK: @llvm.x86.avx512.rsqrt28.pd 41 return _mm512_maskz_rsqrt28_pd(m, a); 42 } 43 44 __m512 test_mm512_rsqrt28_round_ps(__m512 a) { 45 // CHECK-LABEL: @test_mm512_rsqrt28_round_ps 46 // CHECK: @llvm.x86.avx512.rsqrt28.ps 47 return _mm512_rsqrt28_round_ps(a, _MM_FROUND_TO_NEAREST_INT); 48 } 49 50 __m512 test_mm512_mask_rsqrt28_round_ps(__m512 s, __mmask16 m, __m512 a) { 51 // CHECK-LABEL: @test_mm512_mask_rsqrt28_round_ps 52 // CHECK: @llvm.x86.avx512.rsqrt28.ps 53 return _mm512_mask_rsqrt28_round_ps(s, m, a, _MM_FROUND_TO_NEAREST_INT); 54 } 55 56 __m512 test_mm512_maskz_rsqrt28_round_ps(__mmask16 m, __m512 a) { 57 // CHECK-LABEL: @test_mm512_maskz_rsqrt28_round_ps 58 // CHECK: @llvm.x86.avx512.rsqrt28.ps 59 return _mm512_maskz_rsqrt28_round_ps(m, a, _MM_FROUND_TO_NEAREST_INT); 60 } 61 62 __m512 test_mm512_rsqrt28_ps(__m512 a) { 63 // CHECK-LABEL: @test_mm512_rsqrt28_ps 64 // CHECK: @llvm.x86.avx512.rsqrt28.ps 65 return _mm512_rsqrt28_ps(a); 66 } 67 68 __m512 test_mm512_mask_rsqrt28_ps(__m512 s, __mmask16 m, __m512 a) { 69 // CHECK-LABEL: @test_mm512_mask_rsqrt28_ps 70 // CHECK: @llvm.x86.avx512.rsqrt28.ps 71 return _mm512_mask_rsqrt28_ps(s, m, a); 72 } 73 74 __m512 test_mm512_maskz_rsqrt28_ps(__mmask16 m, __m512 a) { 75 // CHECK-LABEL: @test_mm512_maskz_rsqrt28_ps 76 // CHECK: @llvm.x86.avx512.rsqrt28.ps 77 return _mm512_maskz_rsqrt28_ps(m, a); 78 } 79 80 __m128 test_mm_rsqrt28_round_ss(__m128 a, __m128 b) { 81 // CHECK-LABEL: @test_mm_rsqrt28_round_ss 82 // CHECK: @llvm.x86.avx512.rsqrt28.ss 83 return _mm_rsqrt28_round_ss(a, b, _MM_FROUND_TO_NEAREST_INT); 84 } 85 86 __m128 test_mm_mask_rsqrt28_round_ss(__m128 s, __mmask16 m, __m128 a, __m128 b) { 87 // CHECK-LABEL: @test_mm_mask_rsqrt28_round_ss 88 // CHECK: @llvm.x86.avx512.rsqrt28.ss 89 return _mm_mask_rsqrt28_round_ss(s, m, a, b, _MM_FROUND_TO_NEAREST_INT); 90 } 91 92 __m128 test_mm_maskz_rsqrt28_round_ss(__mmask16 m, __m128 a, __m128 b) { 93 // CHECK-LABEL: @test_mm_maskz_rsqrt28_round_ss 94 // CHECK: @llvm.x86.avx512.rsqrt28.ss 95 return _mm_maskz_rsqrt28_round_ss(m, a, b, _MM_FROUND_TO_NEAREST_INT); 96 } 97 98 __m128 test_mm_rsqrt28_ss(__m128 a, __m128 b) { 99 // CHECK-LABEL: @test_mm_rsqrt28_ss 100 // CHECK: @llvm.x86.avx512.rsqrt28.ss 101 return _mm_rsqrt28_ss(a, b); 102 } 103 104 __m128 test_mm_mask_rsqrt28_ss(__m128 s, __mmask16 m, __m128 a, __m128 b) { 105 // CHECK-LABEL: @test_mm_mask_rsqrt28_ss 106 // CHECK: @llvm.x86.avx512.rsqrt28.ss 107 return _mm_mask_rsqrt28_ss(s, m, a, b); 108 } 109 110 __m128 test_mm_maskz_rsqrt28_ss(__mmask16 m, __m128 a, __m128 b) { 111 // CHECK-LABEL: @test_mm_maskz_rsqrt28_ss 112 // CHECK: @llvm.x86.avx512.rsqrt28.ss 113 return _mm_maskz_rsqrt28_ss(m, a, b); 114 } 115 116 __m128d test_mm_rsqrt28_round_sd(__m128d a, __m128d b) { 117 // CHECK-LABEL: @test_mm_rsqrt28_round_sd 118 // CHECK: @llvm.x86.avx512.rsqrt28.sd 119 return _mm_rsqrt28_round_sd(a, b, _MM_FROUND_TO_NEAREST_INT); 120 } 121 122 __m128d test_mm_mask_rsqrt28_round_sd(__m128d s, __mmask8 m, __m128d a, __m128d b) { 123 // CHECK-LABEL: @test_mm_mask_rsqrt28_round_sd 124 // CHECK: @llvm.x86.avx512.rsqrt28.sd 125 return _mm_mask_rsqrt28_round_sd(s, m, a, b, _MM_FROUND_TO_NEAREST_INT); 126 } 127 128 __m128d test_mm_maskz_rsqrt28_round_sd(__mmask8 m, __m128d a, __m128d b) { 129 // CHECK-LABEL: @test_mm_maskz_rsqrt28_round_sd 130 // CHECK: @llvm.x86.avx512.rsqrt28.sd 131 return _mm_maskz_rsqrt28_round_sd(m, a, b, _MM_FROUND_TO_NEAREST_INT); 132 } 133 134 __m512d test_mm512_rcp28_round_pd(__m512d a) { 135 // CHECK-LABEL: @test_mm512_rcp28_round_pd 136 // CHECK: @llvm.x86.avx512.rcp28.pd 137 return _mm512_rcp28_round_pd(a, _MM_FROUND_TO_NEAREST_INT); 138 } 139 140 __m512d test_mm512_mask_rcp28_round_pd(__m512d s, __mmask8 m, __m512d a) { 141 // CHECK-LABEL: @test_mm512_mask_rcp28_round_pd 142 // CHECK: @llvm.x86.avx512.rcp28.pd 143 return _mm512_mask_rcp28_round_pd(s, m, a, _MM_FROUND_TO_NEAREST_INT); 144 } 145 146 __m512d test_mm512_maskz_rcp28_round_pd(__mmask8 m, __m512d a) { 147 // CHECK-LABEL: @test_mm512_maskz_rcp28_round_pd 148 // CHECK: @llvm.x86.avx512.rcp28.pd 149 return _mm512_maskz_rcp28_round_pd(m, a, _MM_FROUND_TO_NEAREST_INT); 150 } 151 152 __m512d test_mm512_rcp28_pd(__m512d a) { 153 // CHECK-LABEL: @test_mm512_rcp28_pd 154 // CHECK: @llvm.x86.avx512.rcp28.pd 155 return _mm512_rcp28_pd(a); 156 } 157 158 __m512d test_mm512_mask_rcp28_pd(__m512d s, __mmask8 m, __m512d a) { 159 // CHECK-LABEL: @test_mm512_mask_rcp28_pd 160 // CHECK: @llvm.x86.avx512.rcp28.pd 161 return _mm512_mask_rcp28_pd(s, m, a); 162 } 163 164 __m512d test_mm512_maskz_rcp28_pd(__mmask8 m, __m512d a) { 165 // CHECK-LABEL: @test_mm512_maskz_rcp28_pd 166 // CHECK: @llvm.x86.avx512.rcp28.pd 167 return _mm512_maskz_rcp28_pd(m, a); 168 } 169 170 __m512 test_mm512_rcp28_round_ps(__m512 a) { 171 // CHECK-LABEL: @test_mm512_rcp28_round_ps 172 // CHECK: @llvm.x86.avx512.rcp28.ps 173 return _mm512_rcp28_round_ps(a, _MM_FROUND_TO_NEAREST_INT); 174 } 175 176 __m512 test_mm512_mask_rcp28_round_ps(__m512 s, __mmask16 m, __m512 a) { 177 // CHECK-LABEL: @test_mm512_mask_rcp28_round_ps 178 // CHECK: @llvm.x86.avx512.rcp28.ps 179 return _mm512_mask_rcp28_round_ps(s, m, a, _MM_FROUND_TO_NEAREST_INT); 180 } 181 182 __m512 test_mm512_maskz_rcp28_round_ps(__mmask16 m, __m512 a) { 183 // CHECK-LABEL: @test_mm512_maskz_rcp28_round_ps 184 // CHECK: @llvm.x86.avx512.rcp28.ps 185 return _mm512_maskz_rcp28_round_ps(m, a, _MM_FROUND_TO_NEAREST_INT); 186 } 187 188 __m512 test_mm512_rcp28_ps(__m512 a) { 189 // CHECK-LABEL: @test_mm512_rcp28_ps 190 // CHECK: @llvm.x86.avx512.rcp28.ps 191 return _mm512_rcp28_ps(a); 192 } 193 194 __m512 test_mm512_mask_rcp28_ps(__m512 s, __mmask16 m, __m512 a) { 195 // CHECK-LABEL: @test_mm512_mask_rcp28_ps 196 // CHECK: @llvm.x86.avx512.rcp28.ps 197 return _mm512_mask_rcp28_ps(s, m, a); 198 } 199 200 __m512 test_mm512_maskz_rcp28_ps(__mmask16 m, __m512 a) { 201 // CHECK-LABEL: @test_mm512_maskz_rcp28_ps 202 // CHECK: @llvm.x86.avx512.rcp28.ps 203 return _mm512_maskz_rcp28_ps(m, a); 204 } 205 206 __m128 test_mm_rcp28_round_ss(__m128 a, __m128 b) { 207 // CHECK-LABEL: @test_mm_rcp28_round_ss 208 // CHECK: @llvm.x86.avx512.rcp28.ss 209 return _mm_rcp28_round_ss(a, b, _MM_FROUND_TO_NEAREST_INT); 210 } 211 212 __m128 test_mm_mask_rcp28_round_ss(__m128 s, __mmask16 m, __m128 a, __m128 b) { 213 // CHECK-LABEL: @test_mm_mask_rcp28_round_ss 214 // CHECK: @llvm.x86.avx512.rcp28.ss 215 return _mm_mask_rcp28_round_ss(s, m, a, b, _MM_FROUND_TO_NEAREST_INT); 216 } 217 218 __m128 test_mm_maskz_rcp28_round_ss(__mmask16 m, __m128 a, __m128 b) { 219 // CHECK-LABEL: @test_mm_maskz_rcp28_round_ss 220 // CHECK: @llvm.x86.avx512.rcp28.ss 221 return _mm_maskz_rcp28_round_ss(m, a, b, _MM_FROUND_TO_NEAREST_INT); 222 } 223 224 __m128 test_mm_rcp28_ss(__m128 a, __m128 b) { 225 // CHECK-LABEL: @test_mm_rcp28_ss 226 // CHECK: @llvm.x86.avx512.rcp28.ss 227 return _mm_rcp28_ss(a, b); 228 } 229 230 __m128 test_mm_mask_rcp28_ss(__m128 s, __mmask16 m, __m128 a, __m128 b) { 231 // CHECK-LABEL: @test_mm_mask_rcp28_ss 232 // CHECK: @llvm.x86.avx512.rcp28.ss 233 return _mm_mask_rcp28_ss(s, m, a, b); 234 } 235 236 __m128 test_mm_maskz_rcp28_ss(__mmask16 m, __m128 a, __m128 b) { 237 // CHECK-LABEL: @test_mm_maskz_rcp28_ss 238 // CHECK: @llvm.x86.avx512.rcp28.ss 239 return _mm_maskz_rcp28_ss(m, a, b); 240 } 241 242 __m128d test_mm_rcp28_round_sd(__m128d a, __m128d b) { 243 // CHECK-LABEL: @test_mm_rcp28_round_sd 244 // CHECK: @llvm.x86.avx512.rcp28.sd 245 return _mm_rcp28_round_sd(a, b, _MM_FROUND_TO_NEAREST_INT); 246 } 247 248 __m128d test_mm_mask_rcp28_round_sd(__m128d s, __mmask8 m, __m128d a, __m128d b) { 249 // CHECK-LABEL: @test_mm_mask_rcp28_round_sd 250 // CHECK: @llvm.x86.avx512.rcp28.sd 251 return _mm_mask_rcp28_round_sd(s, m, a, b, _MM_FROUND_TO_NEAREST_INT); 252 } 253 254 __m128d test_mm_maskz_rcp28_round_sd(__mmask8 m, __m128d a, __m128d b) { 255 // CHECK-LABEL: @test_mm_maskz_rcp28_round_sd 256 // CHECK: @llvm.x86.avx512.rcp28.sd 257 return _mm_maskz_rcp28_round_sd(m, a, b, _MM_FROUND_TO_NEAREST_INT); 258 } 259 260 __m128d test_mm_rcp28_sd(__m128d a, __m128d b) { 261 // CHECK-LABEL: @test_mm_rcp28_sd 262 // CHECK: @llvm.x86.avx512.rcp28.sd 263 return _mm_rcp28_sd(a, b); 264 } 265 266 __m128d test_mm_mask_rcp28_sd(__m128d s, __mmask8 m, __m128d a, __m128d b) { 267 // CHECK-LABEL: @test_mm_mask_rcp28_sd 268 // CHECK: @llvm.x86.avx512.rcp28.sd 269 return _mm_mask_rcp28_sd(s, m, a, b); 270 } 271 272 __m128d test_mm_maskz_rcp28_sd(__mmask8 m, __m128d a, __m128d b) { 273 // CHECK-LABEL: @test_mm_maskz_rcp28_sd 274 // CHECK: @llvm.x86.avx512.rcp28.sd 275 return _mm_maskz_rcp28_sd(m, a, b); 276 } 277 278 __m512d test_mm512_exp2a23_round_pd(__m512d a) { 279 // CHECK-LABEL: @test_mm512_exp2a23_round_pd 280 // CHECK: @llvm.x86.avx512.exp2.pd 281 return _mm512_exp2a23_round_pd(a, _MM_FROUND_TO_NEAREST_INT); 282 } 283 284 __m512d test_mm512_mask_exp2a23_round_pd(__m512d s, __mmask8 m, __m512d a) { 285 // CHECK-LABEL: @test_mm512_mask_exp2a23_round_pd 286 // CHECK: @llvm.x86.avx512.exp2.pd 287 return _mm512_mask_exp2a23_round_pd(s, m, a, _MM_FROUND_TO_NEAREST_INT); 288 } 289 290 __m512d test_mm512_maskz_exp2a23_round_pd(__mmask8 m, __m512d a) { 291 // CHECK-LABEL: @test_mm512_maskz_exp2a23_round_pd 292 // CHECK: @llvm.x86.avx512.exp2.pd 293 return _mm512_maskz_exp2a23_round_pd(m, a, _MM_FROUND_TO_NEAREST_INT); 294 } 295 296 __m512d test_mm512_exp2a23_pd(__m512d a) { 297 // CHECK-LABEL: @test_mm512_exp2a23_pd 298 // CHECK: @llvm.x86.avx512.exp2.pd 299 return _mm512_exp2a23_pd(a); 300 } 301 302 __m512d test_mm512_mask_exp2a23_pd(__m512d s, __mmask8 m, __m512d a) { 303 // CHECK-LABEL: @test_mm512_mask_exp2a23_pd 304 // CHECK: @llvm.x86.avx512.exp2.pd 305 return _mm512_mask_exp2a23_pd(s, m, a); 306 } 307 308 __m512d test_mm512_maskz_exp2a23_pd(__mmask8 m, __m512d a) { 309 // CHECK-LABEL: @test_mm512_maskz_exp2a23_pd 310 // CHECK: @llvm.x86.avx512.exp2.pd 311 return _mm512_maskz_exp2a23_pd(m, a); 312 } 313 314 __m512 test_mm512_exp2a23_round_ps(__m512 a) { 315 // CHECK-LABEL: @test_mm512_exp2a23_round_ps 316 // CHECK: @llvm.x86.avx512.exp2.ps 317 return _mm512_exp2a23_round_ps(a, _MM_FROUND_TO_NEAREST_INT); 318 } 319 320 __m512 test_mm512_mask_exp2a23_round_ps(__m512 s, __mmask16 m, __m512 a) { 321 // CHECK-LABEL: @test_mm512_mask_exp2a23_round_ps 322 // CHECK: @llvm.x86.avx512.exp2.ps 323 return _mm512_mask_exp2a23_round_ps(s, m, a, _MM_FROUND_TO_NEAREST_INT); 324 } 325 326 __m512 test_mm512_maskz_exp2a23_round_ps(__mmask16 m, __m512 a) { 327 // CHECK-LABEL: @test_mm512_maskz_exp2a23_round_ps 328 // CHECK: @llvm.x86.avx512.exp2.ps 329 return _mm512_maskz_exp2a23_round_ps(m, a, _MM_FROUND_TO_NEAREST_INT); 330 } 331 332 __m512 test_mm512_exp2a23_ps(__m512 a) { 333 // CHECK-LABEL: @test_mm512_exp2a23_ps 334 // CHECK: @llvm.x86.avx512.exp2.ps 335 return _mm512_exp2a23_ps(a); 336 } 337 338 __m512 test_mm512_mask_exp2a23_ps(__m512 s, __mmask16 m, __m512 a) { 339 // CHECK-LABEL: @test_mm512_mask_exp2a23_ps 340 // CHECK: @llvm.x86.avx512.exp2.ps 341 return _mm512_mask_exp2a23_ps(s, m, a); 342 } 343 344 __m512 test_mm512_maskz_exp2a23_ps(__mmask16 m, __m512 a) { 345 // CHECK-LABEL: @test_mm512_maskz_exp2a23_ps 346 // CHECK: @llvm.x86.avx512.exp2.ps 347 return _mm512_maskz_exp2a23_ps(m, a); 348 } 349 350