Skip to content

Add atan2 test case for prior change in X86SelLowering.cpp #112616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

tex3d
Copy link
Contributor

@tex3d tex3d commented Oct 16, 2024

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.

When updating X86SelLowering.cpp based on llvm#96222, it was known that a needed change was missing which was merged later in llvm#101268.  However, the corresponding test update to `fp-strict-libcalls-msvc32.ll` was missed.

This change rectifies that oversight.

Part of: Part of: Implement the atan2 HLSL Function llvm#70096.
@tex3d tex3d requested a review from farzonl October 16, 2024 21:04
@tex3d tex3d changed the title Add test case for prior change in X86SelLowering.cpp Add atan2 test case for prior change in X86SelLowering.cpp Oct 16, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 16, 2024

@llvm/pr-subscribers-backend-x86

Author: Tex Riddell (tex3d)

Changes

When updating X86SelLowering.cpp 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: Part of: Implement the atan2 HLSL Function #70096.


Full diff: https://github.com/llvm/llvm-project/pull/112616.diff

1 Files Affected:

  • (modified) llvm/test/CodeGen/X86/fp-strict-libcalls-msvc32.ll (+22)
diff --git a/llvm/test/CodeGen/X86/fp-strict-libcalls-msvc32.ll b/llvm/test/CodeGen/X86/fp-strict-libcalls-msvc32.ll
index 5d4e86afc8aceb..74291fbb75e81a 100644
--- a/llvm/test/CodeGen/X86/fp-strict-libcalls-msvc32.ll
+++ b/llvm/test/CodeGen/X86/fp-strict-libcalls-msvc32.ll
@@ -228,6 +228,26 @@ define float @atan(float %x) #0 {
   ret float %result
 }
 
+define float @atan2(float %x, float %y) #0 {
+; CHECK-LABEL: atan2:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    subl $20, %esp
+; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
+; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
+; CHECK-NEXT:    fxch %st(1)
+; CHECK-NEXT:    fstpl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    fstpl (%esp)
+; CHECK-NEXT:    wait
+; CHECK-NEXT:    calll _atan2
+; CHECK-NEXT:    fstps {{[0-9]+}}(%esp)
+; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
+; CHECK-NEXT:    wait
+; CHECK-NEXT:    addl $20, %esp
+; CHECK-NEXT:    retl
+  %result = call float @llvm.experimental.constrained.atan2.f32(float %x, float %y, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
+  ret float %result
+}
+
 define float @cosh(float %x) #0 {
 ; CHECK-LABEL: cosh:
 ; CHECK:       # %bb.0:
@@ -263,6 +283,7 @@ define float @sinh(float %x) #0 {
 }
 
 define float @tanh(float %x) #0 {
+; CHECK-LABEL: tanh:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    subl $12, %esp
 ; CHECK-NEXT:    flds {{[0-9]+}}(%esp)
@@ -293,6 +314,7 @@ declare float @llvm.experimental.constrained.tan.f32(float, metadata, metadata)
 declare float @llvm.experimental.constrained.acos.f32(float, metadata, metadata)
 declare float @llvm.experimental.constrained.asin.f32(float, metadata, metadata)
 declare float @llvm.experimental.constrained.atan.f32(float, metadata, metadata)
+declare float @llvm.experimental.constrained.atan2.f32(float, float, metadata, metadata)
 declare float @llvm.experimental.constrained.cosh.f32(float, metadata, metadata)
 declare float @llvm.experimental.constrained.sinh.f32(float, metadata, metadata)
 declare float @llvm.experimental.constrained.tanh.f32(float, metadata, metadata)

@tex3d tex3d merged commit dea213c into llvm:main Oct 17, 2024
10 checks passed
@tex3d tex3d deleted the atan2-strict-libcalls-msvc32 branch October 17, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants