[llvm] c8c271a - [X86] Add additional fp min/max libcall tests (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 2 05:54:58 PDT 2025


Author: Nikita Popov
Date: 2025-06-02T14:54:49+02:00
New Revision: c8c271a56ee15a057801811ae4420ef1672eef79

URL: https://github.com/llvm/llvm-project/commit/c8c271a56ee15a057801811ae4420ef1672eef79
DIFF: https://github.com/llvm/llvm-project/commit/c8c271a56ee15a057801811ae4420ef1672eef79.diff

LOG: [X86] Add additional fp min/max libcall tests (NFC)

Added: 
    

Modified: 
    llvm/test/CodeGen/X86/fminimum-fmaximum-i686.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/X86/fminimum-fmaximum-i686.ll b/llvm/test/CodeGen/X86/fminimum-fmaximum-i686.ll
index dea455a692420..4f930d84c9595 100644
--- a/llvm/test/CodeGen/X86/fminimum-fmaximum-i686.ll
+++ b/llvm/test/CodeGen/X86/fminimum-fmaximum-i686.ll
@@ -1,11 +1,11 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
-; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s
+; RUN: llc < %s -mtriple=i686-unknown-linux-gnu | FileCheck %s
 
 define half @maximum_half(half %x, half %y) nounwind {
 ; CHECK-LABEL: maximum_half:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    pushl %esi
-; CHECK-NEXT:    subl $16, %esp
+; CHECK-NEXT:    subl $24, %esp
 ; CHECK-NEXT:    movzwl {{[0-9]+}}(%esp), %esi
 ; CHECK-NEXT:    movzwl {{[0-9]+}}(%esp), %eax
 ; CHECK-NEXT:    movl %eax, (%esp)
@@ -74,7 +74,7 @@ define half @maximum_half(half %x, half %y) nounwind {
 ; CHECK-NEXT:    fstp %st(1)
 ; CHECK-NEXT:    fstps (%esp)
 ; CHECK-NEXT:    calll __truncsfhf2
-; CHECK-NEXT:    addl $16, %esp
+; CHECK-NEXT:    addl $24, %esp
 ; CHECK-NEXT:    popl %esi
 ; CHECK-NEXT:    retl
   %res = call half @llvm.maximum.f16(half %x, half %y)
@@ -154,12 +154,9 @@ define float @maximum_float(float %x, float %y) nounwind {
 define double @maximum_double(double %x, double %y) nounwind {
 ; CHECK-LABEL: maximum_double:
 ; CHECK:       # %bb.0:
-; CHECK-NEXT:    pushl %ebp
-; CHECK-NEXT:    movl %esp, %ebp
-; CHECK-NEXT:    andl $-8, %esp
-; CHECK-NEXT:    subl $16, %esp
-; CHECK-NEXT:    fldl 16(%ebp)
-; CHECK-NEXT:    fldl 8(%ebp)
+; CHECK-NEXT:    subl $20, %esp
+; CHECK-NEXT:    fldl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    fldl {{[0-9]+}}(%esp)
 ; CHECK-NEXT:    fstl {{[0-9]+}}(%esp)
 ; CHECK-NEXT:    fxch %st(1)
 ; CHECK-NEXT:    fstl (%esp)
@@ -218,8 +215,7 @@ define double @maximum_double(double %x, double %y) nounwind {
 ; CHECK-NEXT:    fxch %st(1)
 ; CHECK-NEXT:  .LBB2_13:
 ; CHECK-NEXT:    fstp %st(1)
-; CHECK-NEXT:    movl %ebp, %esp
-; CHECK-NEXT:    popl %ebp
+; CHECK-NEXT:    addl $20, %esp
 ; CHECK-NEXT:    retl
   %res = call double @llvm.maximum.f64(double %x, double %y)
   ret double %res
@@ -228,25 +224,23 @@ define double @maximum_double(double %x, double %y) nounwind {
 define fp128 @maximum_fp128(fp128 %x, fp128 %y) nounwind {
 ; CHECK-LABEL: maximum_fp128:
 ; CHECK:       # %bb.0:
-; CHECK-NEXT:    pushl %ebp
-; CHECK-NEXT:    movl %esp, %ebp
 ; CHECK-NEXT:    pushl %edi
 ; CHECK-NEXT:    pushl %esi
-; CHECK-NEXT:    andl $-16, %esp
-; CHECK-NEXT:    subl $16, %esp
-; CHECK-NEXT:    movl 8(%ebp), %esi
-; CHECK-NEXT:    movl %esp, %eax
-; CHECK-NEXT:    pushl 40(%ebp)
-; CHECK-NEXT:    pushl 36(%ebp)
-; CHECK-NEXT:    pushl 32(%ebp)
-; CHECK-NEXT:    pushl 28(%ebp)
-; CHECK-NEXT:    pushl 24(%ebp)
-; CHECK-NEXT:    pushl 20(%ebp)
-; CHECK-NEXT:    pushl 16(%ebp)
-; CHECK-NEXT:    pushl 12(%ebp)
+; CHECK-NEXT:    subl $20, %esp
+; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %esi
+; CHECK-NEXT:    subl $12, %esp
+; CHECK-NEXT:    leal {{[0-9]+}}(%esp), %eax
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
 ; CHECK-NEXT:    pushl %eax
 ; CHECK-NEXT:    calll fmaximuml
-; CHECK-NEXT:    addl $32, %esp
+; CHECK-NEXT:    addl $44, %esp
 ; CHECK-NEXT:    movl (%esp), %eax
 ; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %ecx
 ; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %edx
@@ -256,10 +250,9 @@ define fp128 @maximum_fp128(fp128 %x, fp128 %y) nounwind {
 ; CHECK-NEXT:    movl %ecx, 4(%esi)
 ; CHECK-NEXT:    movl %eax, (%esi)
 ; CHECK-NEXT:    movl %esi, %eax
-; CHECK-NEXT:    leal -8(%ebp), %esp
+; CHECK-NEXT:    addl $20, %esp
 ; CHECK-NEXT:    popl %esi
 ; CHECK-NEXT:    popl %edi
-; CHECK-NEXT:    popl %ebp
 ; CHECK-NEXT:    retl $4
   %res = call fp128 @llvm.maximum.f128(fp128 %x, fp128 %y)
   ret fp128 %res
@@ -269,7 +262,7 @@ define half @minimum_half(half %x, half %y) nounwind {
 ; CHECK-LABEL: minimum_half:
 ; CHECK:       # %bb.0:
 ; CHECK-NEXT:    pushl %esi
-; CHECK-NEXT:    subl $16, %esp
+; CHECK-NEXT:    subl $24, %esp
 ; CHECK-NEXT:    movzwl {{[0-9]+}}(%esp), %esi
 ; CHECK-NEXT:    movzwl {{[0-9]+}}(%esp), %eax
 ; CHECK-NEXT:    movl %eax, (%esp)
@@ -338,7 +331,7 @@ define half @minimum_half(half %x, half %y) nounwind {
 ; CHECK-NEXT:    fstp %st(0)
 ; CHECK-NEXT:    fstps (%esp)
 ; CHECK-NEXT:    calll __truncsfhf2
-; CHECK-NEXT:    addl $16, %esp
+; CHECK-NEXT:    addl $24, %esp
 ; CHECK-NEXT:    popl %esi
 ; CHECK-NEXT:    retl
   %res = call half @llvm.minimum.f16(half %x, half %y)
@@ -418,12 +411,9 @@ define float @minimum_float(float %x, float %y) nounwind {
 define double @minimum_double(double %x, double %y) nounwind {
 ; CHECK-LABEL: minimum_double:
 ; CHECK:       # %bb.0:
-; CHECK-NEXT:    pushl %ebp
-; CHECK-NEXT:    movl %esp, %ebp
-; CHECK-NEXT:    andl $-8, %esp
-; CHECK-NEXT:    subl $16, %esp
-; CHECK-NEXT:    fldl 16(%ebp)
-; CHECK-NEXT:    fldl 8(%ebp)
+; CHECK-NEXT:    subl $20, %esp
+; CHECK-NEXT:    fldl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    fldl {{[0-9]+}}(%esp)
 ; CHECK-NEXT:    fstl {{[0-9]+}}(%esp)
 ; CHECK-NEXT:    fxch %st(1)
 ; CHECK-NEXT:    fstl (%esp)
@@ -482,8 +472,7 @@ define double @minimum_double(double %x, double %y) nounwind {
 ; CHECK-NEXT:    fldz
 ; CHECK-NEXT:  .LBB6_13:
 ; CHECK-NEXT:    fstp %st(0)
-; CHECK-NEXT:    movl %ebp, %esp
-; CHECK-NEXT:    popl %ebp
+; CHECK-NEXT:    addl $20, %esp
 ; CHECK-NEXT:    retl
   %res = call double @llvm.minimum.f64(double %x, double %y)
   ret double %res
@@ -492,25 +481,23 @@ define double @minimum_double(double %x, double %y) nounwind {
 define fp128 @minimum_fp128(fp128 %x, fp128 %y) nounwind {
 ; CHECK-LABEL: minimum_fp128:
 ; CHECK:       # %bb.0:
-; CHECK-NEXT:    pushl %ebp
-; CHECK-NEXT:    movl %esp, %ebp
 ; CHECK-NEXT:    pushl %edi
 ; CHECK-NEXT:    pushl %esi
-; CHECK-NEXT:    andl $-16, %esp
-; CHECK-NEXT:    subl $16, %esp
-; CHECK-NEXT:    movl 8(%ebp), %esi
-; CHECK-NEXT:    movl %esp, %eax
-; CHECK-NEXT:    pushl 40(%ebp)
-; CHECK-NEXT:    pushl 36(%ebp)
-; CHECK-NEXT:    pushl 32(%ebp)
-; CHECK-NEXT:    pushl 28(%ebp)
-; CHECK-NEXT:    pushl 24(%ebp)
-; CHECK-NEXT:    pushl 20(%ebp)
-; CHECK-NEXT:    pushl 16(%ebp)
-; CHECK-NEXT:    pushl 12(%ebp)
+; CHECK-NEXT:    subl $20, %esp
+; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %esi
+; CHECK-NEXT:    subl $12, %esp
+; CHECK-NEXT:    leal {{[0-9]+}}(%esp), %eax
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
 ; CHECK-NEXT:    pushl %eax
 ; CHECK-NEXT:    calll fminimuml
-; CHECK-NEXT:    addl $32, %esp
+; CHECK-NEXT:    addl $44, %esp
 ; CHECK-NEXT:    movl (%esp), %eax
 ; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %ecx
 ; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %edx
@@ -520,11 +507,84 @@ define fp128 @minimum_fp128(fp128 %x, fp128 %y) nounwind {
 ; CHECK-NEXT:    movl %ecx, 4(%esi)
 ; CHECK-NEXT:    movl %eax, (%esi)
 ; CHECK-NEXT:    movl %esi, %eax
-; CHECK-NEXT:    leal -8(%ebp), %esp
+; CHECK-NEXT:    addl $20, %esp
 ; CHECK-NEXT:    popl %esi
 ; CHECK-NEXT:    popl %edi
-; CHECK-NEXT:    popl %ebp
 ; CHECK-NEXT:    retl $4
   %res = call fp128 @llvm.minimum.f128(fp128 %x, fp128 %y)
   ret fp128 %res
 }
+
+define fp128 @maximumnum_fp128(fp128 %x, fp128 %y) nounwind {
+; CHECK-LABEL: maximumnum_fp128:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    pushl %edi
+; CHECK-NEXT:    pushl %esi
+; CHECK-NEXT:    subl $20, %esp
+; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %esi
+; CHECK-NEXT:    subl $12, %esp
+; CHECK-NEXT:    leal {{[0-9]+}}(%esp), %eax
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl %eax
+; CHECK-NEXT:    calll fmaximum_numl
+; CHECK-NEXT:    addl $44, %esp
+; CHECK-NEXT:    movl (%esp), %eax
+; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %ecx
+; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %edx
+; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %edi
+; CHECK-NEXT:    movl %edi, 12(%esi)
+; CHECK-NEXT:    movl %edx, 8(%esi)
+; CHECK-NEXT:    movl %ecx, 4(%esi)
+; CHECK-NEXT:    movl %eax, (%esi)
+; CHECK-NEXT:    movl %esi, %eax
+; CHECK-NEXT:    addl $20, %esp
+; CHECK-NEXT:    popl %esi
+; CHECK-NEXT:    popl %edi
+; CHECK-NEXT:    retl $4
+  %res = call fp128 @llvm.maximumnum.f128(fp128 %x, fp128 %y)
+  ret fp128 %res
+}
+
+define fp128 @minimumnum_fp128(fp128 %x, fp128 %y) nounwind {
+; CHECK-LABEL: minimumnum_fp128:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    pushl %edi
+; CHECK-NEXT:    pushl %esi
+; CHECK-NEXT:    subl $20, %esp
+; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %esi
+; CHECK-NEXT:    subl $12, %esp
+; CHECK-NEXT:    leal {{[0-9]+}}(%esp), %eax
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl {{[0-9]+}}(%esp)
+; CHECK-NEXT:    pushl %eax
+; CHECK-NEXT:    calll fminimum_numl
+; CHECK-NEXT:    addl $44, %esp
+; CHECK-NEXT:    movl (%esp), %eax
+; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %ecx
+; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %edx
+; CHECK-NEXT:    movl {{[0-9]+}}(%esp), %edi
+; CHECK-NEXT:    movl %edi, 12(%esi)
+; CHECK-NEXT:    movl %edx, 8(%esi)
+; CHECK-NEXT:    movl %ecx, 4(%esi)
+; CHECK-NEXT:    movl %eax, (%esi)
+; CHECK-NEXT:    movl %esi, %eax
+; CHECK-NEXT:    addl $20, %esp
+; CHECK-NEXT:    popl %esi
+; CHECK-NEXT:    popl %edi
+; CHECK-NEXT:    retl $4
+  %res = call fp128 @llvm.minimumnum.f128(fp128 %x, fp128 %y)
+  ret fp128 %res
+}


        


More information about the llvm-commits mailing list