[llvm] [RuntimeLibcalls] Fix spelling fminmum->fminimum fmaxmum->fmaximum. (PR #118728)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 6 16:14:31 PST 2024
https://github.com/topperc updated https://github.com/llvm/llvm-project/pull/118728
>From 7628a5ddda374cb2916de9e919c1d45dc7a8b0e8 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Wed, 4 Dec 2024 18:01:20 -0800
Subject: [PATCH 1/2] [RuntimeLibcalls] Fix spelling fminmum->fminimum
fmaxmum->fmaximum.
---
llvm/include/llvm/IR/RuntimeLibcalls.def | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.def b/llvm/include/llvm/IR/RuntimeLibcalls.def
index 13a27b58b9cd78..8153845b52c7ae 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.def
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.def
@@ -307,22 +307,22 @@ HANDLE_LIBCALL(FMAX_PPCF128, "fmaxl")
HANDLE_LIBCALL(FMINIMUM_F32, "fminimumf")
HANDLE_LIBCALL(FMINIMUM_F64, "fminimum")
HANDLE_LIBCALL(FMINIMUM_F80, "fminimuml")
-HANDLE_LIBCALL(FMINIMUM_F128, "fminmuml")
+HANDLE_LIBCALL(FMINIMUM_F128, "fminimuml")
HANDLE_LIBCALL(FMINIMUM_PPCF128, "fminimuml")
HANDLE_LIBCALL(FMAXIMUM_F32, "fmaximumf")
HANDLE_LIBCALL(FMAXIMUM_F64, "fmaximum")
HANDLE_LIBCALL(FMAXIMUM_F80, "fmaximuml")
-HANDLE_LIBCALL(FMAXIMUM_F128, "fmaxmuml")
+HANDLE_LIBCALL(FMAXIMUM_F128, "fmaximuml")
HANDLE_LIBCALL(FMAXIMUM_PPCF128, "fmaximum_numl")
HANDLE_LIBCALL(FMINIMUMNUM_F32, "fminimum_numf")
HANDLE_LIBCALL(FMINIMUMNUM_F64, "fminimum_num")
HANDLE_LIBCALL(FMINIMUMNUM_F80, "fminimum_numl")
-HANDLE_LIBCALL(FMINIMUMNUM_F128, "fminmum_numl")
+HANDLE_LIBCALL(FMINIMUMNUM_F128, "fminimum_numl")
HANDLE_LIBCALL(FMINIMUMNUM_PPCF128, "fminimum_numl")
HANDLE_LIBCALL(FMAXIMUMNUM_F32, "fmaximum_numf")
HANDLE_LIBCALL(FMAXIMUMNUM_F64, "fmaximum_num")
HANDLE_LIBCALL(FMAXIMUMNUM_F80, "fmaximum_numl")
-HANDLE_LIBCALL(FMAXIMUMNUM_F128, "fmaxmum_numl")
+HANDLE_LIBCALL(FMAXIMUMNUM_F128, "fmaximum_numl")
HANDLE_LIBCALL(FMAXIMUMNUM_PPCF128, "fmaximum_numl")
HANDLE_LIBCALL(LROUND_F32, "lroundf")
HANDLE_LIBCALL(LROUND_F64, "lround")
>From fa3e1aedfee52d5b08796eb1991eebc8599fa24b Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Fri, 6 Dec 2024 16:14:15 -0800
Subject: [PATCH 2/2] fixup! add test case.
---
llvm/test/CodeGen/RISCV/fp128.ll | 98 ++++++++++++++++++++++++++++++++
1 file changed, 98 insertions(+)
diff --git a/llvm/test/CodeGen/RISCV/fp128.ll b/llvm/test/CodeGen/RISCV/fp128.ll
index 581ee5cd2304df..a8e26f7686e50d 100644
--- a/llvm/test/CodeGen/RISCV/fp128.ll
+++ b/llvm/test/CodeGen/RISCV/fp128.ll
@@ -91,3 +91,101 @@ define i32 @test_add_and_fptosi() nounwind {
%4 = fptosi fp128 %3 to i32
ret i32 %4
}
+
+define fp128 @fmaximum(fp128 %x, fp128 %y) {
+; RV32I-LABEL: fmaximum:
+; RV32I: # %bb.0:
+; RV32I-NEXT: addi sp, sp, -64
+; RV32I-NEXT: .cfi_def_cfa_offset 64
+; RV32I-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
+; RV32I-NEXT: sw s0, 56(sp) # 4-byte Folded Spill
+; RV32I-NEXT: .cfi_offset ra, -4
+; RV32I-NEXT: .cfi_offset s0, -8
+; RV32I-NEXT: lw a3, 0(a1)
+; RV32I-NEXT: lw a4, 4(a1)
+; RV32I-NEXT: lw a5, 8(a1)
+; RV32I-NEXT: lw a6, 12(a1)
+; RV32I-NEXT: lw a1, 0(a2)
+; RV32I-NEXT: lw a7, 4(a2)
+; RV32I-NEXT: lw t0, 8(a2)
+; RV32I-NEXT: lw a2, 12(a2)
+; RV32I-NEXT: mv s0, a0
+; RV32I-NEXT: sw a1, 8(sp)
+; RV32I-NEXT: sw a7, 12(sp)
+; RV32I-NEXT: sw t0, 16(sp)
+; RV32I-NEXT: sw a2, 20(sp)
+; RV32I-NEXT: addi a0, sp, 40
+; RV32I-NEXT: addi a1, sp, 24
+; RV32I-NEXT: addi a2, sp, 8
+; RV32I-NEXT: sw a3, 24(sp)
+; RV32I-NEXT: sw a4, 28(sp)
+; RV32I-NEXT: sw a5, 32(sp)
+; RV32I-NEXT: sw a6, 36(sp)
+; RV32I-NEXT: call fmaximuml
+; RV32I-NEXT: lw a0, 40(sp)
+; RV32I-NEXT: lw a1, 44(sp)
+; RV32I-NEXT: lw a2, 48(sp)
+; RV32I-NEXT: lw a3, 52(sp)
+; RV32I-NEXT: sw a0, 0(s0)
+; RV32I-NEXT: sw a1, 4(s0)
+; RV32I-NEXT: sw a2, 8(s0)
+; RV32I-NEXT: sw a3, 12(s0)
+; RV32I-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
+; RV32I-NEXT: lw s0, 56(sp) # 4-byte Folded Reload
+; RV32I-NEXT: .cfi_restore ra
+; RV32I-NEXT: .cfi_restore s0
+; RV32I-NEXT: addi sp, sp, 64
+; RV32I-NEXT: .cfi_def_cfa_offset 0
+; RV32I-NEXT: ret
+ %a = call fp128 @llvm.maximum.fp128(fp128 %x, fp128 %y)
+ ret fp128 %a
+}
+
+define fp128 @fminimum(fp128 %x, fp128 %y) {
+; RV32I-LABEL: fminimum:
+; RV32I: # %bb.0:
+; RV32I-NEXT: addi sp, sp, -64
+; RV32I-NEXT: .cfi_def_cfa_offset 64
+; RV32I-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
+; RV32I-NEXT: sw s0, 56(sp) # 4-byte Folded Spill
+; RV32I-NEXT: .cfi_offset ra, -4
+; RV32I-NEXT: .cfi_offset s0, -8
+; RV32I-NEXT: lw a3, 0(a1)
+; RV32I-NEXT: lw a4, 4(a1)
+; RV32I-NEXT: lw a5, 8(a1)
+; RV32I-NEXT: lw a6, 12(a1)
+; RV32I-NEXT: lw a1, 0(a2)
+; RV32I-NEXT: lw a7, 4(a2)
+; RV32I-NEXT: lw t0, 8(a2)
+; RV32I-NEXT: lw a2, 12(a2)
+; RV32I-NEXT: mv s0, a0
+; RV32I-NEXT: sw a1, 8(sp)
+; RV32I-NEXT: sw a7, 12(sp)
+; RV32I-NEXT: sw t0, 16(sp)
+; RV32I-NEXT: sw a2, 20(sp)
+; RV32I-NEXT: addi a0, sp, 40
+; RV32I-NEXT: addi a1, sp, 24
+; RV32I-NEXT: addi a2, sp, 8
+; RV32I-NEXT: sw a3, 24(sp)
+; RV32I-NEXT: sw a4, 28(sp)
+; RV32I-NEXT: sw a5, 32(sp)
+; RV32I-NEXT: sw a6, 36(sp)
+; RV32I-NEXT: call fminimuml
+; RV32I-NEXT: lw a0, 40(sp)
+; RV32I-NEXT: lw a1, 44(sp)
+; RV32I-NEXT: lw a2, 48(sp)
+; RV32I-NEXT: lw a3, 52(sp)
+; RV32I-NEXT: sw a0, 0(s0)
+; RV32I-NEXT: sw a1, 4(s0)
+; RV32I-NEXT: sw a2, 8(s0)
+; RV32I-NEXT: sw a3, 12(s0)
+; RV32I-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
+; RV32I-NEXT: lw s0, 56(sp) # 4-byte Folded Reload
+; RV32I-NEXT: .cfi_restore ra
+; RV32I-NEXT: .cfi_restore s0
+; RV32I-NEXT: addi sp, sp, 64
+; RV32I-NEXT: .cfi_def_cfa_offset 0
+; RV32I-NEXT: ret
+ %a = call fp128 @llvm.minimum.fp128(fp128 %x, fp128 %y)
+ ret fp128 %a
+}
More information about the llvm-commits
mailing list