[llvm] [CSKY] Don't emit `__multi3` on 32-bit CSKY (PR #69732)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 22 04:14:31 PDT 2023
https://github.com/Dirreke updated https://github.com/llvm/llvm-project/pull/69732
>From c2f3e3a0305fa45e2e8b8d1572ab6c5bc910374d Mon Sep 17 00:00:00 2001
From: Dirreck <mingyang_ge at 163.com>
Date: Fri, 20 Oct 2023 22:58:13 +0800
Subject: [PATCH 1/3] disable `_multi3` for 32-bit target
---
llvm/lib/Target/CSKY/CSKYISelLowering.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/llvm/lib/Target/CSKY/CSKYISelLowering.cpp b/llvm/lib/Target/CSKY/CSKYISelLowering.cpp
index e3b4a2dc048ab20..9cb7bd7058f9749 100644
--- a/llvm/lib/Target/CSKY/CSKYISelLowering.cpp
+++ b/llvm/lib/Target/CSKY/CSKYISelLowering.cpp
@@ -109,6 +109,14 @@ CSKYTargetLowering::CSKYTargetLowering(const TargetMachine &TM,
setOperationAction(ISD::ATOMIC_FENCE, MVT::Other, Expand);
+ // These libcalls are not available in 32-bit.
+ setLibcallName(RTLIB::SHL_I128, nullptr);
+ setLibcallName(RTLIB::SRL_I128, nullptr);
+ setLibcallName(RTLIB::SRA_I128, nullptr);
+ setLibcallName(RTLIB::MUL_I128, nullptr);
+ setLibcallName(RTLIB::MULO_I64, nullptr);
+ setLibcallName(RTLIB::MULO_I128, nullptr);
+
// Float
ISD::CondCode FPCCToExtend[] = {
>From 6454411d95411984b10e61b90fdbf21fa08dc844 Mon Sep 17 00:00:00 2001
From: Dirreck <mingyang_ge at 163.com>
Date: Fri, 20 Oct 2023 23:56:29 +0800
Subject: [PATCH 2/3] Update CSKYISelLowering.cpp
---
llvm/lib/Target/CSKY/CSKYISelLowering.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/Target/CSKY/CSKYISelLowering.cpp b/llvm/lib/Target/CSKY/CSKYISelLowering.cpp
index 9cb7bd7058f9749..ddad1509f0fd730 100644
--- a/llvm/lib/Target/CSKY/CSKYISelLowering.cpp
+++ b/llvm/lib/Target/CSKY/CSKYISelLowering.cpp
@@ -116,7 +116,7 @@ CSKYTargetLowering::CSKYTargetLowering(const TargetMachine &TM,
setLibcallName(RTLIB::MUL_I128, nullptr);
setLibcallName(RTLIB::MULO_I64, nullptr);
setLibcallName(RTLIB::MULO_I128, nullptr);
-
+
// Float
ISD::CondCode FPCCToExtend[] = {
>From 75fefa6cbba9723d0096483a189a06d2255209e2 Mon Sep 17 00:00:00 2001
From: Dirreck <mingyang_ge at 163.com>
Date: Sun, 22 Oct 2023 19:14:21 +0800
Subject: [PATCH 3/3] disable more libcalls
---
llvm/lib/Target/CSKY/CSKYISelLowering.cpp | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/llvm/lib/Target/CSKY/CSKYISelLowering.cpp b/llvm/lib/Target/CSKY/CSKYISelLowering.cpp
index ddad1509f0fd730..ef1bc4a57a951d1 100644
--- a/llvm/lib/Target/CSKY/CSKYISelLowering.cpp
+++ b/llvm/lib/Target/CSKY/CSKYISelLowering.cpp
@@ -116,6 +116,18 @@ CSKYTargetLowering::CSKYTargetLowering(const TargetMachine &TM,
setLibcallName(RTLIB::MUL_I128, nullptr);
setLibcallName(RTLIB::MULO_I64, nullptr);
setLibcallName(RTLIB::MULO_I128, nullptr);
+ setLibcallName(SINTTOFP_I128_F16, nullptr);
+ setLibcallName(SINTTOFP_I128_F32, nullptr);
+ setLibcallName(SINTTOFP_I128_F64, nullptr);
+ setLibcallName(SINTTOFP_I128_F80, nullptr);
+ setLibcallName(SINTTOFP_I128_F128, nullptr);
+ setLibcallName(SINTTOFP_I128_PPCF128, nullptr);
+ setLibcallName(UINTTOFP_I128_F16, nullptr);
+ setLibcallName(UINTTOFP_I128_F32, nullptr);
+ setLibcallName(UINTTOFP_I128_F64, nullptr);
+ setLibcallName(UINTTOFP_I128_F80, nullptr);
+ setLibcallName(UINTTOFP_I128_F128, nullptr);
+ setLibcallName(UINTTOFP_I128_PPCF128, nullptr);
// Float
More information about the llvm-commits
mailing list