• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -O3 -mtriple=i686-pc-windows-msvc -mattr=+cmov < %s | FileCheck %s
3
4define float @ceil(float %x) #0 {
5; CHECK-LABEL: ceil:
6; CHECK:       # %bb.0:
7; CHECK-NEXT:    subl $12, %esp
8; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
9; CHECK-NEXT:    fstpl (%esp)
10; CHECK-NEXT:    wait
11; CHECK-NEXT:    calll _ceil
12; CHECK-NEXT:    fstps {{[0-9]+}}(%esp)
13; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
14; CHECK-NEXT:    wait
15; CHECK-NEXT:    addl $12, %esp
16; CHECK-NEXT:    retl
17  %result = call float @llvm.experimental.constrained.ceil.f32(float %x, metadata !"fpexcept.strict") #0
18  ret float %result
19}
20
21define float @cos(float %x) #0 {
22; CHECK-LABEL: cos:
23; CHECK:       # %bb.0:
24; CHECK-NEXT:    subl $12, %esp
25; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
26; CHECK-NEXT:    fstpl (%esp)
27; CHECK-NEXT:    wait
28; CHECK-NEXT:    calll _cos
29; CHECK-NEXT:    fstps {{[0-9]+}}(%esp)
30; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
31; CHECK-NEXT:    wait
32; CHECK-NEXT:    addl $12, %esp
33; CHECK-NEXT:    retl
34  %result = call float @llvm.experimental.constrained.cos.f32(float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
35  ret float %result
36}
37
38define float @exp(float %x) #0 {
39; CHECK-LABEL: exp:
40; CHECK:       # %bb.0:
41; CHECK-NEXT:    subl $12, %esp
42; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
43; CHECK-NEXT:    fstpl (%esp)
44; CHECK-NEXT:    wait
45; CHECK-NEXT:    calll _exp
46; CHECK-NEXT:    fstps {{[0-9]+}}(%esp)
47; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
48; CHECK-NEXT:    wait
49; CHECK-NEXT:    addl $12, %esp
50; CHECK-NEXT:    retl
51  %result = call float @llvm.experimental.constrained.exp.f32(float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
52  ret float %result
53}
54
55define float @floor(float %x) #0 {
56; CHECK-LABEL: floor:
57; CHECK:       # %bb.0:
58; CHECK-NEXT:    subl $12, %esp
59; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
60; CHECK-NEXT:    fstpl (%esp)
61; CHECK-NEXT:    wait
62; CHECK-NEXT:    calll _floor
63; CHECK-NEXT:    fstps {{[0-9]+}}(%esp)
64; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
65; CHECK-NEXT:    wait
66; CHECK-NEXT:    addl $12, %esp
67; CHECK-NEXT:    retl
68  %result = call float @llvm.experimental.constrained.floor.f32(float %x, metadata !"fpexcept.strict") #0
69  ret float %result
70}
71
72define float @frem(float %x, float %y) #0 {
73; CHECK-LABEL: frem:
74; CHECK:       # %bb.0:
75; CHECK-NEXT:    subl $20, %esp
76; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
77; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
78; CHECK-NEXT:    fxch %st(1)
79; CHECK-NEXT:    fstpl {{[0-9]+}}(%esp)
80; CHECK-NEXT:    fstpl (%esp)
81; CHECK-NEXT:    wait
82; CHECK-NEXT:    calll _fmod
83; CHECK-NEXT:    fstps {{[0-9]+}}(%esp)
84; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
85; CHECK-NEXT:    wait
86; CHECK-NEXT:    addl $20, %esp
87; CHECK-NEXT:    retl
88  %result = call float @llvm.experimental.constrained.frem.f32(float %x, float %y, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
89  ret float %result
90}
91
92define float @log(float %x) #0 {
93; CHECK-LABEL: log:
94; CHECK:       # %bb.0:
95; CHECK-NEXT:    subl $12, %esp
96; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
97; CHECK-NEXT:    fstpl (%esp)
98; CHECK-NEXT:    wait
99; CHECK-NEXT:    calll _log
100; CHECK-NEXT:    fstps {{[0-9]+}}(%esp)
101; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
102; CHECK-NEXT:    wait
103; CHECK-NEXT:    addl $12, %esp
104; CHECK-NEXT:    retl
105  %result = call float @llvm.experimental.constrained.log.f32(float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
106  ret float %result
107}
108
109define float @log10(float %x) #0 {
110; CHECK-LABEL: log10:
111; CHECK:       # %bb.0:
112; CHECK-NEXT:    subl $12, %esp
113; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
114; CHECK-NEXT:    fstpl (%esp)
115; CHECK-NEXT:    wait
116; CHECK-NEXT:    calll _log10
117; CHECK-NEXT:    fstps {{[0-9]+}}(%esp)
118; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
119; CHECK-NEXT:    wait
120; CHECK-NEXT:    addl $12, %esp
121; CHECK-NEXT:    retl
122  %result = call float @llvm.experimental.constrained.log10.f32(float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
123  ret float %result
124}
125
126define float @pow(float %x, float %y) #0 {
127; CHECK-LABEL: pow:
128; CHECK:       # %bb.0:
129; CHECK-NEXT:    subl $20, %esp
130; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
131; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
132; CHECK-NEXT:    fxch %st(1)
133; CHECK-NEXT:    fstpl {{[0-9]+}}(%esp)
134; CHECK-NEXT:    fstpl (%esp)
135; CHECK-NEXT:    wait
136; CHECK-NEXT:    calll _pow
137; CHECK-NEXT:    fstps {{[0-9]+}}(%esp)
138; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
139; CHECK-NEXT:    wait
140; CHECK-NEXT:    addl $20, %esp
141; CHECK-NEXT:    retl
142  %result = call float @llvm.experimental.constrained.pow.f32(float %x, float %y, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
143  ret float %result
144}
145
146define float @sin(float %x) #0 {
147; CHECK-LABEL: sin:
148; CHECK:       # %bb.0:
149; CHECK-NEXT:    subl $12, %esp
150; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
151; CHECK-NEXT:    fstpl (%esp)
152; CHECK-NEXT:    wait
153; CHECK-NEXT:    calll _sin
154; CHECK-NEXT:    fstps {{[0-9]+}}(%esp)
155; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
156; CHECK-NEXT:    wait
157; CHECK-NEXT:    addl $12, %esp
158; CHECK-NEXT:    retl
159  %result = call float @llvm.experimental.constrained.sin.f32(float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
160  ret float %result
161}
162
163attributes #0 = { strictfp }
164
165declare float @llvm.experimental.constrained.ceil.f32(float, metadata)
166declare float @llvm.experimental.constrained.cos.f32(float, metadata, metadata)
167declare float @llvm.experimental.constrained.exp.f32(float, metadata, metadata)
168declare float @llvm.experimental.constrained.floor.f32(float, metadata)
169declare float @llvm.experimental.constrained.frem.f32(float, float, metadata, metadata)
170declare float @llvm.experimental.constrained.log.f32(float, metadata, metadata)
171declare float @llvm.experimental.constrained.log10.f32(float, metadata, metadata)
172declare float @llvm.experimental.constrained.pow.f32(float, float, metadata, metadata)
173declare float @llvm.experimental.constrained.sin.f32(float, metadata, metadata)
174