From db5c1f3d7616cb469374903acdac032469749699 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 9 Jan 2014 11:28:53 +0000 Subject: [SystemZ] Fix RNSBG bug introduced by r197802 The zext handling added in r197802 wasn't right for RNSBG. This patch restricts it to ROSBG, RXSBG and RISBG. (The tests for RISBG were added in r197802 since RISBG was the motivating example.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198862 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/SystemZ/SystemZISelDAGToDAG.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'lib/Target/SystemZ/SystemZISelDAGToDAG.cpp') diff --git a/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp b/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp index d95361eed1..aa4752c2ba 100644 --- a/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp +++ b/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp @@ -769,15 +769,17 @@ bool SystemZDAGToDAGISel::expandRxSBG(RxSBGOperands &RxSBG) const { RxSBG.Input = N.getOperand(0); return true; - case ISD::ZERO_EXTEND: { - // Restrict the mask to the extended operand. - unsigned InnerBitSize = N.getOperand(0).getValueType().getSizeInBits(); - if (!refineRxSBGMask(RxSBG, allOnes(InnerBitSize))) - return false; + case ISD::ZERO_EXTEND: + if (RxSBG.Opcode != SystemZ::RNSBG) { + // Restrict the mask to the extended operand. + unsigned InnerBitSize = N.getOperand(0).getValueType().getSizeInBits(); + if (!refineRxSBGMask(RxSBG, allOnes(InnerBitSize))) + return false; - RxSBG.Input = N.getOperand(0); - return true; - } + RxSBG.Input = N.getOperand(0); + return true; + } + // Fall through. case ISD::SIGN_EXTEND: { // Check that the extension bits are don't-care (i.e. are masked out -- cgit v1.2.3