From patchwork Thu Jul 13 08:53:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 107629 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1936270qge; Thu, 13 Jul 2017 01:55:13 -0700 (PDT) X-Received: by 10.84.175.132 with SMTP id t4mr8906564plb.135.1499936112973; Thu, 13 Jul 2017 01:55:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499936112; cv=none; d=google.com; s=arc-20160816; b=h93JVI7RqL9b2Iv199h/C/vEJL4SRscnVyBec4VPU9bMZuchPk0udr/kg/CjwpMm7q +p+8OSQjr7MsttDkfEKGiva+JsMjCJmmlZqw+JT6XikryDy08JxfFc+pbPsrg/q7F5kp 3mqoYADOMPNXAn/gCvZ2/H1UwKJprtsyuDVYyAwGBdFuXbNshNdwcrsuXuEnz32Kh8jM gSmcD/ZForhlAxlTPz4RA54+kEN2PGLZlD/sAKrIKuQ0LsZRU+AZBrRvtAmDCRDclLxk UnVebGkSIqjLDy8sxnJptKpj8BCsqWJ8jbH6yMHHtH1yWUVVdt9Lcx0PEjBi6iOtgn/4 63HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:mail-followup-to:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=m/gQ0lx2+CiYzdFm04dMSVd45W7RjEXZbBLIGXIEUKE=; b=u5rVis6HyG83Hqs6x6EIvzyVO5d3+f8qFHmhhb+pqHoqTvp5dEZEwuvtNWIBiyjiOU wd4x+CXib/9ZAuJXIzxAgoFtrzYnta86KDXndlZeJD7/iCwKe9fIzUGO3838ruyTb0Up id1mfPFMtN9eJBYGeqtNIVHsXCmFFhl9iI/5gN7PWrtAuJIXTbLLtJhM7P9JNH5IjJo7 z8IsXhk6/5whRSbAy10DI9anB8/tEJmNwVq9KWgy/O/1/CO8f29NCSbx1D85MwlsNiTL zJhIGkj8DZhwQkIqopCIG2NsrzTpjoV8RwDr0cT6PyYj0eoeC4P4AfCA6J2sWcsC/xBG 2dUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.b=CPNp3k06; spf=pass (google.com: domain of gcc-patches-return-458034-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-458034-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id z7si3867101pgr.83.2017.07.13.01.55.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2017 01:55:12 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-458034-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.b=CPNp3k06; spf=pass (google.com: domain of gcc-patches-return-458034-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-458034-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=PdBfXUg38WUj5oF8RPV5qIh7O4ZHg Ch+n/GL9yGYfwSlwWrbNOnBe72BI7AvUlxWS0jlNs9wSxxodL4QiBTdfTLcALg7F t8QO1sNuPU+7RmezHIJc4cCAAj6zds/vCDcbuCu7iS3HV/oYNfvstzEkD+BEHyEb EmTWU52nxCX1cI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=wyspCpWbv/82JSSyaFchYWUfQAE=; b=CPN p3k06J+lQpCwU/FOI+rtmf0tNmb26iNnQDqL4rNyB2NlzKM36DXvt3MR42DVgqMZ G8yjqrgdTvtdRTmxCtlxO9+WnaSyePCEQ+9u1aY5gmNxGOCFhdpO1S4c12YA9MfI l5IgGyJD867zLChjfopy9088H0S3SFYzgSumIsGg= Received: (qmail 11332 invoked by alias); 13 Jul 2017 08:54:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 10590 invoked by uid 89); 13 Jul 2017 08:54:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr0-f180.google.com Received: from mail-wr0-f180.google.com (HELO mail-wr0-f180.google.com) (209.85.128.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Jul 2017 08:53:53 +0000 Received: by mail-wr0-f180.google.com with SMTP id 77so49691668wrb.1 for ; Thu, 13 Jul 2017 01:53:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=m/gQ0lx2+CiYzdFm04dMSVd45W7RjEXZbBLIGXIEUKE=; b=G6mSp6D0qo4whG8sYZnATBGR9IJFvcXFqawzat5DXFP9BrH5U78HEBkx60j0ALXX3s kWRr5643zbSSUkdxV/xZ+QCP/BDv/GIXEtFZaNo7ufaztD1jpt5naHWE7U5nSdP9DLOZ rrc36kjhLywI2DsWQZHDBrnFosjhxufMZydBqsZ6FQXIYjacmQ0BjamY3yItSOSx86j0 A70IHKJujkqGa4GU2HP++nE/I1fYH9Iwap9FJnZhdb2xCxyTVXInZ827nL9k5oHlYVRM HYwQQDyU+1z9i0By2duiAgQT9fltciZGGohQonADtClqmuSQ4sGWyZz4ZDDFOcQgfYDC pgDg== X-Gm-Message-State: AIVw111vHCQKR1uV/U+0vuEs9xB5Eiqr4bc41Fr6y2729Pkibp23zPVs 5AaHQS1U74sOLxPmOs/JXw== X-Received: by 10.223.135.112 with SMTP id 45mr1064813wrz.133.1499936030864; Thu, 13 Jul 2017 01:53:50 -0700 (PDT) Received: from localhost (92.40.249.184.threembb.co.uk. [92.40.249.184]) by smtp.gmail.com with ESMTPSA id r132sm4252342wma.27.2017.07.13.01.53.49 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2017 01:53:50 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [43/77] Use scalar_int_mode in simplify_comparison References: <8760ewohsv.fsf@linaro.org> Date: Thu, 13 Jul 2017 09:53:48 +0100 In-Reply-To: <8760ewohsv.fsf@linaro.org> (Richard Sandiford's message of "Thu, 13 Jul 2017 09:35:44 +0100") Message-ID: <87zic8g1k3.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 The main loop of simplify_comparison starts with: if (GET_MODE_CLASS (mode) != MODE_INT && ! (mode == VOIDmode && (GET_CODE (op0) == COMPARE || COMPARISON_P (op0)))) break; So VOIDmode is only acceptable when comparing a COMPARE, EQ, NE, etc. operand against a constant. After this, the loop calls simplify_compare_const to: (a) bring the constant op1 closer to 0 where possible and (b) use nonzero_bits and num_sign_bit_copies to get a simpler constant. (a) works for both integer and VOID modes, (b) is specific to integer modes. The loop then has a big switch statement that handles further simplifications. This switch statement checks for COMPARISON_P codes but not for COMPARE. This patch uses scalar_int_mode to make the split between (a) and (b) more explicit. It also takes the COMPARISON_P handling out of the switch statement and does it first, so that the rest of the loop can treat the mode as a scalar_int_mode. 2017-07-13 Richard Sandiford Alan Hayward David Sherwood gcc/ * combine.c (simplify_compare_const): Check that the mode is a scalar_int_mode (rather than VOIDmode) before testing its precision. (simplify_comparison): Move COMPARISON_P handling out of the loop and restrict the latter part of the loop to scalar_int_modes. Check is_a before calling HWI_COMPUTABLE_MODE_P and when considering SUBREG_REGs. Use is_int_mode instead of checking GET_MODE_CLASS against MODE_INT. Index: gcc/combine.c =================================================================== --- gcc/combine.c 2017-07-13 09:18:43.037447143 +0100 +++ gcc/combine.c 2017-07-13 09:18:43.379419324 +0100 @@ -11662,7 +11662,7 @@ gen_lowpart_for_combine (machine_mode om simplify_compare_const (enum rtx_code code, machine_mode mode, rtx op0, rtx *pop1) { - unsigned int mode_width = GET_MODE_PRECISION (mode); + scalar_int_mode int_mode; HOST_WIDE_INT const_op = INTVAL (*pop1); /* Get the constant we are comparing against and turn off all bits @@ -11677,10 +11677,11 @@ simplify_compare_const (enum rtx_code co if (const_op && (code == EQ || code == NE || code == GE || code == GEU || code == LT || code == LTU) - && mode_width - 1 < HOST_BITS_PER_WIDE_INT - && pow2p_hwi (const_op & GET_MODE_MASK (mode)) - && (nonzero_bits (op0, mode) - == (unsigned HOST_WIDE_INT) (const_op & GET_MODE_MASK (mode)))) + && is_a (mode, &int_mode) + && GET_MODE_PRECISION (int_mode) - 1 < HOST_BITS_PER_WIDE_INT + && pow2p_hwi (const_op & GET_MODE_MASK (int_mode)) + && (nonzero_bits (op0, int_mode) + == (unsigned HOST_WIDE_INT) (const_op & GET_MODE_MASK (int_mode)))) { code = (code == EQ || code == GE || code == GEU ? NE : EQ); const_op = 0; @@ -11691,7 +11692,8 @@ simplify_compare_const (enum rtx_code co if (const_op == -1 && (code == EQ || code == NE || code == GT || code == LE || code == GEU || code == LTU) - && num_sign_bit_copies (op0, mode) == mode_width) + && is_a (mode, &int_mode) + && num_sign_bit_copies (op0, int_mode) == GET_MODE_PRECISION (int_mode)) { code = (code == EQ || code == LE || code == GEU ? NE : EQ); const_op = 0; @@ -11725,9 +11727,10 @@ simplify_compare_const (enum rtx_code co /* If we are doing a <= 0 comparison on a value known to have a zero sign bit, we can replace this with == 0. */ else if (const_op == 0 - && mode_width - 1 < HOST_BITS_PER_WIDE_INT - && (nonzero_bits (op0, mode) - & (HOST_WIDE_INT_1U << (mode_width - 1))) + && is_a (mode, &int_mode) + && GET_MODE_PRECISION (int_mode) - 1 < HOST_BITS_PER_WIDE_INT + && (nonzero_bits (op0, int_mode) + & (HOST_WIDE_INT_1U << (GET_MODE_PRECISION (int_mode) - 1))) == 0) code = EQ; break; @@ -11755,9 +11758,10 @@ simplify_compare_const (enum rtx_code co /* If we are doing a > 0 comparison on a value known to have a zero sign bit, we can replace this with != 0. */ else if (const_op == 0 - && mode_width - 1 < HOST_BITS_PER_WIDE_INT - && (nonzero_bits (op0, mode) - & (HOST_WIDE_INT_1U << (mode_width - 1))) + && is_a (mode, &int_mode) + && GET_MODE_PRECISION (int_mode) - 1 < HOST_BITS_PER_WIDE_INT + && (nonzero_bits (op0, int_mode) + & (HOST_WIDE_INT_1U << (GET_MODE_PRECISION (int_mode) - 1))) == 0) code = NE; break; @@ -11771,9 +11775,10 @@ simplify_compare_const (enum rtx_code co /* ... fall through ... */ } /* (unsigned) < 0x80000000 is equivalent to >= 0. */ - else if (mode_width - 1 < HOST_BITS_PER_WIDE_INT - && (unsigned HOST_WIDE_INT) const_op - == HOST_WIDE_INT_1U << (mode_width - 1)) + else if (is_a (mode, &int_mode) + && GET_MODE_PRECISION (int_mode) - 1 < HOST_BITS_PER_WIDE_INT + && ((unsigned HOST_WIDE_INT) const_op + == HOST_WIDE_INT_1U << (GET_MODE_PRECISION (int_mode) - 1))) { const_op = 0; code = GE; @@ -11787,9 +11792,11 @@ simplify_compare_const (enum rtx_code co if (const_op == 0) code = EQ; /* (unsigned) <= 0x7fffffff is equivalent to >= 0. */ - else if (mode_width - 1 < HOST_BITS_PER_WIDE_INT - && (unsigned HOST_WIDE_INT) const_op - == (HOST_WIDE_INT_1U << (mode_width - 1)) - 1) + else if (is_a (mode, &int_mode) + && GET_MODE_PRECISION (int_mode) - 1 < HOST_BITS_PER_WIDE_INT + && ((unsigned HOST_WIDE_INT) const_op + == ((HOST_WIDE_INT_1U + << (GET_MODE_PRECISION (int_mode) - 1)) - 1))) { const_op = 0; code = GE; @@ -11806,9 +11813,10 @@ simplify_compare_const (enum rtx_code co } /* (unsigned) >= 0x80000000 is equivalent to < 0. */ - else if (mode_width - 1 < HOST_BITS_PER_WIDE_INT - && (unsigned HOST_WIDE_INT) const_op - == HOST_WIDE_INT_1U << (mode_width - 1)) + else if (is_a (mode, &int_mode) + && GET_MODE_PRECISION (int_mode) - 1 < HOST_BITS_PER_WIDE_INT + && ((unsigned HOST_WIDE_INT) const_op + == HOST_WIDE_INT_1U << (GET_MODE_PRECISION (int_mode) - 1))) { const_op = 0; code = LT; @@ -11822,9 +11830,11 @@ simplify_compare_const (enum rtx_code co if (const_op == 0) code = NE; /* (unsigned) > 0x7fffffff is equivalent to < 0. */ - else if (mode_width - 1 < HOST_BITS_PER_WIDE_INT - && (unsigned HOST_WIDE_INT) const_op - == (HOST_WIDE_INT_1U << (mode_width - 1)) - 1) + else if (is_a (mode, &int_mode) + && GET_MODE_PRECISION (int_mode) - 1 < HOST_BITS_PER_WIDE_INT + && ((unsigned HOST_WIDE_INT) const_op + == (HOST_WIDE_INT_1U + << (GET_MODE_PRECISION (int_mode) - 1)) - 1)) { const_op = 0; code = LT; @@ -12009,9 +12019,8 @@ simplify_comparison (enum rtx_code code, while (CONST_INT_P (op1)) { - machine_mode mode = GET_MODE (op0); - unsigned int mode_width = GET_MODE_PRECISION (mode); - unsigned HOST_WIDE_INT mask = GET_MODE_MASK (mode); + machine_mode raw_mode = GET_MODE (op0); + scalar_int_mode int_mode; int equality_comparison_p; int sign_bit_comparison_p; int unsigned_comparison_p; @@ -12022,14 +12031,14 @@ simplify_comparison (enum rtx_code code, can handle VOIDmode if OP0 is a COMPARE or a comparison operation. */ - if (GET_MODE_CLASS (mode) != MODE_INT - && ! (mode == VOIDmode + if (GET_MODE_CLASS (raw_mode) != MODE_INT + && ! (raw_mode == VOIDmode && (GET_CODE (op0) == COMPARE || COMPARISON_P (op0)))) break; /* Try to simplify the compare to constant, possibly changing the comparison op, and/or changing op1 to zero. */ - code = simplify_compare_const (code, mode, op0, &op1); + code = simplify_compare_const (code, raw_mode, op0, &op1); const_op = INTVAL (op1); /* Compute some predicates to simplify code below. */ @@ -12041,16 +12050,62 @@ simplify_comparison (enum rtx_code code, /* If this is a sign bit comparison and we can do arithmetic in MODE, say that we will only be needing the sign bit of OP0. */ - if (sign_bit_comparison_p && HWI_COMPUTABLE_MODE_P (mode)) - op0 = force_to_mode (op0, mode, + if (sign_bit_comparison_p + && is_a (raw_mode, &int_mode) + && HWI_COMPUTABLE_MODE_P (int_mode)) + op0 = force_to_mode (op0, int_mode, HOST_WIDE_INT_1U - << (GET_MODE_PRECISION (mode) - 1), + << (GET_MODE_PRECISION (int_mode) - 1), 0); + if (COMPARISON_P (op0)) + { + /* We can't do anything if OP0 is a condition code value, rather + than an actual data value. */ + if (const_op != 0 + || CC0_P (XEXP (op0, 0)) + || GET_MODE_CLASS (GET_MODE (XEXP (op0, 0))) == MODE_CC) + break; + + /* Get the two operands being compared. */ + if (GET_CODE (XEXP (op0, 0)) == COMPARE) + tem = XEXP (XEXP (op0, 0), 0), tem1 = XEXP (XEXP (op0, 0), 1); + else + tem = XEXP (op0, 0), tem1 = XEXP (op0, 1); + + /* Check for the cases where we simply want the result of the + earlier test or the opposite of that result. */ + if (code == NE || code == EQ + || (val_signbit_known_set_p (raw_mode, STORE_FLAG_VALUE) + && (code == LT || code == GE))) + { + enum rtx_code new_code; + if (code == LT || code == NE) + new_code = GET_CODE (op0); + else + new_code = reversed_comparison_code (op0, NULL); + + if (new_code != UNKNOWN) + { + code = new_code; + op0 = tem; + op1 = tem1; + continue; + } + } + break; + } + + if (raw_mode == VOIDmode) + break; + scalar_int_mode mode = as_a (raw_mode); + /* Now try cases based on the opcode of OP0. If none of the cases does a "continue", we exit this loop immediately after the switch. */ + unsigned int mode_width = GET_MODE_PRECISION (mode); + unsigned HOST_WIDE_INT mask = GET_MODE_MASK (mode); switch (GET_CODE (op0)) { case ZERO_EXTRACT: @@ -12195,8 +12250,7 @@ simplify_comparison (enum rtx_code code, insn of the given mode, since we'd have to revert it later on, and then we wouldn't know whether to sign- or zero-extend. */ - mode = GET_MODE (XEXP (op0, 0)); - if (GET_MODE_CLASS (mode) == MODE_INT + if (is_int_mode (GET_MODE (XEXP (op0, 0)), &mode) && ! unsigned_comparison_p && HWI_COMPUTABLE_MODE_P (mode) && trunc_int_for_mode (const_op, mode) == const_op @@ -12230,11 +12284,12 @@ simplify_comparison (enum rtx_code code, if (mode_width <= HOST_BITS_PER_WIDE_INT && subreg_lowpart_p (op0) - && GET_MODE_PRECISION (GET_MODE (SUBREG_REG (op0))) > mode_width + && is_a (GET_MODE (SUBREG_REG (op0)), + &inner_mode) + && GET_MODE_PRECISION (inner_mode) > mode_width && GET_CODE (SUBREG_REG (op0)) == PLUS && CONST_INT_P (XEXP (SUBREG_REG (op0), 1))) { - machine_mode inner_mode = GET_MODE (SUBREG_REG (op0)); rtx a = XEXP (SUBREG_REG (op0), 0); HOST_WIDE_INT c1 = -INTVAL (XEXP (SUBREG_REG (op0), 1)); @@ -12271,19 +12326,19 @@ simplify_comparison (enum rtx_code code, && GET_MODE_PRECISION (GET_MODE (SUBREG_REG (op0))) < mode_width) ; else if (subreg_lowpart_p (op0) - && GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT + && GET_MODE_CLASS (mode) == MODE_INT && is_int_mode (GET_MODE (SUBREG_REG (op0)), &inner_mode) && (code == NE || code == EQ) && GET_MODE_PRECISION (inner_mode) <= HOST_BITS_PER_WIDE_INT && !paradoxical_subreg_p (op0) && (nonzero_bits (SUBREG_REG (op0), inner_mode) - & ~GET_MODE_MASK (GET_MODE (op0))) == 0) + & ~GET_MODE_MASK (mode)) == 0) { /* Remove outer subregs that don't do anything. */ tem = gen_lowpart (inner_mode, op1); if ((nonzero_bits (tem, inner_mode) - & ~GET_MODE_MASK (GET_MODE (op0))) == 0) + & ~GET_MODE_MASK (mode)) == 0) { op0 = SUBREG_REG (op0); op1 = tem; @@ -12297,8 +12352,7 @@ simplify_comparison (enum rtx_code code, /* FALLTHROUGH */ case ZERO_EXTEND: - mode = GET_MODE (XEXP (op0, 0)); - if (GET_MODE_CLASS (mode) == MODE_INT + if (is_int_mode (GET_MODE (XEXP (op0, 0)), &mode) && (unsigned_comparison_p || equality_comparison_p) && HWI_COMPUTABLE_MODE_P (mode) && (unsigned HOST_WIDE_INT) const_op <= GET_MODE_MASK (mode) @@ -12387,45 +12441,6 @@ simplify_comparison (enum rtx_code code, } break; - case EQ: case NE: - case UNEQ: case LTGT: - case LT: case LTU: case UNLT: case LE: case LEU: case UNLE: - case GT: case GTU: case UNGT: case GE: case GEU: case UNGE: - case UNORDERED: case ORDERED: - /* We can't do anything if OP0 is a condition code value, rather - than an actual data value. */ - if (const_op != 0 - || CC0_P (XEXP (op0, 0)) - || GET_MODE_CLASS (GET_MODE (XEXP (op0, 0))) == MODE_CC) - break; - - /* Get the two operands being compared. */ - if (GET_CODE (XEXP (op0, 0)) == COMPARE) - tem = XEXP (XEXP (op0, 0), 0), tem1 = XEXP (XEXP (op0, 0), 1); - else - tem = XEXP (op0, 0), tem1 = XEXP (op0, 1); - - /* Check for the cases where we simply want the result of the - earlier test or the opposite of that result. */ - if (code == NE || code == EQ - || (val_signbit_known_set_p (GET_MODE (op0), STORE_FLAG_VALUE) - && (code == LT || code == GE))) - { - enum rtx_code new_code; - if (code == LT || code == NE) - new_code = GET_CODE (op0); - else - new_code = reversed_comparison_code (op0, NULL); - - if (new_code != UNKNOWN) - { - code = new_code; - op0 = tem; - op1 = tem1; - continue; - } - } - break; case IOR: /* The sign bit of (ior (plus X (const_int -1)) X) is nonzero @@ -12697,7 +12712,7 @@ simplify_comparison (enum rtx_code code, { rtx inner = XEXP (XEXP (XEXP (op0, 0), 0), 0); rtx add_const = XEXP (XEXP (op0, 0), 1); - rtx new_const = simplify_gen_binary (ASHIFTRT, GET_MODE (op0), + rtx new_const = simplify_gen_binary (ASHIFTRT, mode, add_const, XEXP (op0, 1)); op0 = simplify_gen_binary (PLUS, tmode,