diff options
author | dim <dim@FreeBSD.org> | 2014-03-18 22:07:45 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-03-18 22:07:45 +0000 |
commit | ce0b21596585c6ddd828c54e5077ba0aecfae8fc (patch) | |
tree | 67bb26dee066c422ad2e624408df89bdc262af76 /contrib/llvm/patches/patch-r262261-llvm-r198280-sparc.diff | |
parent | f931c3355875cf6371ab8fbad62d0f35958db4a0 (diff) | |
download | FreeBSD-src-ce0b21596585c6ddd828c54e5077ba0aecfae8fc.zip FreeBSD-src-ce0b21596585c6ddd828c54e5077ba0aecfae8fc.tar.gz |
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
Diffstat (limited to 'contrib/llvm/patches/patch-r262261-llvm-r198280-sparc.diff')
-rw-r--r-- | contrib/llvm/patches/patch-r262261-llvm-r198280-sparc.diff | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/contrib/llvm/patches/patch-r262261-llvm-r198280-sparc.diff b/contrib/llvm/patches/patch-r262261-llvm-r198280-sparc.diff new file mode 100644 index 0000000..f75d9fc --- /dev/null +++ b/contrib/llvm/patches/patch-r262261-llvm-r198280-sparc.diff @@ -0,0 +1,55 @@ +Pull in r198280 from upstream llvm trunk (by Venkatraman Govindaraju): + + [SparcV9]: Use SRL instead of SLL to clear top 32-bits in ctpop:i32. SLL does not clear top 32 bit, only SRL does. + +Introduced here: http://svn.freebsd.org/changeset/base/262261 + +Index: lib/Target/Sparc/SparcInstrInfo.td +=================================================================== +--- lib/Target/Sparc/SparcInstrInfo.td ++++ lib/Target/Sparc/SparcInstrInfo.td +@@ -967,13 +967,13 @@ let Predicates = [HasV9] in { + } + + // POPCrr - This does a ctpop of a 64-bit register. As such, we have to clear +-// the top 32-bits before using it. To do this clearing, we use a SLLri X,0. ++// the top 32-bits before using it. To do this clearing, we use a SRLri X,0. + let rs1 = 0 in + def POPCrr : F3_1<2, 0b101110, + (outs IntRegs:$dst), (ins IntRegs:$src), + "popc $src, $dst", []>, Requires<[HasV9]>; + def : Pat<(ctpop i32:$src), +- (POPCrr (SLLri $src, 0))>; ++ (POPCrr (SRLri $src, 0))>; + + //===----------------------------------------------------------------------===// + // Non-Instruction Patterns +Index: test/CodeGen/SPARC/ctpop.ll +=================================================================== +--- test/CodeGen/SPARC/ctpop.ll ++++ test/CodeGen/SPARC/ctpop.ll +@@ -1,8 +1,22 @@ +-; RUN: llc < %s -march=sparc -mattr=-v9 | not grep popc +-; RUN: llc < %s -march=sparc -mattr=+v9 | grep popc ++; RUN: llc < %s -march=sparc -mattr=-v9 | FileCheck %s -check-prefix=V8 ++; RUN: llc < %s -march=sparc -mattr=+v9 | FileCheck %s -check-prefix=V9 ++; RUN: llc < %s -march=sparcv9 | FileCheck %s -check-prefix=SPARC64 + + declare i32 @llvm.ctpop.i32(i32) + ++; V8-LABEL: test ++; V8-NOT : popc ++ ++; V9-LABEL: test ++; V9: srl %o0, 0, %o0 ++; V9-NEXT: jmp %o7+8 ++; V9-NEXT: popc %o0, %o0 ++ ++; SPARC64-LABEL: test ++; SPARC64: srl %o0, 0, %o0 ++; SPARC64: jmp %o7+8 ++; SPARC64: popc %o0, %o0 ++ + define i32 @test(i32 %X) { + %Y = call i32 @llvm.ctpop.i32( i32 %X ) ; <i32> [#uses=1] + ret i32 %Y |