From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101083 invoked by alias); 12 Feb 2020 06:48:58 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 100997 invoked by uid 89); 12 Feb 2020 06:48:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: smtp2.axis.com Received: from smtp2.axis.com (HELO smtp2.axis.com) (195.60.68.18) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Feb 2020 06:48:23 +0000 IronPort-SDR: 4MZ/7zFvUIZ5Nid+ZjV8uQB4tKXKaSPcASmRKFcLjLK3qiCMWV3Zi7xHAT/D9szrLZeRyYA+IH l+muzOUy9UMF2XrwM/xFNRs1Bnu2WTqWikOjJrl2ihXi4HkcZ2S9kKIRqi35vkiYOtDkS/Ar8V z8g1AmjMZuEoC+dVR8A71xLHc0Ej3Ded35aMZEUWxElFblHhc8tjupyghn0oaUH8GaxDWUo9+z eo2QOUDt8qw3zZKtT8yzFKtMvdt/tpRktKxPkXIm1kSloF9mUqJliGdzPJyipD7WhGYyQHiGSE ico= Date: Wed, 12 Feb 2020 06:48:00 -0000 Message-ID: <202002120648.01C6mEqB026246@ignucius.se.axis.com> From: Hans-Peter Nilsson To: Subject: [cris-decc0 1/14] cris: Emit trivial btstq expected by gcc.target/cris/sync-2i.c, sync-2c.c MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Return-Path: hp@axis.com X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00694.txt.bz2 PR target/93372 * config/cris/cris.md (zcond): New code_iterator. ("*cbranch4_btstq"): New insn_and_split. As the added FIXME says, the new insn_and_split generates only a small subset of the bit-tests that can be matched by "*btst" and that were emitted by the undecc0rated cris.md at combine-time, but it's naturally separable from a general variant by being just what's needed for the test-cases that were previously xfailed, and that no additional CCmodes are required. --- gcc/config/cris/cris.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md index 7690d7f06..0b42197a9 100644 --- a/gcc/config/cris/cris.md +++ b/gcc/config/cris/cris.md @@ -178,6 +178,7 @@ (define_code_iterator shiftrt [ashiftrt lshiftrt]) (define_code_attr shlr [(ashiftrt "ashr") (lshiftrt "lshr") (ashift "ashl")]) (define_code_attr slr [(ashiftrt "asr") (lshiftrt "lsr") (ashift "lsl")]) +(define_code_iterator zcond [eq ne]) (define_code_iterator ncond [eq ne gtu ltu geu leu]) (define_code_iterator ocond [gt le]) (define_code_iterator rcond [lt ge]) @@ -1934,6 +1935,32 @@ (define_insn_and_split "*cbranch4" (pc)))] "") +;; FIXME: this matches only a subset of what the "*btst" pattern can handle. +(define_insn_and_split "*cbranch4_btstq" + [(set (pc) + (if_then_else + (zcond + (zero_extract:BWD + (match_operand:BWD 0 "register_operand" "r") + (match_operand 1 "const_int_operand" "Kc") + (const_int 0)) + (const_int 0)) + (label_ref (match_operand 2 "")) + (pc))) + (clobber (reg:CC CRIS_CC0_REGNUM))] + "" + "#" + "&& reload_completed" + [(set (reg:CC CRIS_CC0_REGNUM) + (compare:CC + (zero_extract:SI (match_dup 0) (match_dup 1) (const_int 0)) + (const_int 0))) + (set (pc) + (if_then_else (zcond (reg:CC CRIS_CC0_REGNUM) (const_int 0)) + (label_ref (match_dup 3)) + (pc)))] + "") + ;; We suffer from the same overflow-bit-gets-in-the-way problem as ;; e.g. m68k, so we have to check if overflow bit is set on all "signed" -- 2.11.0 brgds, H-P