[AArch64,ELF] Restrict MOVZ/MOVK to non-PIC large code model (#70178)
[llvm-project.git] / llvm / test / CodeGen / X86 / vec-strict-inttofp-512-fp16.ll
blob5067a2e9c42123d7f8922ba15dcddad30d7185da
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=avx512fp16 -O3 | FileCheck %s --check-prefixes=CHECK,X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=avx512fp16 -O3 | FileCheck %s --check-prefixes=CHECK,X64
5 declare <32 x half> @llvm.experimental.constrained.sitofp.v32f16.v32i1(<32 x i1>, metadata, metadata)
6 declare <32 x half> @llvm.experimental.constrained.uitofp.v32f16.v32i1(<32 x i1>, metadata, metadata)
7 declare <32 x half> @llvm.experimental.constrained.sitofp.v32f16.v32i8(<32 x i8>, metadata, metadata)
8 declare <32 x half> @llvm.experimental.constrained.uitofp.v32f16.v32i8(<32 x i8>, metadata, metadata)
9 declare <32 x half> @llvm.experimental.constrained.sitofp.v32f16.v32i16(<32 x i16>, metadata, metadata)
10 declare <32 x half> @llvm.experimental.constrained.uitofp.v32f16.v32i16(<32 x i16>, metadata, metadata)
11 declare <16 x half> @llvm.experimental.constrained.sitofp.v16f16.v16i32(<16 x i32>, metadata, metadata)
12 declare <16 x half> @llvm.experimental.constrained.uitofp.v16f16.v16i32(<16 x i32>, metadata, metadata)
13 declare <8 x half> @llvm.experimental.constrained.sitofp.v8f16.v8i64(<8 x i64>, metadata, metadata)
14 declare <8 x half> @llvm.experimental.constrained.uitofp.v8f16.v8i64(<8 x i64>, metadata, metadata)
16 define <32 x half> @sitofp_v32i1_v32f16(<32 x i1> %x) #0 {
17 ; CHECK-LABEL: sitofp_v32i1_v32f16:
18 ; CHECK:       # %bb.0:
19 ; CHECK-NEXT:    vpmovzxbw {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero,ymm0[16],zero,ymm0[17],zero,ymm0[18],zero,ymm0[19],zero,ymm0[20],zero,ymm0[21],zero,ymm0[22],zero,ymm0[23],zero,ymm0[24],zero,ymm0[25],zero,ymm0[26],zero,ymm0[27],zero,ymm0[28],zero,ymm0[29],zero,ymm0[30],zero,ymm0[31],zero
20 ; CHECK-NEXT:    vpsllw $15, %zmm0, %zmm0
21 ; CHECK-NEXT:    vpsraw $15, %zmm0, %zmm0
22 ; CHECK-NEXT:    vcvtw2ph %zmm0, %zmm0
23 ; CHECK-NEXT:    ret{{[l|q]}}
24  %result = call <32 x half> @llvm.experimental.constrained.sitofp.v32f16.v32i1(<32 x i1> %x,
25                                                               metadata !"round.dynamic",
26                                                               metadata !"fpexcept.strict") #0
27   ret <32 x half> %result
30 define <32 x half> @uitofp_v32i1_v32f16(<32 x i1> %x) #0 {
31 ; X86-LABEL: uitofp_v32i1_v32f16:
32 ; X86:       # %bb.0:
33 ; X86-NEXT:    vpandd {{\.?LCPI[0-9]+_[0-9]+}}{1to8}, %ymm0, %ymm0
34 ; X86-NEXT:    vpmovzxbw {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero,ymm0[16],zero,ymm0[17],zero,ymm0[18],zero,ymm0[19],zero,ymm0[20],zero,ymm0[21],zero,ymm0[22],zero,ymm0[23],zero,ymm0[24],zero,ymm0[25],zero,ymm0[26],zero,ymm0[27],zero,ymm0[28],zero,ymm0[29],zero,ymm0[30],zero,ymm0[31],zero
35 ; X86-NEXT:    vcvtuw2ph %zmm0, %zmm0
36 ; X86-NEXT:    retl
38 ; X64-LABEL: uitofp_v32i1_v32f16:
39 ; X64:       # %bb.0:
40 ; X64-NEXT:    vpandd {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %ymm0, %ymm0
41 ; X64-NEXT:    vpmovzxbw {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero,ymm0[16],zero,ymm0[17],zero,ymm0[18],zero,ymm0[19],zero,ymm0[20],zero,ymm0[21],zero,ymm0[22],zero,ymm0[23],zero,ymm0[24],zero,ymm0[25],zero,ymm0[26],zero,ymm0[27],zero,ymm0[28],zero,ymm0[29],zero,ymm0[30],zero,ymm0[31],zero
42 ; X64-NEXT:    vcvtuw2ph %zmm0, %zmm0
43 ; X64-NEXT:    retq
44  %result = call <32 x half> @llvm.experimental.constrained.uitofp.v32f16.v32i1(<32 x i1> %x,
45                                                               metadata !"round.dynamic",
46                                                               metadata !"fpexcept.strict") #0
47   ret <32 x half> %result
50 define <32 x half> @sitofp_v32i8_v32f16(<32 x i8> %x) #0 {
51 ; CHECK-LABEL: sitofp_v32i8_v32f16:
52 ; CHECK:       # %bb.0:
53 ; CHECK-NEXT:    vpmovsxbw %ymm0, %zmm0
54 ; CHECK-NEXT:    vcvtw2ph %zmm0, %zmm0
55 ; CHECK-NEXT:    ret{{[l|q]}}
56  %result = call <32 x half> @llvm.experimental.constrained.sitofp.v32f16.v32i8(<32 x i8> %x,
57                                                               metadata !"round.dynamic",
58                                                               metadata !"fpexcept.strict") #0
59   ret <32 x half> %result
62 define <32 x half> @uitofp_v32i8_v32f16(<32 x i8> %x) #0 {
63 ; CHECK-LABEL: uitofp_v32i8_v32f16:
64 ; CHECK:       # %bb.0:
65 ; CHECK-NEXT:    vpmovzxbw {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero,ymm0[16],zero,ymm0[17],zero,ymm0[18],zero,ymm0[19],zero,ymm0[20],zero,ymm0[21],zero,ymm0[22],zero,ymm0[23],zero,ymm0[24],zero,ymm0[25],zero,ymm0[26],zero,ymm0[27],zero,ymm0[28],zero,ymm0[29],zero,ymm0[30],zero,ymm0[31],zero
66 ; CHECK-NEXT:    vcvtuw2ph %zmm0, %zmm0
67 ; CHECK-NEXT:    ret{{[l|q]}}
68  %result = call <32 x half> @llvm.experimental.constrained.uitofp.v32f16.v32i8(<32 x i8> %x,
69                                                               metadata !"round.dynamic",
70                                                               metadata !"fpexcept.strict") #0
71   ret <32 x half> %result
74 define <32 x half> @sitofp_v32i16_v32f16(<32 x i16> %x) #0 {
75 ; CHECK-LABEL: sitofp_v32i16_v32f16:
76 ; CHECK:       # %bb.0:
77 ; CHECK-NEXT:    vcvtw2ph %zmm0, %zmm0
78 ; CHECK-NEXT:    ret{{[l|q]}}
79  %result = call <32 x half> @llvm.experimental.constrained.sitofp.v32f16.v32i16(<32 x i16> %x,
80                                                               metadata !"round.dynamic",
81                                                               metadata !"fpexcept.strict") #0
82   ret <32 x half> %result
85 define <32 x half> @uitofp_v32i16_v32f16(<32 x i16> %x) #0 {
86 ; CHECK-LABEL: uitofp_v32i16_v32f16:
87 ; CHECK:       # %bb.0:
88 ; CHECK-NEXT:    vcvtuw2ph %zmm0, %zmm0
89 ; CHECK-NEXT:    ret{{[l|q]}}
90  %result = call <32 x half> @llvm.experimental.constrained.uitofp.v32f16.v32i16(<32 x i16> %x,
91                                                               metadata !"round.dynamic",
92                                                               metadata !"fpexcept.strict") #0
93   ret <32 x half> %result
96 define <16 x half> @sitofp_v16i32_v16f16(<16 x i32> %x) #0 {
97 ; CHECK-LABEL: sitofp_v16i32_v16f16:
98 ; CHECK:       # %bb.0:
99 ; CHECK-NEXT:    vcvtdq2ph %zmm0, %ymm0
100 ; CHECK-NEXT:    ret{{[l|q]}}
101  %result = call <16 x half> @llvm.experimental.constrained.sitofp.v16f16.v16i32(<16 x i32> %x,
102                                                               metadata !"round.dynamic",
103                                                               metadata !"fpexcept.strict") #0
104   ret <16 x half> %result
107 define <16 x half> @uitofp_v16i32_v16f16(<16 x i32> %x) #0 {
108 ; CHECK-LABEL: uitofp_v16i32_v16f16:
109 ; CHECK:       # %bb.0:
110 ; CHECK-NEXT:    vcvtudq2ph %zmm0, %ymm0
111 ; CHECK-NEXT:    ret{{[l|q]}}
112  %result = call <16 x half> @llvm.experimental.constrained.uitofp.v16f16.v16i32(<16 x i32> %x,
113                                                               metadata !"round.dynamic",
114                                                               metadata !"fpexcept.strict") #0
115   ret <16 x half> %result
118 define <8 x half> @sitofp_v8i64_v8f16(<8 x i64> %x) #0 {
119 ; CHECK-LABEL: sitofp_v8i64_v8f16:
120 ; CHECK:       # %bb.0:
121 ; CHECK-NEXT:    vcvtqq2ph %zmm0, %xmm0
122 ; CHECK-NEXT:    vzeroupper
123 ; CHECK-NEXT:    ret{{[l|q]}}
124  %result = call <8 x half> @llvm.experimental.constrained.sitofp.v8f16.v8i64(<8 x i64> %x,
125                                                               metadata !"round.dynamic",
126                                                               metadata !"fpexcept.strict") #0
127   ret <8 x half> %result
130 define <8 x half> @uitofp_v8i64_v8f16(<8 x i64> %x) #0 {
131 ; CHECK-LABEL: uitofp_v8i64_v8f16:
132 ; CHECK:       # %bb.0:
133 ; CHECK-NEXT:    vcvtuqq2ph %zmm0, %xmm0
134 ; CHECK-NEXT:    vzeroupper
135 ; CHECK-NEXT:    ret{{[l|q]}}
136  %result = call <8 x half> @llvm.experimental.constrained.uitofp.v8f16.v8i64(<8 x i64> %x,
137                                                               metadata !"round.dynamic",
138                                                               metadata !"fpexcept.strict") #0
139   ret <8 x half> %result
142 attributes #0 = { strictfp }