• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
8
9declare <4 x float> @llvm.experimental.constrained.ceil.v4f32(<4 x float>, metadata)
10declare <2 x double>  @llvm.experimental.constrained.ceil.v2f64(<2 x double>, metadata)
11declare <4 x float> @llvm.experimental.constrained.floor.v4f32(<4 x float>, metadata)
12declare <2 x double> @llvm.experimental.constrained.floor.v2f64(<2 x double>, metadata)
13declare <4 x float> @llvm.experimental.constrained.trunc.v4f32(<4 x float>, metadata)
14declare <2 x double> @llvm.experimental.constrained.trunc.v2f64(<2 x double>, metadata)
15declare <4 x float> @llvm.experimental.constrained.rint.v4f32(<4 x float>, metadata, metadata)
16declare <2 x double> @llvm.experimental.constrained.rint.v2f64(<2 x double>, metadata, metadata)
17declare <4 x float> @llvm.experimental.constrained.nearbyint.v4f32(<4 x float>, metadata, metadata)
18declare <2 x double> @llvm.experimental.constrained.nearbyint.v2f64(<2 x double>, metadata, metadata)
19
20define <4 x float> @fceilv4f32(<4 x float> %f) #0 {
21; SSE41-LABEL: fceilv4f32:
22; SSE41:       # %bb.0:
23; SSE41-NEXT:    roundps $10, %xmm0, %xmm0
24; SSE41-NEXT:    ret{{[l|q]}}
25;
26; AVX-LABEL: fceilv4f32:
27; AVX:       # %bb.0:
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
32  ret <4 x float> %res
33}
34
35define <2 x double> @fceilv2f64(<2 x double> %f) #0 {
36; SSE41-LABEL: fceilv2f64:
37; SSE41:       # %bb.0:
38; SSE41-NEXT:    roundpd $10, %xmm0, %xmm0
39; SSE41-NEXT:    ret{{[l|q]}}
40;
41; AVX-LABEL: fceilv2f64:
42; AVX:       # %bb.0:
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
47  ret <2 x double> %res
48}
49
50define <4 x float> @ffloorv4f32(<4 x float> %f) #0 {
51; SSE41-LABEL: ffloorv4f32:
52; SSE41:       # %bb.0:
53; SSE41-NEXT:    roundps $9, %xmm0, %xmm0
54; SSE41-NEXT:    ret{{[l|q]}}
55;
56; AVX-LABEL: ffloorv4f32:
57; AVX:       # %bb.0:
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
62  ret <4 x float> %res
63}
64
65define <2 x double> @ffloorv2f64(<2 x double> %f) #0 {
66; SSE41-LABEL: ffloorv2f64:
67; SSE41:       # %bb.0:
68; SSE41-NEXT:    roundpd $9, %xmm0, %xmm0
69; SSE41-NEXT:    ret{{[l|q]}}
70;
71; AVX-LABEL: ffloorv2f64:
72; AVX:       # %bb.0:
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
77  ret <2 x double> %res
78}
79
80define <4 x float> @ftruncv4f32(<4 x float> %f) #0 {
81; SSE41-LABEL: ftruncv4f32:
82; SSE41:       # %bb.0:
83; SSE41-NEXT:    roundps $11, %xmm0, %xmm0
84; SSE41-NEXT:    ret{{[l|q]}}
85;
86; AVX-LABEL: ftruncv4f32:
87; AVX:       # %bb.0:
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
92  ret <4 x float> %res
93}
94
95define <2 x double> @ftruncv2f64(<2 x double> %f) #0 {
96; SSE41-LABEL: ftruncv2f64:
97; SSE41:       # %bb.0:
98; SSE41-NEXT:    roundpd $11, %xmm0, %xmm0
99; SSE41-NEXT:    ret{{[l|q]}}
100;
101; AVX-LABEL: ftruncv2f64:
102; AVX:       # %bb.0:
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
108}
109
110define <4 x float> @frintv4f32(<4 x float> %f) #0 {
111; SSE41-LABEL: frintv4f32:
112; SSE41:       # %bb.0:
113; SSE41-NEXT:    roundps $4, %xmm0, %xmm0
114; SSE41-NEXT:    ret{{[l|q]}}
115;
116; AVX-LABEL: frintv4f32:
117; AVX:       # %bb.0:
118; AVX-NEXT:    vroundps $4, %xmm0, %xmm0
119; AVX-NEXT:    ret{{[l|q]}}
120  %res = call <4 x float> @llvm.experimental.constrained.rint.v4f32(
121                          <4 x float> %f,
122                          metadata !"round.dynamic", metadata !"fpexcept.strict") #0
123  ret <4 x float> %res
124}
125
126define <2 x double> @frintv2f64(<2 x double> %f) #0 {
127; SSE41-LABEL: frintv2f64:
128; SSE41:       # %bb.0:
129; SSE41-NEXT:    roundpd $4, %xmm0, %xmm0
130; SSE41-NEXT:    ret{{[l|q]}}
131;
132; AVX-LABEL: frintv2f64:
133; AVX:       # %bb.0:
134; AVX-NEXT:    vroundpd $4, %xmm0, %xmm0
135; AVX-NEXT:    ret{{[l|q]}}
136  %res = call <2 x double> @llvm.experimental.constrained.rint.v2f64(
137                        <2 x double> %f,
138                        metadata !"round.dynamic", metadata !"fpexcept.strict") #0
139  ret <2 x double> %res
140}
141
142define <4 x float> @fnearbyintv4f32(<4 x float> %f) #0 {
143; SSE41-LABEL: fnearbyintv4f32:
144; SSE41:       # %bb.0:
145; SSE41-NEXT:    roundps $12, %xmm0, %xmm0
146; SSE41-NEXT:    ret{{[l|q]}}
147;
148; AVX-LABEL: fnearbyintv4f32:
149; AVX:       # %bb.0:
150; AVX-NEXT:    vroundps $12, %xmm0, %xmm0
151; AVX-NEXT:    ret{{[l|q]}}
152  %res = call <4 x float> @llvm.experimental.constrained.nearbyint.v4f32(
153                          <4 x float> %f,
154                          metadata !"round.dynamic", metadata !"fpexcept.strict") #0
155  ret <4 x float> %res
156}
157
158define <2 x double> @fnearbyintv2f64(<2 x double> %f) #0 {
159; SSE41-LABEL: fnearbyintv2f64:
160; SSE41:       # %bb.0:
161; SSE41-NEXT:    roundpd $12, %xmm0, %xmm0
162; SSE41-NEXT:    ret{{[l|q]}}
163;
164; AVX-LABEL: fnearbyintv2f64:
165; AVX:       # %bb.0:
166; AVX-NEXT:    vroundpd $12, %xmm0, %xmm0
167; AVX-NEXT:    ret{{[l|q]}}
168  %res = call <2 x double> @llvm.experimental.constrained.nearbyint.v2f64(
169                        <2 x double> %f,
170                        metadata !"round.dynamic", metadata !"fpexcept.strict") #0
171  ret <2 x double> %res
172}
173
174attributes #0 = { strictfp }
175