[llvm] r280537 - [Sparc] Mark i128 shift libcalls unavailable in 32-bit mode.

James Y Knight via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 2 13:29:11 PDT 2016

Author: jyknight
Date: Fri Sep  2 15:29:11 2016
New Revision: 280537

URL: http://llvm.org/viewvc/llvm-project?rev=280537&view=rev
[Sparc] Mark i128 shift libcalls unavailable in 32-bit mode.

Recently, llvm wants to emit calls to these functions, while it didn't
seem to be an issue before. Not sure why. Nor do I know why only these
three are important to disable, out of all of the i128 libcalls.

Nevertheless, many other targets have this snippet of code, so, just
copying it to sparc as well, to unbreak things.


Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=280537&r1=280536&r2=280537&view=diff
--- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Fri Sep  2 15:29:11 2016
@@ -1641,6 +1641,13 @@ SparcTargetLowering::SparcTargetLowering
     setOperationAction(ISD::ATOMIC_STORE, MVT::i64, Custom);
+  if (!Subtarget->is64Bit()) {
+    // These libcalls are not available in 32-bit.
+    setLibcallName(RTLIB::SHL_I128, nullptr);
+    setLibcallName(RTLIB::SRL_I128, nullptr);
+    setLibcallName(RTLIB::SRA_I128, nullptr);
+  }
   if (!Subtarget->isV9()) {
     // SparcV8 does not have FNEGD and FABSD.
     setOperationAction(ISD::FNEG, MVT::f64, Custom);

More information about the llvm-commits mailing list