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 <16 x half> @llvm.experimental.constrained.fadd.v16f16(<16 x half>, <16 x half>, metadata, metadata)
6 declare <16 x half> @llvm.experimental.constrained.fsub.v16f16(<16 x half>, <16 x half>, metadata, metadata)
7 declare <16 x half> @llvm.experimental.constrained.fmul.v16f16(<16 x half>, <16 x half>, metadata, metadata)
8 declare <16 x half> @llvm.experimental.constrained.fdiv.v16f16(<16 x half>, <16 x half>, metadata, metadata)
9 declare <16 x half> @llvm.experimental.constrained.sqrt.v16f16(<16 x half>, metadata, metadata)
10 declare <16 x half> @llvm.experimental.constrained.fma.v16f16(<16 x half>, <16 x half>, <16 x half>, metadata, metadata)
11 declare <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4f16(<4 x half>, metadata)
12 declare <8 x float> @llvm.experimental.constrained.fpext.v8f32.v8f16(<8 x half>, metadata)
13 declare <4 x half> @llvm.experimental.constrained.fptrunc.v4f16.v4f64(<4 x double>, metadata, metadata)
14 declare <8 x half> @llvm.experimental.constrained.fptrunc.v8f16.v8f32(<8 x float>, metadata, metadata)
15 declare <16 x half> @llvm.experimental.constrained.ceil.v16f16(<16 x half>, metadata)
16 declare <16 x half> @llvm.experimental.constrained.floor.v16f16(<16 x half>, metadata)
17 declare <16 x half> @llvm.experimental.constrained.trunc.v16f16(<16 x half>, metadata)
18 declare <16 x half> @llvm.experimental.constrained.rint.v16f16(<16 x half>, metadata, metadata)
19 declare <16 x half> @llvm.experimental.constrained.nearbyint.v16f16(<16 x half>, metadata, metadata)
21 define <16 x half> @f2(<16 x half> %a, <16 x half> %b) #0 {
24 ; CHECK-NEXT: vaddph %ymm1, %ymm0, %ymm0
25 ; CHECK-NEXT: ret{{[l|q]}}
26 %ret = call <16 x half> @llvm.experimental.constrained.fadd.v16f16(<16 x half> %a, <16 x half> %b,
27 metadata !"round.dynamic",
28 metadata !"fpexcept.strict") #0
32 define <16 x half> @f4(<16 x half> %a, <16 x half> %b) #0 {
35 ; CHECK-NEXT: vsubph %ymm1, %ymm0, %ymm0
36 ; CHECK-NEXT: ret{{[l|q]}}
37 %ret = call <16 x half> @llvm.experimental.constrained.fsub.v16f16(<16 x half> %a, <16 x half> %b,
38 metadata !"round.dynamic",
39 metadata !"fpexcept.strict") #0
43 define <16 x half> @f6(<16 x half> %a, <16 x half> %b) #0 {
46 ; CHECK-NEXT: vmulph %ymm1, %ymm0, %ymm0
47 ; CHECK-NEXT: ret{{[l|q]}}
48 %ret = call <16 x half> @llvm.experimental.constrained.fmul.v16f16(<16 x half> %a, <16 x half> %b,
49 metadata !"round.dynamic",
50 metadata !"fpexcept.strict") #0
54 define <16 x half> @f8(<16 x half> %a, <16 x half> %b) #0 {
57 ; CHECK-NEXT: vdivph %ymm1, %ymm0, %ymm0
58 ; CHECK-NEXT: ret{{[l|q]}}
59 %ret = call <16 x half> @llvm.experimental.constrained.fdiv.v16f16(<16 x half> %a, <16 x half> %b,
60 metadata !"round.dynamic",
61 metadata !"fpexcept.strict") #0
66 define <16 x half> @f10(<16 x half> %a) #0 {
69 ; CHECK-NEXT: vsqrtph %ymm0, %ymm0
70 ; CHECK-NEXT: ret{{[l|q]}}
71 %ret = call <16 x half> @llvm.experimental.constrained.sqrt.v16f16(
73 metadata !"round.dynamic",
74 metadata !"fpexcept.strict") #0
78 define <4 x double> @f11(<4 x half> %a) #0 {
81 ; CHECK-NEXT: vcvtph2pd %xmm0, %ymm0
82 ; CHECK-NEXT: ret{{[l|q]}}
83 %ret = call <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4f16(
85 metadata !"fpexcept.strict") #0
89 define <4 x half> @f12(<4 x double> %a) #0 {
92 ; CHECK-NEXT: vcvtpd2ph %ymm0, %xmm0
93 ; CHECK-NEXT: vzeroupper
94 ; CHECK-NEXT: ret{{[l|q]}}
95 %ret = call <4 x half> @llvm.experimental.constrained.fptrunc.v4f16.v4f64(
97 metadata !"round.dynamic",
98 metadata !"fpexcept.strict") #0
102 define <16 x half> @f13(<16 x half> %a, <16 x half> %b, <16 x half> %c) #0 {
105 ; CHECK-NEXT: vfmadd213ph %ymm2, %ymm1, %ymm0
106 ; CHECK-NEXT: ret{{[l|q]}}
107 %res = call <16 x half> @llvm.experimental.constrained.fma.v16f16(<16 x half> %a, <16 x half> %b, <16 x half> %c,
108 metadata !"round.dynamic",
109 metadata !"fpexcept.strict") #0
113 define <8 x float> @f14(<8 x half> %a) #0 {
116 ; CHECK-NEXT: vcvtph2psx %xmm0, %ymm0
117 ; CHECK-NEXT: ret{{[l|q]}}
118 %ret = call <8 x float> @llvm.experimental.constrained.fpext.v8f32.v8f16(
120 metadata !"fpexcept.strict") #0
124 define <8 x half> @f15(<8 x float> %a) #0 {
127 ; CHECK-NEXT: vcvtps2phx %ymm0, %xmm0
128 ; CHECK-NEXT: vzeroupper
129 ; CHECK-NEXT: ret{{[l|q]}}
130 %ret = call <8 x half> @llvm.experimental.constrained.fptrunc.v8f16.v8f32(
132 metadata !"round.dynamic",
133 metadata !"fpexcept.strict") #0
137 define <16 x half> @fceilv16f16(<16 x half> %f) #0 {
138 ; CHECK-LABEL: fceilv16f16:
140 ; CHECK-NEXT: vrndscaleph $10, %ymm0, %ymm0
141 ; CHECK-NEXT: ret{{[l|q]}}
142 %res = call <16 x half> @llvm.experimental.constrained.ceil.v16f16(
143 <16 x half> %f, metadata !"fpexcept.strict") #0
147 define <16 x half> @ffloorv16f16(<16 x half> %f) #0 {
148 ; CHECK-LABEL: ffloorv16f16:
150 ; CHECK-NEXT: vrndscaleph $9, %ymm0, %ymm0
151 ; CHECK-NEXT: ret{{[l|q]}}
152 %res = call <16 x half> @llvm.experimental.constrained.floor.v16f16(
153 <16 x half> %f, metadata !"fpexcept.strict") #0
158 define <16 x half> @ftruncv16f16(<16 x half> %f) #0 {
159 ; CHECK-LABEL: ftruncv16f16:
161 ; CHECK-NEXT: vrndscaleph $11, %ymm0, %ymm0
162 ; CHECK-NEXT: ret{{[l|q]}}
163 %res = call <16 x half> @llvm.experimental.constrained.trunc.v16f16(
164 <16 x half> %f, metadata !"fpexcept.strict") #0
168 define <16 x half> @frintv16f16(<16 x half> %f) #0 {
169 ; CHECK-LABEL: frintv16f16:
171 ; CHECK-NEXT: vrndscaleph $4, %ymm0, %ymm0
172 ; CHECK-NEXT: ret{{[l|q]}}
173 %res = call <16 x half> @llvm.experimental.constrained.rint.v16f16(
175 metadata !"round.dynamic", metadata !"fpexcept.strict") #0
179 define <16 x half> @fnearbyintv16f16(<16 x half> %f) #0 {
180 ; CHECK-LABEL: fnearbyintv16f16:
182 ; CHECK-NEXT: vrndscaleph $12, %ymm0, %ymm0
183 ; CHECK-NEXT: ret{{[l|q]}}
184 %res = call <16 x half> @llvm.experimental.constrained.nearbyint.v16f16(
186 metadata !"round.dynamic", metadata !"fpexcept.strict") #0
190 attributes #0 = { strictfp }