1 ; RUN: llc < %s -mtriple=x86_64-apple-macosx -mattr=+sse4.1 | FileCheck -check-prefix=CHECK-SSE %s
2 ; RUN: llc < %s -mtriple=x86_64-apple-macosx -mattr=+avx | FileCheck -check-prefix=CHECK-AVX %s
4 define float @test1(float %x) nounwind {
5 %call = tail call float @floorf(float %x) nounwind readnone
8 ; CHECK-SSE-LABEL: test1:
9 ; CHECK-SSE: roundss $1
11 ; CHECK-AVX-LABEL: test1:
12 ; CHECK-AVX: vroundss $1
15 declare float @floorf(float) nounwind readnone
17 define double @test2(double %x) nounwind {
18 %call = tail call double @floor(double %x) nounwind readnone
21 ; CHECK-SSE-LABEL: test2:
22 ; CHECK-SSE: roundsd $1
24 ; CHECK-AVX-LABEL: test2:
25 ; CHECK-AVX: vroundsd $1
28 declare double @floor(double) nounwind readnone
30 define float @test3(float %x) nounwind {
31 %call = tail call float @nearbyintf(float %x) nounwind readnone
34 ; CHECK-SSE-LABEL: test3:
35 ; CHECK-SSE: roundss $12
37 ; CHECK-AVX-LABEL: test3:
38 ; CHECK-AVX: vroundss $12
41 declare float @nearbyintf(float) nounwind readnone
43 define double @test4(double %x) nounwind {
44 %call = tail call double @nearbyint(double %x) nounwind readnone
47 ; CHECK-SSE-LABEL: test4:
48 ; CHECK-SSE: roundsd $12
50 ; CHECK-AVX-LABEL: test4:
51 ; CHECK-AVX: vroundsd $12
54 declare double @nearbyint(double) nounwind readnone
56 define float @test5(float %x) nounwind {
57 %call = tail call float @ceilf(float %x) nounwind readnone
60 ; CHECK-SSE-LABEL: test5:
61 ; CHECK-SSE: roundss $2
63 ; CHECK-AVX-LABEL: test5:
64 ; CHECK-AVX: vroundss $2
67 declare float @ceilf(float) nounwind readnone
69 define double @test6(double %x) nounwind {
70 %call = tail call double @ceil(double %x) nounwind readnone
73 ; CHECK-SSE-LABEL: test6:
74 ; CHECK-SSE: roundsd $2
76 ; CHECK-AVX-LABEL: test6:
77 ; CHECK-AVX: vroundsd $2
80 declare double @ceil(double) nounwind readnone
82 define float @test7(float %x) nounwind {
83 %call = tail call float @rintf(float %x) nounwind readnone
86 ; CHECK-SSE-LABEL: test7:
87 ; CHECK-SSE: roundss $4
89 ; CHECK-AVX-LABEL: test7:
90 ; CHECK-AVX: vroundss $4
93 declare float @rintf(float) nounwind readnone
95 define double @test8(double %x) nounwind {
96 %call = tail call double @rint(double %x) nounwind readnone
99 ; CHECK-SSE-LABEL: test8:
100 ; CHECK-SSE: roundsd $4
102 ; CHECK-AVX-LABEL: test8:
103 ; CHECK-AVX: vroundsd $4
106 declare double @rint(double) nounwind readnone
108 define float @test9(float %x) nounwind {
109 %call = tail call float @truncf(float %x) nounwind readnone
112 ; CHECK-SSE-LABEL: test9:
113 ; CHECK-SSE: roundss $3
115 ; CHECK-AVX-LABEL: test9:
116 ; CHECK-AVX: vroundss $3
119 declare float @truncf(float) nounwind readnone
121 define double @test10(double %x) nounwind {
122 %call = tail call double @trunc(double %x) nounwind readnone
125 ; CHECK-SSE-LABEL: test10:
126 ; CHECK-SSE: roundsd $3
128 ; CHECK-AVX-LABEL: test10:
129 ; CHECK-AVX: vroundsd $3
132 declare double @trunc(double) nounwind readnone