Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / CodeGen / X86 / vec-strict-inttofp-128-fp16.ll
blobebdf12321b22f0af1c62b02a98b165dd55496bb7
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,X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=avx512fp16,avx512vl -O3 | FileCheck %s --check-prefixes=CHECK,X64
5 declare <8 x half> @llvm.experimental.constrained.sitofp.v8f16.v8i1(<8 x i1>, metadata, metadata)
6 declare <8 x half> @llvm.experimental.constrained.uitofp.v8f16.v8i1(<8 x i1>, metadata, metadata)
7 declare <8 x half> @llvm.experimental.constrained.sitofp.v8f16.v8i8(<8 x i8>, metadata, metadata)
8 declare <8 x half> @llvm.experimental.constrained.uitofp.v8f16.v8i8(<8 x i8>, metadata, metadata)
9 declare <8 x half> @llvm.experimental.constrained.sitofp.v8f16.v8i16(<8 x i16>, metadata, metadata)
10 declare <8 x half> @llvm.experimental.constrained.uitofp.v8f16.v8i16(<8 x i16>, metadata, metadata)
11 declare <4 x half> @llvm.experimental.constrained.sitofp.v4f16.v4i32(<4 x i32>, metadata, metadata)
12 declare <4 x half> @llvm.experimental.constrained.uitofp.v4f16.v4i32(<4 x i32>, metadata, metadata)
13 declare <2 x half> @llvm.experimental.constrained.sitofp.v2f16.v2i64(<2 x i64>, metadata, metadata)
14 declare <2 x half> @llvm.experimental.constrained.uitofp.v2f16.v2i64(<2 x i64>, metadata, metadata)
16 define <4 x half> @sitofp_v4i32_v4f16(<4 x i32> %x) #0 {
17 ; CHECK-LABEL: sitofp_v4i32_v4f16:
18 ; CHECK:       # %bb.0:
19 ; CHECK-NEXT:    vcvtdq2ph %xmm0, %xmm0
20 ; CHECK-NEXT:    ret{{[l|q]}}
21  %result = call <4 x half> @llvm.experimental.constrained.sitofp.v4f16.v4i32(<4 x i32> %x,
22                                                               metadata !"round.dynamic",
23                                                               metadata !"fpexcept.strict") #0
24   ret <4 x half> %result
27 define <4 x half> @uitofp_v4i32_v4f16(<4 x i32> %x) #0 {
28 ; CHECK-LABEL: uitofp_v4i32_v4f16:
29 ; CHECK:       # %bb.0:
30 ; CHECK-NEXT:    vcvtudq2ph %xmm0, %xmm0
31 ; CHECK-NEXT:    ret{{[l|q]}}
32  %result = call <4 x half> @llvm.experimental.constrained.uitofp.v4f16.v4i32(<4 x i32> %x,
33                                                               metadata !"round.dynamic",
34                                                               metadata !"fpexcept.strict") #0
35   ret <4 x half> %result
38 define <2 x half> @sitofp_v2i64_v2f16(<2 x i64> %x) #0 {
39 ; CHECK-LABEL: sitofp_v2i64_v2f16:
40 ; CHECK:       # %bb.0:
41 ; CHECK-NEXT:    vcvtqq2ph %xmm0, %xmm0
42 ; CHECK-NEXT:    ret{{[l|q]}}
43  %result = call <2 x half> @llvm.experimental.constrained.sitofp.v2f16.v2i64(<2 x i64> %x,
44                                                               metadata !"round.dynamic",
45                                                               metadata !"fpexcept.strict") #0
46   ret <2 x half> %result
49 define <2 x half> @uitofp_v2i64_v2f16(<2 x i64> %x) #0 {
50 ; CHECK-LABEL: uitofp_v2i64_v2f16:
51 ; CHECK:       # %bb.0:
52 ; CHECK-NEXT:    vcvtuqq2ph %xmm0, %xmm0
53 ; CHECK-NEXT:    ret{{[l|q]}}
54  %result = call <2 x half> @llvm.experimental.constrained.uitofp.v2f16.v2i64(<2 x i64> %x,
55                                                               metadata !"round.dynamic",
56                                                               metadata !"fpexcept.strict") #0
57   ret <2 x half> %result
60 define <8 x half> @sitofp_v8i1_v8f16(<8 x i1> %x) #0 {
61 ; CHECK-LABEL: sitofp_v8i1_v8f16:
62 ; CHECK:       # %bb.0:
63 ; CHECK-NEXT:    vpsllw $15, %xmm0, %xmm0
64 ; CHECK-NEXT:    vpsraw $15, %xmm0, %xmm0
65 ; CHECK-NEXT:    vcvtw2ph %xmm0, %xmm0
66 ; CHECK-NEXT:    ret{{[l|q]}}
67  %result = call <8 x half> @llvm.experimental.constrained.sitofp.v8f16.v8i1(<8 x i1> %x,
68                                                               metadata !"round.dynamic",
69                                                               metadata !"fpexcept.strict") #0
70   ret <8 x half> %result
73 define <8 x half> @uitofp_v8i1_v8f16(<8 x i1> %x) #0 {
74 ; X86-LABEL: uitofp_v8i1_v8f16:
75 ; X86:       # %bb.0:
76 ; X86-NEXT:    vandps {{\.?LCPI[0-9]+_[0-9]+}}{1to4}, %xmm0, %xmm0
77 ; X86-NEXT:    vcvtuw2ph %xmm0, %xmm0
78 ; X86-NEXT:    retl
80 ; X64-LABEL: uitofp_v8i1_v8f16:
81 ; X64:       # %bb.0:
82 ; X64-NEXT:    vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm0, %xmm0
83 ; X64-NEXT:    vcvtuw2ph %xmm0, %xmm0
84 ; X64-NEXT:    retq
85  %result = call <8 x half> @llvm.experimental.constrained.uitofp.v8f16.v8i1(<8 x i1> %x,
86                                                               metadata !"round.dynamic",
87                                                               metadata !"fpexcept.strict") #0
88   ret <8 x half> %result
91 define <8 x half> @sitofp_v8i8_v8f16(<8 x i8> %x) #0 {
92 ; CHECK-LABEL: sitofp_v8i8_v8f16:
93 ; CHECK:       # %bb.0:
94 ; CHECK-NEXT:    vpmovsxbw %xmm0, %xmm0
95 ; CHECK-NEXT:    vcvtw2ph %xmm0, %xmm0
96 ; CHECK-NEXT:    ret{{[l|q]}}
97  %result = call <8 x half> @llvm.experimental.constrained.sitofp.v8f16.v8i8(<8 x i8> %x,
98                                                               metadata !"round.dynamic",
99                                                               metadata !"fpexcept.strict") #0
100   ret <8 x half> %result
103 define <8 x half> @uitofp_v8i8_v8f16(<8 x i8> %x) #0 {
104 ; CHECK-LABEL: uitofp_v8i8_v8f16:
105 ; CHECK:       # %bb.0:
106 ; CHECK-NEXT:    vpmovzxbw {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
107 ; CHECK-NEXT:    vcvtuw2ph %xmm0, %xmm0
108 ; CHECK-NEXT:    ret{{[l|q]}}
109  %result = call <8 x half> @llvm.experimental.constrained.uitofp.v8f16.v8i8(<8 x i8> %x,
110                                                               metadata !"round.dynamic",
111                                                               metadata !"fpexcept.strict") #0
112   ret <8 x half> %result
115 define <8 x half> @sitofp_v8i16_v8f16(<8 x i16> %x) #0 {
116 ; CHECK-LABEL: sitofp_v8i16_v8f16:
117 ; CHECK:       # %bb.0:
118 ; CHECK-NEXT:    vcvtw2ph %xmm0, %xmm0
119 ; CHECK-NEXT:    ret{{[l|q]}}
120  %result = call <8 x half> @llvm.experimental.constrained.sitofp.v8f16.v8i16(<8 x i16> %x,
121                                                               metadata !"round.dynamic",
122                                                               metadata !"fpexcept.strict") #0
123   ret <8 x half> %result
126 define <8 x half> @uitofp_v8i16_v8f16(<8 x i16> %x) #0 {
127 ; CHECK-LABEL: uitofp_v8i16_v8f16:
128 ; CHECK:       # %bb.0:
129 ; CHECK-NEXT:    vcvtuw2ph %xmm0, %xmm0
130 ; CHECK-NEXT:    ret{{[l|q]}}
131  %result = call <8 x half> @llvm.experimental.constrained.uitofp.v8f16.v8i16(<8 x i16> %x,
132                                                               metadata !"round.dynamic",
133                                                               metadata !"fpexcept.strict") #0
134   ret <8 x half> %result
137 attributes #0 = { strictfp }