Skip to content
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

[x86][Windows] Fix chromium build break #101268

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2475,16 +2475,22 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
(Subtarget.isTargetWindowsMSVC() || Subtarget.isTargetWindowsItanium()))
// clang-format off
for (ISD::NodeType Op :
{ISD::FCEIL, ISD::STRICT_FCEIL,
{ISD::FACOS, ISD::STRICT_FACOS,
ISD::FASIN, ISD::STRICT_FASIN,
ISD::FATAN, ISD::STRICT_FATAN,
ISD::FCEIL, ISD::STRICT_FCEIL,
ISD::FCOS, ISD::STRICT_FCOS,
ISD::FCOSH, ISD::STRICT_FCOSH,
ISD::FEXP, ISD::STRICT_FEXP,
ISD::FFLOOR, ISD::STRICT_FFLOOR,
ISD::FREM, ISD::STRICT_FREM,
ISD::FLOG, ISD::STRICT_FLOG,
ISD::FLOG10, ISD::STRICT_FLOG10,
ISD::FPOW, ISD::STRICT_FPOW,
ISD::FSIN, ISD::STRICT_FSIN,
ISD::FTAN, ISD::STRICT_FTAN})
ISD::FSINH, ISD::STRICT_FSINH,
ISD::FTAN, ISD::STRICT_FTAN,
ISD::FTANH, ISD::STRICT_FTANH})
if (isOperationExpand(Op, MVT::f32))
setOperationAction(Op, MVT::f32, Promote);
// clang-format on
Expand Down
67 changes: 42 additions & 25 deletions llvm/test/CodeGen/X86/fp-strict-libcalls-msvc32.ll
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,15 @@ define float @tan(float %x) #0 {
define float @acos(float %x) #0 {
; CHECK-LABEL: acos:
; CHECK: # %bb.0:
; CHECK-NEXT: pushl %eax
; CHECK-NEXT: subl $12, %esp
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
; CHECK-NEXT: fstpl (%esp)
; CHECK-NEXT: wait
; CHECK-NEXT: calll _acos
; CHECK-NEXT: fstps {{[0-9]+}}(%esp)
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
; CHECK-NEXT: fstps (%esp)
; CHECK-NEXT: wait
; CHECK-NEXT: calll _acosf
; CHECK-NEXT: popl %eax
; CHECK-NEXT: addl $12, %esp
; CHECK-NEXT: retl
%result = call float @llvm.experimental.constrained.acos.f32(float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret float %result
Expand All @@ -194,12 +197,15 @@ define float @acos(float %x) #0 {
define float @asin(float %x) #0 {
; CHECK-LABEL: asin:
; CHECK: # %bb.0:
; CHECK-NEXT: pushl %eax
; CHECK-NEXT: subl $12, %esp
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
; CHECK-NEXT: fstpl (%esp)
; CHECK-NEXT: wait
; CHECK-NEXT: calll _asin
; CHECK-NEXT: fstps {{[0-9]+}}(%esp)
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
; CHECK-NEXT: fstps (%esp)
; CHECK-NEXT: wait
; CHECK-NEXT: calll _asinf
; CHECK-NEXT: popl %eax
; CHECK-NEXT: addl $12, %esp
; CHECK-NEXT: retl
%result = call float @llvm.experimental.constrained.asin.f32(float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret float %result
Expand All @@ -208,12 +214,15 @@ define float @asin(float %x) #0 {
define float @atan(float %x) #0 {
; CHECK-LABEL: atan:
; CHECK: # %bb.0:
; CHECK-NEXT: pushl %eax
; CHECK-NEXT: subl $12, %esp
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
; CHECK-NEXT: fstps (%esp)
; CHECK-NEXT: fstpl (%esp)
; CHECK-NEXT: wait
; CHECK-NEXT: calll _atanf
; CHECK-NEXT: popl %eax
; CHECK-NEXT: calll _atan
; CHECK-NEXT: fstps {{[0-9]+}}(%esp)
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
; CHECK-NEXT: wait
; CHECK-NEXT: addl $12, %esp
; CHECK-NEXT: retl
%result = call float @llvm.experimental.constrained.atan.f32(float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret float %result
Expand All @@ -222,12 +231,15 @@ define float @atan(float %x) #0 {
define float @cosh(float %x) #0 {
; CHECK-LABEL: cosh:
; CHECK: # %bb.0:
; CHECK-NEXT: pushl %eax
; CHECK-NEXT: subl $12, %esp
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
; CHECK-NEXT: fstpl (%esp)
; CHECK-NEXT: wait
; CHECK-NEXT: calll _cosh
; CHECK-NEXT: fstps {{[0-9]+}}(%esp)
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
; CHECK-NEXT: fstps (%esp)
; CHECK-NEXT: wait
; CHECK-NEXT: calll _coshf
; CHECK-NEXT: popl %eax
; CHECK-NEXT: addl $12, %esp
; CHECK-NEXT: retl
%result = call float @llvm.experimental.constrained.cosh.f32(float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret float %result
Expand All @@ -236,26 +248,31 @@ define float @cosh(float %x) #0 {
define float @sinh(float %x) #0 {
; CHECK-LABEL: sinh:
; CHECK: # %bb.0:
; CHECK-NEXT: pushl %eax
; CHECK-NEXT: subl $12, %esp
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
; CHECK-NEXT: fstpl (%esp)
; CHECK-NEXT: wait
; CHECK-NEXT: calll _sinh
; CHECK-NEXT: fstps {{[0-9]+}}(%esp)
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
; CHECK-NEXT: fstps (%esp)
; CHECK-NEXT: wait
; CHECK-NEXT: calll _sinhf
; CHECK-NEXT: popl %eax
; CHECK-NEXT: addl $12, %esp
; CHECK-NEXT: retl
%result = call float @llvm.experimental.constrained.sinh.f32(float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret float %result
}

define float @tanh(float %x) #0 {
; CHECK-LABEL: tanh:
; CHECK: # %bb.0:
; CHECK-NEXT: pushl %eax
; CHECK-NEXT: subl $12, %esp
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
; CHECK-NEXT: fstps (%esp)
; CHECK-NEXT: fstpl (%esp)
; CHECK-NEXT: wait
; CHECK-NEXT: calll _tanhf
; CHECK-NEXT: popl %eax
; CHECK-NEXT: calll _tanh
; CHECK-NEXT: fstps {{[0-9]+}}(%esp)
; CHECK-NEXT: flds {{[0-9]+}}(%esp)
; CHECK-NEXT: wait
; CHECK-NEXT: addl $12, %esp
; CHECK-NEXT: retl
%result = call float @llvm.experimental.constrained.tanh.f32(float %x, metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret float %result
Expand Down
Loading