1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse4.1 -O3 | FileCheck %s --check-prefixes=SSE41
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 -O3 | FileCheck %s --check-prefixes=SSE41
4 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx -O3 | FileCheck %s --check-prefixes=AVX
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx -O3 | FileCheck %s --check-prefixes=AVX
6 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512f -O3 | FileCheck %s --check-prefixes=AVX
7 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f -O3 | FileCheck %s --check-prefixes=AVX
9 declare <4 x float> @llvm.experimental.constrained.ceil.v4f32(<4 x float>, metadata)
10 declare <2 x double> @llvm.experimental.constrained.ceil.v2f64(<2 x double>, metadata)
11 declare <4 x float> @llvm.experimental.constrained.floor.v4f32(<4 x float>, metadata)
12 declare <2 x double> @llvm.experimental.constrained.floor.v2f64(<2 x double>, metadata)
13 declare <4 x float> @llvm.experimental.constrained.trunc.v4f32(<4 x float>, metadata)
14 declare <2 x double> @llvm.experimental.constrained.trunc.v2f64(<2 x double>, metadata)
15 declare <4 x float> @llvm.experimental.constrained.rint.v4f32(<4 x float>, metadata, metadata)
16 declare <2 x double> @llvm.experimental.constrained.rint.v2f64(<2 x double>, metadata, metadata)
17 declare <4 x float> @llvm.experimental.constrained.nearbyint.v4f32(<4 x float>, metadata, metadata)
18 declare <2 x double> @llvm.experimental.constrained.nearbyint.v2f64(<2 x double>, metadata, metadata)
20 define <4 x float> @fceilv4f32(<4 x float> %f) #0 {
21 ; SSE41-LABEL: fceilv4f32:
23 ; SSE41-NEXT: roundps $10, %xmm0, %xmm0
24 ; SSE41-NEXT: ret{{[l|q]}}
26 ; AVX-LABEL: fceilv4f32:
28 ; AVX-NEXT: vroundps $10, %xmm0, %xmm0
29 ; AVX-NEXT: ret{{[l|q]}}
30 %res = call <4 x float> @llvm.experimental.constrained.ceil.v4f32(
31 <4 x float> %f, metadata !"fpexcept.strict") #0
35 define <2 x double> @fceilv2f64(<2 x double> %f) #0 {
36 ; SSE41-LABEL: fceilv2f64:
38 ; SSE41-NEXT: roundpd $10, %xmm0, %xmm0
39 ; SSE41-NEXT: ret{{[l|q]}}
41 ; AVX-LABEL: fceilv2f64:
43 ; AVX-NEXT: vroundpd $10, %xmm0, %xmm0
44 ; AVX-NEXT: ret{{[l|q]}}
45 %res = call <2 x double> @llvm.experimental.constrained.ceil.v2f64(
46 <2 x double> %f, metadata !"fpexcept.strict") #0
50 define <4 x float> @ffloorv4f32(<4 x float> %f) #0 {
51 ; SSE41-LABEL: ffloorv4f32:
53 ; SSE41-NEXT: roundps $9, %xmm0, %xmm0
54 ; SSE41-NEXT: ret{{[l|q]}}
56 ; AVX-LABEL: ffloorv4f32:
58 ; AVX-NEXT: vroundps $9, %xmm0, %xmm0
59 ; AVX-NEXT: ret{{[l|q]}}
60 %res = call <4 x float> @llvm.experimental.constrained.floor.v4f32(
61 <4 x float> %f, metadata !"fpexcept.strict") #0
65 define <2 x double> @ffloorv2f64(<2 x double> %f) #0 {
66 ; SSE41-LABEL: ffloorv2f64:
68 ; SSE41-NEXT: roundpd $9, %xmm0, %xmm0
69 ; SSE41-NEXT: ret{{[l|q]}}
71 ; AVX-LABEL: ffloorv2f64:
73 ; AVX-NEXT: vroundpd $9, %xmm0, %xmm0
74 ; AVX-NEXT: ret{{[l|q]}}
75 %res = call <2 x double> @llvm.experimental.constrained.floor.v2f64(
76 <2 x double> %f, metadata !"fpexcept.strict") #0
80 define <4 x float> @ftruncv4f32(<4 x float> %f) #0 {
81 ; SSE41-LABEL: ftruncv4f32:
83 ; SSE41-NEXT: roundps $11, %xmm0, %xmm0
84 ; SSE41-NEXT: ret{{[l|q]}}
86 ; AVX-LABEL: ftruncv4f32:
88 ; AVX-NEXT: vroundps $11, %xmm0, %xmm0
89 ; AVX-NEXT: ret{{[l|q]}}
90 %res = call <4 x float> @llvm.experimental.constrained.trunc.v4f32(
91 <4 x float> %f, metadata !"fpexcept.strict") #0
95 define <2 x double> @ftruncv2f64(<2 x double> %f) #0 {
96 ; SSE41-LABEL: ftruncv2f64:
98 ; SSE41-NEXT: roundpd $11, %xmm0, %xmm0
99 ; SSE41-NEXT: ret{{[l|q]}}
101 ; AVX-LABEL: ftruncv2f64:
103 ; AVX-NEXT: vroundpd $11, %xmm0, %xmm0
104 ; AVX-NEXT: ret{{[l|q]}}
105 %res = call <2 x double> @llvm.experimental.constrained.trunc.v2f64(
106 <2 x double> %f, metadata !"fpexcept.strict") #0
107 ret <2 x double> %res
110 define <4 x float> @frintv4f32(<4 x float> %f) #0 {
111 ; SSE41-LABEL: frintv4f32:
113 ; SSE41-NEXT: roundps $4, %xmm0, %xmm0
114 ; SSE41-NEXT: ret{{[l|q]}}
116 ; AVX-LABEL: frintv4f32:
118 ; AVX-NEXT: vroundps $4, %xmm0, %xmm0
119 ; AVX-NEXT: ret{{[l|q]}}
120 %res = call <4 x float> @llvm.experimental.constrained.rint.v4f32(
122 metadata !"round.dynamic", metadata !"fpexcept.strict") #0
126 define <2 x double> @frintv2f64(<2 x double> %f) #0 {
127 ; SSE41-LABEL: frintv2f64:
129 ; SSE41-NEXT: roundpd $4, %xmm0, %xmm0
130 ; SSE41-NEXT: ret{{[l|q]}}
132 ; AVX-LABEL: frintv2f64:
134 ; AVX-NEXT: vroundpd $4, %xmm0, %xmm0
135 ; AVX-NEXT: ret{{[l|q]}}
136 %res = call <2 x double> @llvm.experimental.constrained.rint.v2f64(
138 metadata !"round.dynamic", metadata !"fpexcept.strict") #0
139 ret <2 x double> %res
142 define <4 x float> @fnearbyintv4f32(<4 x float> %f) #0 {
143 ; SSE41-LABEL: fnearbyintv4f32:
145 ; SSE41-NEXT: roundps $12, %xmm0, %xmm0
146 ; SSE41-NEXT: ret{{[l|q]}}
148 ; AVX-LABEL: fnearbyintv4f32:
150 ; AVX-NEXT: vroundps $12, %xmm0, %xmm0
151 ; AVX-NEXT: ret{{[l|q]}}
152 %res = call <4 x float> @llvm.experimental.constrained.nearbyint.v4f32(
154 metadata !"round.dynamic", metadata !"fpexcept.strict") #0
158 define <2 x double> @fnearbyintv2f64(<2 x double> %f) #0 {
159 ; SSE41-LABEL: fnearbyintv2f64:
161 ; SSE41-NEXT: roundpd $12, %xmm0, %xmm0
162 ; SSE41-NEXT: ret{{[l|q]}}
164 ; AVX-LABEL: fnearbyintv2f64:
166 ; AVX-NEXT: vroundpd $12, %xmm0, %xmm0
167 ; AVX-NEXT: ret{{[l|q]}}
168 %res = call <2 x double> @llvm.experimental.constrained.nearbyint.v2f64(
170 metadata !"round.dynamic", metadata !"fpexcept.strict") #0
171 ret <2 x double> %res
174 attributes #0 = { strictfp }