[RISCV] Add shrinkwrap test cases showing gaps in current impl
[llvm-project.git] / llvm / test / CodeGen / X86 / vec-strict-512-fp16.ll
blobdfbc11a43d3d7c6ab8207910702af53d2f4dd1bd
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512fp16 -mattr=+avx512vl -O3 | FileCheck %s
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512fp16 -mattr=+avx512vl -O3 | FileCheck %s
5 declare <32 x half> @llvm.experimental.constrained.fadd.v32f16(<32 x half>, <32 x half>, metadata, metadata)
6 declare <32 x half> @llvm.experimental.constrained.fsub.v32f16(<32 x half>, <32 x half>, metadata, metadata)
7 declare <32 x half> @llvm.experimental.constrained.fmul.v32f16(<32 x half>, <32 x half>, metadata, metadata)
8 declare <32 x half> @llvm.experimental.constrained.fdiv.v32f16(<32 x half>, <32 x half>, metadata, metadata)
9 declare <32 x half> @llvm.experimental.constrained.sqrt.v32f16(<32 x half>, metadata, metadata)
10 declare <8 x double> @llvm.experimental.constrained.fpext.v8f64.v8f16(<8 x half>, metadata)
11 declare <16 x float> @llvm.experimental.constrained.fpext.v16f32.v16f16(<16 x half>, metadata)
12 declare <8 x half> @llvm.experimental.constrained.fptrunc.v8f16.v8f64(<8 x double>, metadata, metadata)
13 declare <16 x half> @llvm.experimental.constrained.fptrunc.v16f16.v16f32(<16 x float>, metadata, metadata)
14 declare <32 x half> @llvm.experimental.constrained.fma.v32f16(<32 x half>, <32 x half>, <32 x half>, metadata, metadata)
15 declare <32 x half> @llvm.experimental.constrained.ceil.v32f16(<32 x half>, metadata)
16 declare <32 x half> @llvm.experimental.constrained.floor.v32f16(<32 x half>, metadata)
17 declare <32 x half> @llvm.experimental.constrained.trunc.v32f16(<32 x half>, metadata)
18 declare <32 x half> @llvm.experimental.constrained.rint.v32f16(<32 x half>, metadata, metadata)
19 declare <32 x half> @llvm.experimental.constrained.nearbyint.v32f16(<32 x half>, metadata, metadata)
21 define <32 x half> @f2(<32 x half> %a, <32 x half> %b) #0 {
22 ; CHECK-LABEL: f2:
23 ; CHECK:       # %bb.0:
24 ; CHECK-NEXT:    vaddph %zmm1, %zmm0, %zmm0
25 ; CHECK-NEXT:    ret{{[l|q]}}
26   %ret = call <32 x half> @llvm.experimental.constrained.fadd.v32f16(<32 x half> %a, <32 x half> %b,
27                                                                      metadata !"round.dynamic",
28                                                                      metadata !"fpexcept.strict") #0
29   ret <32 x half> %ret
32 define <32 x half> @f4(<32 x half> %a, <32 x half> %b) #0 {
33 ; CHECK-LABEL: f4:
34 ; CHECK:       # %bb.0:
35 ; CHECK-NEXT:    vsubph %zmm1, %zmm0, %zmm0
36 ; CHECK-NEXT:    ret{{[l|q]}}
37   %ret = call <32 x half> @llvm.experimental.constrained.fsub.v32f16(<32 x half> %a, <32 x half> %b,
38                                                                      metadata !"round.dynamic",
39                                                                      metadata !"fpexcept.strict") #0
40   ret <32 x half> %ret
43 define <32 x half> @f6(<32 x half> %a, <32 x half> %b) #0 {
44 ; CHECK-LABEL: f6:
45 ; CHECK:       # %bb.0:
46 ; CHECK-NEXT:    vmulph %zmm1, %zmm0, %zmm0
47 ; CHECK-NEXT:    ret{{[l|q]}}
48   %ret = call <32 x half> @llvm.experimental.constrained.fmul.v32f16(<32 x half> %a, <32 x half> %b,
49                                                                      metadata !"round.dynamic",
50                                                                      metadata !"fpexcept.strict") #0
51   ret <32 x half> %ret
54 define <32 x half> @f8(<32 x half> %a, <32 x half> %b) #0 {
55 ; CHECK-LABEL: f8:
56 ; CHECK:       # %bb.0:
57 ; CHECK-NEXT:    vdivph %zmm1, %zmm0, %zmm0
58 ; CHECK-NEXT:    ret{{[l|q]}}
59   %ret = call <32 x half> @llvm.experimental.constrained.fdiv.v32f16(<32 x half> %a, <32 x half> %b,
60                                                                      metadata !"round.dynamic",
61                                                                      metadata !"fpexcept.strict") #0
62   ret <32 x half> %ret
65 define <32 x half> @f10(<32 x half> %a) #0 {
66 ; CHECK-LABEL: f10:
67 ; CHECK:       # %bb.0:
68 ; CHECK-NEXT:    vsqrtph %zmm0, %zmm0
69 ; CHECK-NEXT:    ret{{[l|q]}}
70   %ret = call <32 x half> @llvm.experimental.constrained.sqrt.v32f16(
71                               <32 x half> %a,
72                               metadata !"round.dynamic",
73                               metadata !"fpexcept.strict") #0
74   ret <32 x half > %ret
77 define <8 x double> @f11(<8 x half> %a) #0 {
78 ; CHECK-LABEL: f11:
79 ; CHECK:       # %bb.0:
80 ; CHECK-NEXT:    vcvtph2pd %xmm0, %zmm0
81 ; CHECK-NEXT:    ret{{[l|q]}}
82   %ret = call <8 x double> @llvm.experimental.constrained.fpext.v8f64.v8f16(
83                                 <8 x half> %a,
84                                 metadata !"fpexcept.strict") #0
85   ret <8 x double> %ret
88 define <8 x half> @f12(<8 x double> %a) #0 {
89 ; CHECK-LABEL: f12:
90 ; CHECK:       # %bb.0:
91 ; CHECK-NEXT:    vcvtpd2ph %zmm0, %xmm0
92 ; CHECK-NEXT:    vzeroupper
93 ; CHECK-NEXT:    ret{{[l|q]}}
94   %ret = call <8 x half> @llvm.experimental.constrained.fptrunc.v8f16.v8f64(
95                                 <8 x double> %a,
96                                 metadata !"round.dynamic",
97                                 metadata !"fpexcept.strict") #0
98   ret <8 x half> %ret
101 define <32 x half> @f13(<32 x half> %a, <32 x half> %b, <32 x half> %c) #0 {
102 ; CHECK-LABEL: f13:
103 ; CHECK:       # %bb.0:
104 ; CHECK-NEXT:    vfmadd213ph %zmm2, %zmm1, %zmm0
105 ; CHECK-NEXT:    ret{{[l|q]}}
106   %res = call <32 x half> @llvm.experimental.constrained.fma.v32f16(<32 x half> %a, <32 x half> %b, <32 x half> %c,
107                                                                     metadata !"round.dynamic",
108                                                                     metadata !"fpexcept.strict") #0
109   ret <32 x half> %res
112 define <16 x float> @f14(<16 x half> %a) #0 {
113 ; CHECK-LABEL: f14:
114 ; CHECK:       # %bb.0:
115 ; CHECK-NEXT:    vcvtph2psx %ymm0, %zmm0
116 ; CHECK-NEXT:    ret{{[l|q]}}
117   %ret = call <16 x float> @llvm.experimental.constrained.fpext.v16f32.v16f16(
118                                 <16 x half> %a,
119                                 metadata !"fpexcept.strict") #0
120   ret <16 x float> %ret
123 define <16 x half> @f15(<16 x float> %a) #0 {
124 ; CHECK-LABEL: f15:
125 ; CHECK:       # %bb.0:
126 ; CHECK-NEXT:    vcvtps2phx %zmm0, %ymm0
127 ; CHECK-NEXT:    ret{{[l|q]}}
128   %ret = call <16 x half> @llvm.experimental.constrained.fptrunc.v16f16.v16f32(
129                                 <16 x float> %a,
130                                 metadata !"round.dynamic",
131                                 metadata !"fpexcept.strict") #0
132   ret <16 x half> %ret
135 define <32 x half> @strict_vector_fceil_v32f16(<32 x half> %f) #0 {
136 ; CHECK-LABEL: strict_vector_fceil_v32f16:
137 ; CHECK:       # %bb.0:
138 ; CHECK-NEXT:    vrndscaleph $10, %zmm0, %zmm0
139 ; CHECK-NEXT:    ret{{[l|q]}}
140   %res = call <32 x half> @llvm.experimental.constrained.ceil.v32f16(<32 x half> %f, metadata !"fpexcept.strict") #0
141   ret <32 x half> %res
144 define <32 x half> @strict_vector_ffloor_v32f16(<32 x half> %f) #0 {
145 ; CHECK-LABEL: strict_vector_ffloor_v32f16:
146 ; CHECK:       # %bb.0:
147 ; CHECK-NEXT:    vrndscaleph $9, %zmm0, %zmm0
148 ; CHECK-NEXT:    ret{{[l|q]}}
149   %res = call <32 x half> @llvm.experimental.constrained.floor.v32f16(<32 x half> %f, metadata !"fpexcept.strict") #0
150   ret <32 x half> %res
153 define <32 x half> @strict_vector_ftrunc_v32f16(<32 x half> %f) #0 {
154 ; CHECK-LABEL: strict_vector_ftrunc_v32f16:
155 ; CHECK:       # %bb.0:
156 ; CHECK-NEXT:    vrndscaleph $11, %zmm0, %zmm0
157 ; CHECK-NEXT:    ret{{[l|q]}}
158   %res = call <32 x half> @llvm.experimental.constrained.trunc.v32f16(<32 x half> %f, metadata !"fpexcept.strict") #0
159   ret <32 x half> %res
162 define <32 x half> @strict_vector_frint_v32f16(<32 x half> %f) #0 {
163 ; CHECK-LABEL: strict_vector_frint_v32f16:
164 ; CHECK:       # %bb.0:
165 ; CHECK-NEXT:    vrndscaleph $4, %zmm0, %zmm0
166 ; CHECK-NEXT:    ret{{[l|q]}}
167   %res = call <32 x half> @llvm.experimental.constrained.rint.v32f16(<32 x half> %f,
168                              metadata !"round.dynamic", metadata !"fpexcept.strict") #0
169   ret <32 x half> %res
172 define <32 x half> @strict_vector_fnearbyint_v32f16(<32 x half> %f) #0 {
173 ; CHECK-LABEL: strict_vector_fnearbyint_v32f16:
174 ; CHECK:       # %bb.0:
175 ; CHECK-NEXT:    vrndscaleph $12, %zmm0, %zmm0
176 ; CHECK-NEXT:    ret{{[l|q]}}
177   %res = call <32 x half> @llvm.experimental.constrained.nearbyint.v32f16(<32 x half> %f,
178                              metadata !"round.dynamic", metadata !"fpexcept.strict") #0
179   ret <32 x half> %res
182 attributes #0 = { strictfp }