[PATCH] D48915: [Sparc] Use the names .rem and .urem instead of __modsi3 and __umodsi3
Daniel Cederman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 3 23:48:37 PDT 2018
dcederman created this revision.
dcederman added reviewers: venkatra, jyknight, ekedaigle.
Herald added subscribers: llvm-commits, jrtc27, fedor.sergeev.
These are the names used in libgcc.
Repository:
rL LLVM
https://reviews.llvm.org/D48915
Files:
lib/Target/Sparc/SparcISelLowering.cpp
test/CodeGen/SPARC/soft-mul-div.ll
Index: test/CodeGen/SPARC/soft-mul-div.ll
===================================================================
--- test/CodeGen/SPARC/soft-mul-div.ll
+++ test/CodeGen/SPARC/soft-mul-div.ll
@@ -63,3 +63,44 @@
ret i8 %d
}
+define i32 @test_srem32(i32 %a, i32 %b) #0 {
+ ; CHECK-LABEL: test_srem32
+ ; CHECK: call .rem
+ %d = srem i32 %a, %b
+ ret i32 %d
+}
+
+define i16 @test_srem16(i16 %a, i16 %b) #0 {
+ ; CHECK-LABEL: test_srem16
+ ; CHECK: call .rem
+ %d = srem i16 %a, %b
+ ret i16 %d
+}
+
+define i8 @test_srem8(i8 %a, i8 %b) #0 {
+ ; CHECK-LABEL: test_srem8
+ ; CHECK: call .rem
+ %d = srem i8 %a, %b
+ ret i8 %d
+}
+
+define i32 @test_urem32(i32 %a, i32 %b) #0 {
+ ; CHECK-LABEL: test_urem32
+ ; CHECK: call .urem
+ %d = urem i32 %a, %b
+ ret i32 %d
+}
+
+define i16 @test_urem16(i16 %a, i16 %b) #0 {
+ ; CHECK-LABEL: test_urem16
+ ; CHECK: call .urem
+ %d = urem i16 %a, %b
+ ret i16 %d
+}
+
+define i8 @test_urem8(i8 %a, i8 %b) #0 {
+ ; CHECK-LABEL: test_urem8
+ ; CHECK: call .urem
+ %d = urem i8 %a, %b
+ ret i8 %d
+}
Index: lib/Target/Sparc/SparcISelLowering.cpp
===================================================================
--- lib/Target/Sparc/SparcISelLowering.cpp
+++ lib/Target/Sparc/SparcISelLowering.cpp
@@ -1705,6 +1705,9 @@
setOperationAction(ISD::UDIV, MVT::i32, Expand);
setLibcallName(RTLIB::UDIV_I32, ".udiv");
+
+ setLibcallName(RTLIB::SREM_I32, ".rem");
+ setLibcallName(RTLIB::UREM_I32, ".urem");
}
if (Subtarget->is64Bit()) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48915.154054.patch
Type: text/x-patch
Size: 1602 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180704/b610941d/attachment.bin>
More information about the llvm-commits
mailing list