diff options
author | Richard Osborne <richard@xmos.com> | 2013-07-02 14:46:34 +0000 |
---|---|---|
committer | Richard Osborne <richard@xmos.com> | 2013-07-02 14:46:34 +0000 |
commit | 850ba41ed4252aae61e62140cdf0c61dbb444563 (patch) | |
tree | a303f3a990e231d52daa0e417e01f96ddda6bea5 /lib/Target/XCore | |
parent | 0a39e264330c5f6eb9e5e9e60d276613985e178d (diff) | |
download | external_llvm-850ba41ed4252aae61e62140cdf0c61dbb444563.zip external_llvm-850ba41ed4252aae61e62140cdf0c61dbb444563.tar.gz external_llvm-850ba41ed4252aae61e62140cdf0c61dbb444563.tar.bz2 |
[XCore] Fix instruction selection for zext, mkmsk instructions.
r182680 replaced CountLeadingZeros_32 with a template function
countLeadingZeros that relies on using the correct argument type to give
the right result. The type passed in the XCore backend after this
revision was incorrect in a couple of places.
Patch by Robert Lytton.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185430 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/XCore')
-rw-r--r-- | lib/Target/XCore/XCoreISelDAGToDAG.cpp | 2 | ||||
-rw-r--r-- | lib/Target/XCore/XCoreInstrInfo.td | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/Target/XCore/XCoreISelDAGToDAG.cpp b/lib/Target/XCore/XCoreISelDAGToDAG.cpp index 768cba6..e28f84f 100644 --- a/lib/Target/XCore/XCoreISelDAGToDAG.cpp +++ b/lib/Target/XCore/XCoreISelDAGToDAG.cpp @@ -115,7 +115,7 @@ SDNode *XCoreDAGToDAGISel::Select(SDNode *N) { if (immMskBitp(N)) { // Transformation function: get the size of a mask // Look for the first non-zero bit - SDValue MskSize = getI32Imm(32 - countLeadingZeros(Val)); + SDValue MskSize = getI32Imm(32 - countLeadingZeros((uint32_t)Val)); return CurDAG->getMachineNode(XCore::MKMSK_rus, dl, MVT::i32, MskSize); } diff --git a/lib/Target/XCore/XCoreInstrInfo.td b/lib/Target/XCore/XCoreInstrInfo.td index e06419a..be152ae 100644 --- a/lib/Target/XCore/XCoreInstrInfo.td +++ b/lib/Target/XCore/XCoreInstrInfo.td @@ -84,7 +84,7 @@ def msksize_xform : SDNodeXForm<imm, [{ // Transformation function: get the size of a mask assert(isMask_32(N->getZExtValue())); // look for the first non-zero bit - return getI32Imm(32 - countLeadingZeros(N->getZExtValue())); + return getI32Imm(32 - countLeadingZeros((uint32_t)N->getZExtValue())); }]>; def neg_xform : SDNodeXForm<imm, [{ |