]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/llvm/patches/patch-r262265-llvm-r201718-sparc.diff
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / llvm / patches / patch-r262265-llvm-r201718-sparc.diff
1 Pull in r201718 from upstream llvm trunk (by Roman Divacky):
2
3   Expand 64bit {SHL,SHR,SRA}_PARTS on sparcv9.
4
5 Introduced here: http://svnweb.freebsd.org/changeset/base/262265
6
7 Index: test/CodeGen/SPARC/parts.ll
8 ===================================================================
9 --- test/CodeGen/SPARC/parts.ll
10 +++ test/CodeGen/SPARC/parts.ll
11 @@ -0,0 +1,14 @@
12 +; RUN: llc < %s -march=sparcv9    | FileCheck %s
13 +  
14 +; CHECK-LABEL: test
15 +; CHECK:        srl %i1, 0, %o2
16 +; CHECK-NEXT:   or %g0, %i2, %o0
17 +; CHECK-NEXT:   call __ashlti3
18 +; CHECK-NEXT:   or %g0, %i3, %o1
19 +; CHECK-NEXT:   or %g0, %o0, %i0
20 +  
21 +define i128 @test(i128 %a, i128 %b) {
22 +entry:
23 +    %tmp = shl i128 %b, %a
24 +    ret i128 %tmp
25 +}
26 Index: lib/Target/Sparc/SparcISelLowering.cpp
27 ===================================================================
28 --- lib/Target/Sparc/SparcISelLowering.cpp
29 +++ lib/Target/Sparc/SparcISelLowering.cpp
30 @@ -1554,6 +1554,10 @@ SparcTargetLowering::SparcTargetLowering(TargetMac
31  
32      setOperationAction(ISD::UMULO,     MVT::i64, Custom);
33      setOperationAction(ISD::SMULO,     MVT::i64, Custom);
34 +
35 +    setOperationAction(ISD::SHL_PARTS, MVT::i64, Expand);
36 +    setOperationAction(ISD::SRA_PARTS, MVT::i64, Expand);
37 +    setOperationAction(ISD::SRL_PARTS, MVT::i64, Expand);
38    }
39  
40    // VASTART needs to be custom lowered to use the VarArgsFrameIndex.