OSDN Git Service

[PR27599] [SystemZ] [SelectionDAG] Fix extension of atomic cmpxchg result.
authorMarcin Koscielnicki <koriakin@0x04.net>
Tue, 10 May 2016 16:49:04 +0000 (16:49 +0000)
committerMarcin Koscielnicki <koriakin@0x04.net>
Tue, 10 May 2016 16:49:04 +0000 (16:49 +0000)
commit9100579a4f8d8c9c76305a71f623253d59f1a043
tree6e91fa78b77acc93a7ceb4bcb7a007f37eee1083
parent88e0932f27a3878fb5544bebe6a4c35e0f11c165
[PR27599] [SystemZ] [SelectionDAG] Fix extension of atomic cmpxchg result.

Currently, SelectionDAG assumes 8/16-bit cmpxchg returns either a sign
extended result, or a zero extended result.  SystemZ takes a third
option by returning junk in the high bits (rotated contents of the other
bytes in the memory word).  In that case, don't use Assert*ext, and
zero-extend the result ourselves if a comparison is needed.

Differential Revision: http://reviews.llvm.org/D19800

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269075 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/Target/Mips/MipsISelLowering.h
lib/Target/SystemZ/SystemZISelLowering.h
test/CodeGen/SystemZ/cmpxchg-05.ll [new file with mode: 0644]