freebsd-dev/contrib/llvm/patches/patch-r262265-llvm-r201718-sparc.diff
Dimitry Andric a1f8ad145e Add separate patch files for all the customizations we have currently
applied to our copy of llvm/clang.  These can be applied in alphabetical
order to a pristine llvm/clang 3.4 release source tree, to result in the
same version used in FreeBSD.

This is intended to clearly document all the changes until now, which
mostly consist of cherry pickings from the respective upstream trunks,
plus a number of hand-written FreeBSD-specific ones.  Hopefully those
can eventually be cleaned up and sent upstream too.

MFC after:	1 week
X-MFC-With:	r263313
2014-03-18 22:07:45 +00:00

41 lines
1.3 KiB
Diff

Pull in r201718 from upstream llvm trunk (by Roman Divacky):
Expand 64bit {SHL,SHR,SRA}_PARTS on sparcv9.
Introduced here: http://svn.freebsd.org/changeset/base/262265
Index: test/CodeGen/SPARC/parts.ll
===================================================================
--- test/CodeGen/SPARC/parts.ll
+++ test/CodeGen/SPARC/parts.ll
@@ -0,0 +1,14 @@
+; RUN: llc < %s -march=sparcv9 | FileCheck %s
+
+; CHECK-LABEL: test
+; CHECK: srl %i1, 0, %o2
+; CHECK-NEXT: or %g0, %i2, %o0
+; CHECK-NEXT: call __ashlti3
+; CHECK-NEXT: or %g0, %i3, %o1
+; CHECK-NEXT: or %g0, %o0, %i0
+
+define i128 @test(i128 %a, i128 %b) {
+entry:
+ %tmp = shl i128 %b, %a
+ ret i128 %tmp
+}
Index: lib/Target/Sparc/SparcISelLowering.cpp
===================================================================
--- lib/Target/Sparc/SparcISelLowering.cpp
+++ lib/Target/Sparc/SparcISelLowering.cpp
@@ -1554,6 +1554,10 @@ SparcTargetLowering::SparcTargetLowering(TargetMac
setOperationAction(ISD::UMULO, MVT::i64, Custom);
setOperationAction(ISD::SMULO, MVT::i64, Custom);
+
+ setOperationAction(ISD::SHL_PARTS, MVT::i64, Expand);
+ setOperationAction(ISD::SRA_PARTS, MVT::i64, Expand);
+ setOperationAction(ISD::SRL_PARTS, MVT::i64, Expand);
}
// VASTART needs to be custom lowered to use the VarArgsFrameIndex.