[PATCH] D48552: [Power9] Add __float128 library call for frem

Stefan Pintilie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 5 19:51:55 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL336406: [Power9] Add __float128 library call for frem (authored by stefanp, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D48552?vs=152725&id=154347#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D48552

Files:
  llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
  llvm/trunk/test/CodeGen/PowerPC/f128-arith.ll


Index: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -820,6 +820,7 @@
         setOperationAction(ISD::FCOS , MVT::f128, Expand);
         setOperationAction(ISD::FPOW, MVT::f128, Expand);
         setOperationAction(ISD::FPOWI, MVT::f128, Expand);
+        setOperationAction(ISD::FREM, MVT::f128, Expand);
       }
 
     }
@@ -1070,6 +1071,7 @@
     setLibcallName(RTLIB::FMIN_F128, "fminf128");
     setLibcallName(RTLIB::FMAX_F128, "fmaxf128");
     setLibcallName(RTLIB::POWI_F128, "__powikf2");
+    setLibcallName(RTLIB::REM_F128, "fmodf128");
   }
 
   // With 32 condition bits, we don't need to sink (and duplicate) compares
Index: llvm/trunk/test/CodeGen/PowerPC/f128-arith.ll
===================================================================
--- llvm/trunk/test/CodeGen/PowerPC/f128-arith.ll
+++ llvm/trunk/test/CodeGen/PowerPC/f128-arith.ll
@@ -293,3 +293,17 @@
   ret void
 }
 declare fp128 @llvm.powi.f128(fp128 %Val, i32 %power)
+
+ at a = common global fp128 0xL00000000000000000000000000000000, align 16
+ at b = common global fp128 0xL00000000000000000000000000000000, align 16
+
+define fp128 @qp_frem() #0 {
+entry:
+  %0 = load fp128, fp128* @a, align 16
+  %1 = load fp128, fp128* @b, align 16
+  %rem = frem fp128 %0, %1
+  ret fp128 %rem
+; CHECK-LABEL: qp_frem
+; CHECK: bl fmodf128
+; CHECK: blr
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48552.154347.patch
Type: text/x-patch
Size: 1506 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180706/c558d7a5/attachment.bin>


More information about the llvm-commits mailing list