Skip to content

Commit dea213c

Browse files
authored
Add atan2 test case for prior change in X86SelLowering.cpp (#112616)
When updating X86SelLowering.cpp for atan2, based on #96222, it was known that a needed change was missing which was merged later in #101268. However, the corresponding test update to `fp-strict-libcalls-msvc32.ll` was missed. This change rectifies that oversight. This also adds a missing label to the tanh test, since it's produced by update_llc_test_checks.py Part of: Implement the atan2 HLSL Function #70096.
1 parent f35a14d commit dea213c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

llvm/test/CodeGen/X86/fp-strict-libcalls-msvc32.ll

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,26 @@ define float @atan(float %x) #0 {
228228
ret float %result
229229
}
230230

231+
define float @atan2(float %x, float %y) #0 {
232+
; CHECK-LABEL: atan2:
233+
; CHECK: # %bb.0:
234+
; CHECK-NEXT: subl $20, %esp
235+
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
236+
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
237+
; CHECK-NEXT: fxch %st(1)
238+
; CHECK-NEXT: fstpl {{[0-9]+}}(%esp)
239+
; CHECK-NEXT: fstpl (%esp)
240+
; CHECK-NEXT: wait
241+
; CHECK-NEXT: calll _atan2
242+
; CHECK-NEXT: fstps {{[0-9]+}}(%esp)
243+
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
244+
; CHECK-NEXT: wait
245+
; CHECK-NEXT: addl $20, %esp
246+
; CHECK-NEXT: retl
247+
%result = call float @llvm.experimental.constrained.atan2.f32(float %x, float %y, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
248+
ret float %result
249+
}
250+
231251
define float @cosh(float %x) #0 {
232252
; CHECK-LABEL: cosh:
233253
; CHECK: # %bb.0:
@@ -263,6 +283,7 @@ define float @sinh(float %x) #0 {
263283
}
264284

265285
define float @tanh(float %x) #0 {
286+
; CHECK-LABEL: tanh:
266287
; CHECK: # %bb.0:
267288
; CHECK-NEXT: subl $12, %esp
268289
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
@@ -293,6 +314,7 @@ declare float @llvm.experimental.constrained.tan.f32(float, metadata, metadata)
293314
declare float @llvm.experimental.constrained.acos.f32(float, metadata, metadata)
294315
declare float @llvm.experimental.constrained.asin.f32(float, metadata, metadata)
295316
declare float @llvm.experimental.constrained.atan.f32(float, metadata, metadata)
317+
declare float @llvm.experimental.constrained.atan2.f32(float, float, metadata, metadata)
296318
declare float @llvm.experimental.constrained.cosh.f32(float, metadata, metadata)
297319
declare float @llvm.experimental.constrained.sinh.f32(float, metadata, metadata)
298320
declare float @llvm.experimental.constrained.tanh.f32(float, metadata, metadata)

0 commit comments

Comments
 (0)