[llvm] [X86] Consistently use f128 libcalls (PR #142386)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 3 01:28:38 PDT 2025
https://github.com/nikic updated https://github.com/llvm/llvm-project/pull/142386
>From 79064dbd6e00a8fa22551b78310c52b0df86388b Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov at redhat.com>
Date: Mon, 2 Jun 2025 14:49:26 +0200
Subject: [PATCH 1/2] [X86] Consistently use f128 libcalls
On x86, the `*l` libcalls are for 80-bit extended precision.
`fp128` needs to use the `*f128` libcalls instead.
Add a few missing ones, esp. for FP min/max.
Also use the `f128` libcalls on x86-32.
---
llvm/lib/IR/RuntimeLibcalls.cpp | 9 ++-
.../CodeGen/X86/fminimum-fmaximum-i686.ll | 8 +--
.../test/CodeGen/X86/fp128-libcalls-strict.ll | 64 +++++++++----------
llvm/test/CodeGen/X86/fp128-libcalls.ll | 44 ++++++-------
4 files changed, 65 insertions(+), 60 deletions(-)
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index 90c3bf0db0236..324636531b8fa 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -25,8 +25,8 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
for (int LC = 0; LC < RTLIB::UNKNOWN_LIBCALL; ++LC)
setLibcallCallingConv((RTLIB::Libcall)LC, CallingConv::C);
- // Use the f128 variants of math functions on x86_64
- if (TT.getArch() == Triple::ArchType::x86_64 && TT.isGNUEnvironment()) {
+ // Use the f128 variants of math functions on x86
+ if (TT.isX86() && TT.isGNUEnvironment()) {
setLibcallName(RTLIB::REM_F128, "fmodf128");
setLibcallName(RTLIB::FMA_F128, "fmaf128");
setLibcallName(RTLIB::SQRT_F128, "sqrtf128");
@@ -65,12 +65,17 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
setLibcallName(RTLIB::COPYSIGN_F128, "copysignf128");
setLibcallName(RTLIB::FMIN_F128, "fminf128");
setLibcallName(RTLIB::FMAX_F128, "fmaxf128");
+ setLibcallName(RTLIB::FMINIMUM_F128, "fminimumf128");
+ setLibcallName(RTLIB::FMAXIMUM_F128, "fmaximumf128");
+ setLibcallName(RTLIB::FMINIMUMNUM_F128, "fminimum_numf128");
+ setLibcallName(RTLIB::FMAXIMUMNUM_F128, "fmaximum_numf128");
setLibcallName(RTLIB::LROUND_F128, "lroundf128");
setLibcallName(RTLIB::LLROUND_F128, "llroundf128");
setLibcallName(RTLIB::LRINT_F128, "lrintf128");
setLibcallName(RTLIB::LLRINT_F128, "llrintf128");
setLibcallName(RTLIB::LDEXP_F128, "ldexpf128");
setLibcallName(RTLIB::FREXP_F128, "frexpf128");
+ setLibcallName(RTLIB::MODF_F128, "modff128");
}
// For IEEE quad-precision libcall names, PPC uses "kf" instead of "tf".
diff --git a/llvm/test/CodeGen/X86/fminimum-fmaximum-i686.ll b/llvm/test/CodeGen/X86/fminimum-fmaximum-i686.ll
index 4f930d84c9595..d3f85ce51edea 100644
--- a/llvm/test/CodeGen/X86/fminimum-fmaximum-i686.ll
+++ b/llvm/test/CodeGen/X86/fminimum-fmaximum-i686.ll
@@ -239,7 +239,7 @@ define fp128 @maximum_fp128(fp128 %x, fp128 %y) nounwind {
; CHECK-NEXT: pushl {{[0-9]+}}(%esp)
; CHECK-NEXT: pushl {{[0-9]+}}(%esp)
; CHECK-NEXT: pushl %eax
-; CHECK-NEXT: calll fmaximuml
+; CHECK-NEXT: calll fmaximumf128
; CHECK-NEXT: addl $44, %esp
; CHECK-NEXT: movl (%esp), %eax
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
@@ -496,7 +496,7 @@ define fp128 @minimum_fp128(fp128 %x, fp128 %y) nounwind {
; CHECK-NEXT: pushl {{[0-9]+}}(%esp)
; CHECK-NEXT: pushl {{[0-9]+}}(%esp)
; CHECK-NEXT: pushl %eax
-; CHECK-NEXT: calll fminimuml
+; CHECK-NEXT: calll fminimumf128
; CHECK-NEXT: addl $44, %esp
; CHECK-NEXT: movl (%esp), %eax
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
@@ -533,7 +533,7 @@ define fp128 @maximumnum_fp128(fp128 %x, fp128 %y) nounwind {
; CHECK-NEXT: pushl {{[0-9]+}}(%esp)
; CHECK-NEXT: pushl {{[0-9]+}}(%esp)
; CHECK-NEXT: pushl %eax
-; CHECK-NEXT: calll fmaximum_numl
+; CHECK-NEXT: calll fmaximum_numf128
; CHECK-NEXT: addl $44, %esp
; CHECK-NEXT: movl (%esp), %eax
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
@@ -570,7 +570,7 @@ define fp128 @minimumnum_fp128(fp128 %x, fp128 %y) nounwind {
; CHECK-NEXT: pushl {{[0-9]+}}(%esp)
; CHECK-NEXT: pushl {{[0-9]+}}(%esp)
; CHECK-NEXT: pushl %eax
-; CHECK-NEXT: calll fminimum_numl
+; CHECK-NEXT: calll fminimum_numf128
; CHECK-NEXT: addl $44, %esp
; CHECK-NEXT: movl (%esp), %eax
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
diff --git a/llvm/test/CodeGen/X86/fp128-libcalls-strict.ll b/llvm/test/CodeGen/X86/fp128-libcalls-strict.ll
index a85b53ea62ac7..3ac4415d075c9 100644
--- a/llvm/test/CodeGen/X86/fp128-libcalls-strict.ll
+++ b/llvm/test/CodeGen/X86/fp128-libcalls-strict.ll
@@ -452,7 +452,7 @@ define fp128 @fma(fp128 %x, fp128 %y, fp128 %z) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll fmal
+; X86-NEXT: calll fmaf128
; X86-NEXT: addl $60, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -552,7 +552,7 @@ define fp128 @frem(fp128 %x, fp128 %y) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll fmodl
+; X86-NEXT: calll fmodf128
; X86-NEXT: addl $44, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -641,7 +641,7 @@ define fp128 @ceil(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll ceill
+; X86-NEXT: calll ceilf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -723,7 +723,7 @@ define fp128 @acos(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll acosl
+; X86-NEXT: calll acosf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -805,7 +805,7 @@ define fp128 @cos(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll cosl
+; X86-NEXT: calll cosf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -887,7 +887,7 @@ define fp128 @cosh(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll coshl
+; X86-NEXT: calll coshf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -969,7 +969,7 @@ define fp128 @exp(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll expl
+; X86-NEXT: calll expf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -1051,7 +1051,7 @@ define fp128 @exp2(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll exp2l
+; X86-NEXT: calll exp2f128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -1133,7 +1133,7 @@ define fp128 @floor(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll floorl
+; X86-NEXT: calll floorf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -1215,7 +1215,7 @@ define fp128 @log(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll logl
+; X86-NEXT: calll logf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -1297,7 +1297,7 @@ define fp128 @log10(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll log10l
+; X86-NEXT: calll log10f128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -1379,7 +1379,7 @@ define fp128 @log2(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll log2l
+; X86-NEXT: calll log2f128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -1465,7 +1465,7 @@ define fp128 @maxnum(fp128 %x, fp128 %y) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll fmaxl
+; X86-NEXT: calll fmaxf128
; X86-NEXT: addl $44, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -1558,7 +1558,7 @@ define fp128 @minnum(fp128 %x, fp128 %y) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll fminl
+; X86-NEXT: calll fminf128
; X86-NEXT: addl $44, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -1647,7 +1647,7 @@ define fp128 @nearbyint(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll nearbyintl
+; X86-NEXT: calll nearbyintf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -1733,7 +1733,7 @@ define fp128 @pow(fp128 %x, fp128 %y) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll powl
+; X86-NEXT: calll powf128
; X86-NEXT: addl $44, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -1913,7 +1913,7 @@ define fp128 @rint(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll rintl
+; X86-NEXT: calll rintf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -1995,7 +1995,7 @@ define fp128 @round(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll roundl
+; X86-NEXT: calll roundf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2077,7 +2077,7 @@ define fp128 @roundeven(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll roundevenl
+; X86-NEXT: calll roundevenf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2159,7 +2159,7 @@ define fp128 @asin(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll asinl
+; X86-NEXT: calll asinf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2241,7 +2241,7 @@ define fp128 @sin(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll sinl
+; X86-NEXT: calll sinf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2323,7 +2323,7 @@ define fp128 @sinh(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll sinhl
+; X86-NEXT: calll sinhf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2405,7 +2405,7 @@ define fp128 @sqrt(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll sqrtl
+; X86-NEXT: calll sqrtf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2487,7 +2487,7 @@ define fp128 @atan(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll atanl
+; X86-NEXT: calll atanf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2573,7 +2573,7 @@ define fp128 @atan2(fp128 %x, fp128 %y) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll atan2l
+; X86-NEXT: calll atan2f128
; X86-NEXT: addl $44, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2662,7 +2662,7 @@ define fp128 @tan(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll tanl
+; X86-NEXT: calll tanf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2744,7 +2744,7 @@ define fp128 @tanh(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll tanhl
+; X86-NEXT: calll tanhf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2826,7 +2826,7 @@ define fp128 @trunc(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll truncl
+; X86-NEXT: calll truncf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2903,7 +2903,7 @@ define i32 @lrint(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
-; X86-NEXT: calll lrintl
+; X86-NEXT: calll lrintf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: retl
;
@@ -2953,7 +2953,7 @@ define i64 @llrint(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
-; X86-NEXT: calll llrintl
+; X86-NEXT: calll llrintf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: retl
;
@@ -3003,7 +3003,7 @@ define i32 @lround(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
-; X86-NEXT: calll lroundl
+; X86-NEXT: calll lroundf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: retl
;
@@ -3053,7 +3053,7 @@ define i64 @llround(fp128 %x) nounwind strictfp {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
-; X86-NEXT: calll llroundl
+; X86-NEXT: calll llroundf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: retl
;
diff --git a/llvm/test/CodeGen/X86/fp128-libcalls.ll b/llvm/test/CodeGen/X86/fp128-libcalls.ll
index 4c716ace79a30..f727a79078627 100644
--- a/llvm/test/CodeGen/X86/fp128-libcalls.ll
+++ b/llvm/test/CodeGen/X86/fp128-libcalls.ll
@@ -841,7 +841,7 @@ define dso_local void @Test128Rem(fp128 %d1, fp128 %d2) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll fmodl
+; X86-NEXT: calll fmodf128
; X86-NEXT: addl $44, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
@@ -933,7 +933,7 @@ define dso_local void @Test128_1Rem(fp128 %d1) nounwind {
; X86-NEXT: pushl vf128+4
; X86-NEXT: pushl vf128
; X86-NEXT: pushl %eax
-; X86-NEXT: calll fmodl
+; X86-NEXT: calll fmodf128
; X86-NEXT: addl $44, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
@@ -1018,7 +1018,7 @@ define dso_local void @Test128Sqrt(fp128 %d1) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll sqrtl
+; X86-NEXT: calll sqrtf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
@@ -1096,7 +1096,7 @@ define dso_local void @Test128Sin(fp128 %d1) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll sinl
+; X86-NEXT: calll sinf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
@@ -1174,7 +1174,7 @@ define dso_local void @Test128Cos(fp128 %d1) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll cosl
+; X86-NEXT: calll cosf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
@@ -1252,7 +1252,7 @@ define dso_local void @Test128Ceil(fp128 %d1) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll ceill
+; X86-NEXT: calll ceilf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
@@ -1330,7 +1330,7 @@ define dso_local void @Test128Floor(fp128 %d1) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll floorl
+; X86-NEXT: calll floorf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
@@ -1408,7 +1408,7 @@ define dso_local void @Test128Trunc(fp128 %d1) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll truncl
+; X86-NEXT: calll truncf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
@@ -1486,7 +1486,7 @@ define dso_local void @Test128Nearbyint(fp128 %d1) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll nearbyintl
+; X86-NEXT: calll nearbyintf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
@@ -1564,7 +1564,7 @@ define dso_local void @Test128Rint(fp128 %d1) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll rintl
+; X86-NEXT: calll rintf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
@@ -1642,7 +1642,7 @@ define dso_local void @Test128Round(fp128 %d1) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll roundl
+; X86-NEXT: calll roundf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, vf128
@@ -1723,7 +1723,7 @@ define fp128 @Test128FMA(fp128 %a, fp128 %b, fp128 %c) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll fmal
+; X86-NEXT: calll fmaf128
; X86-NEXT: addl $60, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -1814,7 +1814,7 @@ define fp128 @Test128Acos(fp128 %a) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll acosl
+; X86-NEXT: calll acosf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -1889,7 +1889,7 @@ define fp128 @Test128Asin(fp128 %a) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll asinl
+; X86-NEXT: calll asinf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -1964,7 +1964,7 @@ define fp128 @Test128Atan(fp128 %a) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll atanl
+; X86-NEXT: calll atanf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2043,7 +2043,7 @@ define fp128 @Test128Atan2(fp128 %a, fp128 %b) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll atan2l
+; X86-NEXT: calll atan2f128
; X86-NEXT: addl $44, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2125,7 +2125,7 @@ define fp128 @Test128Cosh(fp128 %a) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll coshl
+; X86-NEXT: calll coshf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2200,7 +2200,7 @@ define fp128 @Test128Sinh(fp128 %a) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll sinhl
+; X86-NEXT: calll sinhf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2275,7 +2275,7 @@ define fp128 @Test128Tan(fp128 %a) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll tanl
+; X86-NEXT: calll tanf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2350,7 +2350,7 @@ define fp128 @Test128Tanh(fp128 %a) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %eax
-; X86-NEXT: calll tanhl
+; X86-NEXT: calll tanhf128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps %xmm0, (%esi)
@@ -2418,7 +2418,7 @@ define { fp128, fp128 } @Test128Modf(fp128 %a) nounwind {
; GNU: # %bb.0:
; GNU-NEXT: subq $24, %rsp
; GNU-NEXT: movq %rsp, %rdi
-; GNU-NEXT: callq modfl at PLT
+; GNU-NEXT: callq modff128 at PLT
; GNU-NEXT: movaps (%rsp), %xmm1
; GNU-NEXT: addq $24, %rsp
; GNU-NEXT: retq
@@ -2437,7 +2437,7 @@ define { fp128, fp128 } @Test128Modf(fp128 %a) nounwind {
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl {{[0-9]+}}(%esp)
; X86-NEXT: pushl %ecx
-; X86-NEXT: calll modfl
+; X86-NEXT: calll modff128
; X86-NEXT: addl $28, %esp
; X86-NEXT: movaps (%esp), %xmm0
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm1
>From fcf097072610d033b2061691491d49ccc882f86d Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov at redhat.com>
Date: Tue, 3 Jun 2025 10:28:17 +0200
Subject: [PATCH 2/2] Add release note
---
llvm/docs/ReleaseNotes.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/llvm/docs/ReleaseNotes.md b/llvm/docs/ReleaseNotes.md
index 10efc889fcc7f..756cd13467926 100644
--- a/llvm/docs/ReleaseNotes.md
+++ b/llvm/docs/ReleaseNotes.md
@@ -215,6 +215,8 @@ Changes to the Windows Target
Changes to the X86 Backend
--------------------------
+* `fp128` will now use `*f128` libcalls on 32-bit GNU targets as well.
+
Changes to the OCaml bindings
-----------------------------
More information about the llvm-commits
mailing list