[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
Mon Jul 16 05:27:13 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL337164: [Sparc] Use the names .rem and .urem instead of __modsi3 and __umodsi3 (authored by dcederman, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D48915?vs=154054&id=155650#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D48915

Files:
  llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
  llvm/trunk/test/CodeGen/SPARC/soft-mul-div.ll


Index: llvm/trunk/test/CodeGen/SPARC/soft-mul-div.ll
===================================================================
--- llvm/trunk/test/CodeGen/SPARC/soft-mul-div.ll
+++ llvm/trunk/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: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
+++ llvm/trunk/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.155650.patch
Type: text/x-patch
Size: 1668 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180716/914e2789/attachment.bin>


More information about the llvm-commits mailing list