1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=avx512fp16,avx512vl -O3 | FileCheck %s --check-prefixes=CHECK
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=avx512fp16,avx512vl -O3 | FileCheck %s --check-prefixes=CHECK
6 declare <4 x i64> @llvm.experimental.constrained.fptosi.v4i64.v4f16(<4 x half>, metadata)
7 declare <4 x i64> @llvm.experimental.constrained.fptoui.v4i64.v4f16(<4 x half>, metadata)
8 declare <8 x i32> @llvm.experimental.constrained.fptosi.v8i32.v8f16(<8 x half>, metadata)
9 declare <8 x i32> @llvm.experimental.constrained.fptoui.v8i32.v8f16(<8 x half>, metadata)
10 declare <16 x i16> @llvm.experimental.constrained.fptosi.v16i16.v16f16(<16 x half>, metadata)
11 declare <16 x i16> @llvm.experimental.constrained.fptoui.v16i16.v16f16(<16 x half>, metadata)
12 declare <16 x i8> @llvm.experimental.constrained.fptosi.v16i8.v16f16(<16 x half>, metadata)
13 declare <16 x i8> @llvm.experimental.constrained.fptoui.v16i8.v16f16(<16 x half>, metadata)
14 declare <16 x i1> @llvm.experimental.constrained.fptosi.v16i1.v16f16(<16 x half>, metadata)
15 declare <16 x i1> @llvm.experimental.constrained.fptoui.v16i1.v16f16(<16 x half>, metadata)
17 define <4 x i64> @strict_vector_fptosi_v4f16_to_v4i64(<4 x half> %a) #0 {
18 ; CHECK-LABEL: strict_vector_fptosi_v4f16_to_v4i64:
20 ; CHECK-NEXT: vmovq {{.*#+}} xmm0 = xmm0[0],zero
21 ; CHECK-NEXT: vcvttph2qq %xmm0, %ymm0
22 ; CHECK-NEXT: ret{{[l|q]}}
23 %ret = call <4 x i64> @llvm.experimental.constrained.fptosi.v4i64.v4f16(<4 x half> %a,
24 metadata !"fpexcept.strict") #0
28 define <4 x i64> @strict_vector_fptoui_v4f16_to_v4i64(<4 x half> %a) #0 {
29 ; CHECK-LABEL: strict_vector_fptoui_v4f16_to_v4i64:
31 ; CHECK-NEXT: vmovq {{.*#+}} xmm0 = xmm0[0],zero
32 ; CHECK-NEXT: vcvttph2uqq %xmm0, %ymm0
33 ; CHECK-NEXT: ret{{[l|q]}}
34 %ret = call <4 x i64> @llvm.experimental.constrained.fptoui.v4i64.v4f16(<4 x half> %a,
35 metadata !"fpexcept.strict") #0
39 define <8 x i32> @strict_vector_fptosi_v8f16_to_v8i32(<8 x half> %a) #0 {
40 ; CHECK-LABEL: strict_vector_fptosi_v8f16_to_v8i32:
42 ; CHECK-NEXT: vcvttph2dq %xmm0, %ymm0
43 ; CHECK-NEXT: ret{{[l|q]}}
44 %ret = call <8 x i32> @llvm.experimental.constrained.fptosi.v8i32.v8f16(<8 x half> %a,
45 metadata !"fpexcept.strict") #0
49 define <8 x i32> @strict_vector_fptoui_v8f16_to_v8i32(<8 x half> %a) #0 {
50 ; CHECK-LABEL: strict_vector_fptoui_v8f16_to_v8i32:
52 ; CHECK-NEXT: vcvttph2udq %xmm0, %ymm0
53 ; CHECK-NEXT: ret{{[l|q]}}
54 %ret = call <8 x i32> @llvm.experimental.constrained.fptoui.v8i32.v8f16(<8 x half> %a,
55 metadata !"fpexcept.strict") #0
59 define <16 x i16> @strict_vector_fptosi_v16f16_to_v16i16(<16 x half> %a) #0 {
60 ; CHECK-LABEL: strict_vector_fptosi_v16f16_to_v16i16:
62 ; CHECK-NEXT: vcvttph2w %ymm0, %ymm0
63 ; CHECK-NEXT: ret{{[l|q]}}
64 %ret = call <16 x i16> @llvm.experimental.constrained.fptosi.v16i16.v16f16(<16 x half> %a,
65 metadata !"fpexcept.strict") #0
69 define <16 x i16> @strict_vector_fptoui_v16f16_to_v16i16(<16 x half> %a) #0 {
70 ; CHECK-LABEL: strict_vector_fptoui_v16f16_to_v16i16:
72 ; CHECK-NEXT: vcvttph2uw %ymm0, %ymm0
73 ; CHECK-NEXT: ret{{[l|q]}}
74 %ret = call <16 x i16> @llvm.experimental.constrained.fptoui.v16i16.v16f16(<16 x half> %a,
75 metadata !"fpexcept.strict") #0
79 define <16 x i8> @strict_vector_fptosi_v16f16_to_v16i8(<16 x half> %a) #0 {
80 ; CHECK-LABEL: strict_vector_fptosi_v16f16_to_v16i8:
82 ; CHECK-NEXT: vcvttph2dq %ymm0, %zmm0
83 ; CHECK-NEXT: vpmovdb %zmm0, %xmm0
84 ; CHECK-NEXT: vzeroupper
85 ; CHECK-NEXT: ret{{[l|q]}}
86 %ret = call <16 x i8> @llvm.experimental.constrained.fptosi.v16i8.v16f16(<16 x half> %a,
87 metadata !"fpexcept.strict") #0
91 define <16 x i8> @strict_vector_fptoui_v16f16_to_v16i8(<16 x half> %a) #0 {
92 ; CHECK-LABEL: strict_vector_fptoui_v16f16_to_v16i8:
94 ; CHECK-NEXT: vcvttph2dq %ymm0, %zmm0
95 ; CHECK-NEXT: vpmovdb %zmm0, %xmm0
96 ; CHECK-NEXT: vzeroupper
97 ; CHECK-NEXT: ret{{[l|q]}}
98 %ret = call <16 x i8> @llvm.experimental.constrained.fptoui.v16i8.v16f16(<16 x half> %a,
99 metadata !"fpexcept.strict") #0
103 define <16 x i1> @strict_vector_fptosi_v16f16_to_v16i1(<16 x half> %a) #0 {
104 ; CHECK-LABEL: strict_vector_fptosi_v16f16_to_v16i1:
106 ; CHECK-NEXT: vcvttph2dq %ymm0, %zmm0
107 ; CHECK-NEXT: vpmovd2m %zmm0, %k0
108 ; CHECK-NEXT: vpmovm2b %k0, %xmm0
109 ; CHECK-NEXT: vzeroupper
110 ; CHECK-NEXT: ret{{[l|q]}}
111 %ret = call <16 x i1> @llvm.experimental.constrained.fptosi.v16i1.v16f16(<16 x half> %a,
112 metadata !"fpexcept.strict") #0
116 define <16 x i1> @strict_vector_fptoui_v16f16_to_v16i1(<16 x half> %a) #0 {
117 ; CHECK-LABEL: strict_vector_fptoui_v16f16_to_v16i1:
119 ; CHECK-NEXT: vcvttph2dq %ymm0, %zmm0
120 ; CHECK-NEXT: vpslld $31, %zmm0, %zmm0
121 ; CHECK-NEXT: vpmovd2m %zmm0, %k0
122 ; CHECK-NEXT: vpmovm2b %k0, %xmm0
123 ; CHECK-NEXT: vzeroupper
124 ; CHECK-NEXT: ret{{[l|q]}}
125 %ret = call <16 x i1> @llvm.experimental.constrained.fptoui.v16i1.v16f16(<16 x half> %a,
126 metadata !"fpexcept.strict") #0
130 attributes #0 = { strictfp }