[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / test / CodeGen / X86 / vec-strict-256-fp16.ll
blobd5868287823fb3eb210b08037fef7b15e0f2aa52
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 <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4f16(<4 x half>, metadata)
11 declare <8 x float> @llvm.experimental.constrained.fpext.v8f32.v8f16(<8 x half>, metadata)
12 declare <4 x half> @llvm.experimental.constrained.fptrunc.v4f16.v4f64(<4 x double>, metadata, metadata)
13 declare <8 x half> @llvm.experimental.constrained.fptrunc.v8f16.v8f32(<8 x float>, metadata, metadata)
14 declare <16 x half> @llvm.experimental.constrained.ceil.v16f16(<16 x half>, metadata)
15 declare <16 x half> @llvm.experimental.constrained.floor.v16f16(<16 x half>, metadata)
16 declare <16 x half> @llvm.experimental.constrained.trunc.v16f16(<16 x half>, metadata)
17 declare <16 x half> @llvm.experimental.constrained.rint.v16f16(<16 x half>, metadata, metadata)
18 declare <16 x half> @llvm.experimental.constrained.nearbyint.v16f16(<16 x half>, metadata, metadata)
20 define <16 x half> @f2(<16 x half> %a, <16 x half> %b) #0 {
21 ; CHECK-LABEL: f2:
22 ; CHECK:       # %bb.0:
23 ; CHECK-NEXT:    vaddph %ymm1, %ymm0, %ymm0
24 ; CHECK-NEXT:    ret{{[l|q]}}
25   %ret = call <16 x half> @llvm.experimental.constrained.fadd.v16f16(<16 x half> %a, <16 x half> %b,
26                                                                      metadata !"round.dynamic",
27                                                                      metadata !"fpexcept.strict") #0
28   ret <16 x half> %ret
31 define <16 x half> @f4(<16 x half> %a, <16 x half> %b) #0 {
32 ; CHECK-LABEL: f4:
33 ; CHECK:       # %bb.0:
34 ; CHECK-NEXT:    vsubph %ymm1, %ymm0, %ymm0
35 ; CHECK-NEXT:    ret{{[l|q]}}
36   %ret = call <16 x half> @llvm.experimental.constrained.fsub.v16f16(<16 x half> %a, <16 x half> %b,
37                                                                      metadata !"round.dynamic",
38                                                                      metadata !"fpexcept.strict") #0
39   ret <16 x half> %ret
42 define <16 x half> @f6(<16 x half> %a, <16 x half> %b) #0 {
43 ; CHECK-LABEL: f6:
44 ; CHECK:       # %bb.0:
45 ; CHECK-NEXT:    vmulph %ymm1, %ymm0, %ymm0
46 ; CHECK-NEXT:    ret{{[l|q]}}
47   %ret = call <16 x half> @llvm.experimental.constrained.fmul.v16f16(<16 x half> %a, <16 x half> %b,
48                                                                      metadata !"round.dynamic",
49                                                                      metadata !"fpexcept.strict") #0
50   ret <16 x half> %ret
53 define <16 x half> @f8(<16 x half> %a, <16 x half> %b) #0 {
54 ; CHECK-LABEL: f8:
55 ; CHECK:       # %bb.0:
56 ; CHECK-NEXT:    vdivph %ymm1, %ymm0, %ymm0
57 ; CHECK-NEXT:    ret{{[l|q]}}
58   %ret = call <16 x half> @llvm.experimental.constrained.fdiv.v16f16(<16 x half> %a, <16 x half> %b,
59                                                                      metadata !"round.dynamic",
60                                                                      metadata !"fpexcept.strict") #0
61   ret <16 x half> %ret
65 define <16 x half> @f10(<16 x half> %a) #0 {
66 ; CHECK-LABEL: f10:
67 ; CHECK:       # %bb.0:
68 ; CHECK-NEXT:    vsqrtph %ymm0, %ymm0
69 ; CHECK-NEXT:    ret{{[l|q]}}
70   %ret = call <16 x half> @llvm.experimental.constrained.sqrt.v16f16(
71                               <16 x half> %a,
72                               metadata !"round.dynamic",
73                               metadata !"fpexcept.strict") #0
74   ret <16 x half > %ret
77 define <4 x double> @f11(<4 x half> %a) #0 {
78 ; CHECK-LABEL: f11:
79 ; CHECK:       # %bb.0:
80 ; CHECK-NEXT:    vcvtph2pd %xmm0, %ymm0
81 ; CHECK-NEXT:    ret{{[l|q]}}
82   %ret = call <4 x double> @llvm.experimental.constrained.fpext.v4f64.v4f16(
83                                 <4 x half> %a,
84                                 metadata !"fpexcept.strict") #0
85   ret <4 x double> %ret
88 define <4 x half> @f12(<4 x double> %a) #0 {
89 ; CHECK-LABEL: f12:
90 ; CHECK:       # %bb.0:
91 ; CHECK-NEXT:    vcvtpd2ph %ymm0, %xmm0
92 ; CHECK-NEXT:    vzeroupper
93 ; CHECK-NEXT:    ret{{[l|q]}}
94   %ret = call <4 x half> @llvm.experimental.constrained.fptrunc.v4f16.v4f64(
95                                 <4 x double> %a,
96                                 metadata !"round.dynamic",
97                                 metadata !"fpexcept.strict") #0
98   ret <4 x half> %ret
101 define <8 x float> @f14(<8 x half> %a) #0 {
102 ; CHECK-LABEL: f14:
103 ; CHECK:       # %bb.0:
104 ; CHECK-NEXT:    vcvtph2psx %xmm0, %ymm0
105 ; CHECK-NEXT:    ret{{[l|q]}}
106   %ret = call <8 x float> @llvm.experimental.constrained.fpext.v8f32.v8f16(
107                                 <8 x half> %a,
108                                 metadata !"fpexcept.strict") #0
109   ret <8 x float> %ret
112 define <8 x half> @f15(<8 x float> %a) #0 {
113 ; CHECK-LABEL: f15:
114 ; CHECK:       # %bb.0:
115 ; CHECK-NEXT:    vcvtps2phx %ymm0, %xmm0
116 ; CHECK-NEXT:    vzeroupper
117 ; CHECK-NEXT:    ret{{[l|q]}}
118   %ret = call <8 x half> @llvm.experimental.constrained.fptrunc.v8f16.v8f32(
119                                 <8 x float> %a,
120                                 metadata !"round.dynamic",
121                                 metadata !"fpexcept.strict") #0
122   ret <8 x half> %ret
125 define <16 x half> @fceilv16f16(<16 x half> %f) #0 {
126 ; CHECK-LABEL: fceilv16f16:
127 ; CHECK:       # %bb.0:
128 ; CHECK-NEXT:    vrndscaleph $10, %ymm0, %ymm0
129 ; CHECK-NEXT:    ret{{[l|q]}}
130   %res = call <16 x half> @llvm.experimental.constrained.ceil.v16f16(
131                           <16 x half> %f, metadata !"fpexcept.strict") #0
132   ret <16 x half> %res
135 define <16 x half> @ffloorv16f16(<16 x half> %f) #0 {
136 ; CHECK-LABEL: ffloorv16f16:
137 ; CHECK:       # %bb.0:
138 ; CHECK-NEXT:    vrndscaleph $9, %ymm0, %ymm0
139 ; CHECK-NEXT:    ret{{[l|q]}}
140   %res = call <16 x half> @llvm.experimental.constrained.floor.v16f16(
141                           <16 x half> %f, metadata !"fpexcept.strict") #0
142   ret <16 x half> %res
146 define <16 x half> @ftruncv16f16(<16 x half> %f) #0 {
147 ; CHECK-LABEL: ftruncv16f16:
148 ; CHECK:       # %bb.0:
149 ; CHECK-NEXT:    vrndscaleph $11, %ymm0, %ymm0
150 ; CHECK-NEXT:    ret{{[l|q]}}
151   %res = call <16 x half> @llvm.experimental.constrained.trunc.v16f16(
152                           <16 x half> %f, metadata !"fpexcept.strict") #0
153   ret <16 x half> %res
156 define <16 x half> @frintv16f16(<16 x half> %f) #0 {
157 ; CHECK-LABEL: frintv16f16:
158 ; CHECK:       # %bb.0:
159 ; CHECK-NEXT:    vrndscaleph $4, %ymm0, %ymm0
160 ; CHECK-NEXT:    ret{{[l|q]}}
161   %res = call <16 x half> @llvm.experimental.constrained.rint.v16f16(
162                           <16 x half> %f,
163                           metadata !"round.dynamic", metadata !"fpexcept.strict") #0
164   ret <16 x half> %res
167 define <16 x half> @fnearbyintv16f16(<16 x half> %f) #0 {
168 ; CHECK-LABEL: fnearbyintv16f16:
169 ; CHECK:       # %bb.0:
170 ; CHECK-NEXT:    vrndscaleph $12, %ymm0, %ymm0
171 ; CHECK-NEXT:    ret{{[l|q]}}
172   %res = call <16 x half> @llvm.experimental.constrained.nearbyint.v16f16(
173                           <16 x half> %f,
174                           metadata !"round.dynamic", metadata !"fpexcept.strict") #0
175   ret <16 x half> %res
178 attributes #0 = { strictfp }