From patchwork Tue Apr 26 13:06:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 92925 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 967E9B6F15 for ; Tue, 26 Apr 2011 23:06:43 +1000 (EST) Received: (qmail 24025 invoked by alias); 26 Apr 2011 13:06:40 -0000 Received: (qmail 24017 invoked by uid 22791); 26 Apr 2011 13:06:39 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST, TW_ZJ, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-pw0-f47.google.com (HELO mail-pw0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 26 Apr 2011 13:06:24 +0000 Received: by pwj9 with SMTP id 9so474896pwj.20 for ; Tue, 26 Apr 2011 06:06:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.209.10 with SMTP id h10mr348043wfg.344.1303823184044; Tue, 26 Apr 2011 06:06:24 -0700 (PDT) Received: by 10.142.87.14 with HTTP; Tue, 26 Apr 2011 06:06:23 -0700 (PDT) Date: Tue, 26 Apr 2011 15:06:23 +0200 Message-ID: Subject: [PATCH, i386]: Remove ext_QIreg_nomode_operands predicate From: Uros Bizjak To: gcc-patches@gcc.gnu.org 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 Hello! We can use ext_QIreg_operands instead. These predicates automatically include mode checks with VOIDmode override. Also, clean predicates.md a bit while there. 2011-04-26 Uros Bizjak * config/i386/predicates.md (ext_QIreg_operand): Remove extra mode check. (ext_QIreg_nomode_operands): Remove. * config/i386/i386.md (*anddi_1): Use ext_QIreg_operand. (*andsi_1): Ditto. (*andhi_1): Ditto. Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN. Uros. Index: predicates.md =================================================================== --- predicates.md (revision 172954) +++ predicates.md (working copy) @@ -86,16 +86,9 @@ ;; %[abcd][hl]. (define_predicate "ext_QIreg_operand" (and (match_code "reg") - (match_test "TARGET_64BIT - && GET_MODE (op) == QImode - && REGNO (op) > BX_REG"))) + (match_test "TARGET_64BIT") + (match_test "REGNO (op) > BX_REG"))) -;; Similarly, but don't check mode of the operand. -(define_predicate "ext_QIreg_nomode_operand" - (and (match_code "reg") - (match_test "TARGET_64BIT - && REGNO (op) > BX_REG"))) - ;; Return true if op is not xmm0 register. (define_predicate "reg_not_xmm0_operand" (match_operand 0 "register_operand") @@ -391,7 +384,8 @@ ;; Return true if OP is nonmemory operand acceptable by movabs patterns. (define_predicate "x86_64_movabs_operand" - (if_then_else (match_test "!TARGET_64BIT || !flag_pic") + (if_then_else (not (and (match_test "TARGET_64BIT") + (match_test "flag_pic"))) (match_operand 0 "nonmemory_operand") (ior (match_operand 0 "register_operand") (and (match_operand 0 "const_double_operand") @@ -483,7 +477,7 @@ ;; scripts means that we can't be sure of that in general, so assume ;; that @GOTOFF is never valid on VxWorks. (define_predicate "gotoff_operand" - (and (match_test "!TARGET_VXWORKS_RTP") + (and (not (match_test "TARGET_VXWORKS_RTP")) (match_operand 0 "local_symbolic_operand"))) ;; Test for various thread-local symbols. @@ -611,7 +605,8 @@ ;; Match 0 or 1. (define_predicate "const_0_to_1_operand" (and (match_code "const_int") - (match_test "op == const0_rtx || op == const1_rtx"))) + (ior (match_test "op == const0_rtx") + (match_test "op == const1_rtx")))) ;; Match 0 to 3. (define_predicate "const_0_to_3_operand" @@ -696,7 +691,8 @@ ;; Match exactly one bit in 2-bit mask. (define_predicate "const_pow2_1_to_2_operand" (and (match_code "const_int") - (match_test "INTVAL (op) == 1 || INTVAL (op) == 2"))) + (ior (match_test "op == const1_rtx") + (match_test "op == const2_rtx")))) ;; Match exactly one bit in 4-bit mask. (define_predicate "const_pow2_1_to_8_operand" @@ -737,7 +733,8 @@ (define_predicate "reg_or_pm1_operand" (ior (match_operand 0 "register_operand") (and (match_code "const_int") - (match_test "op == const1_rtx || op == constm1_rtx")))) + (ior (match_test "op == const1_rtx") + (match_test "op == constm1_rtx"))))) ;; True if OP is acceptable as operand of DImode shift expander. (define_predicate "shiftdi_operand" @@ -984,8 +981,8 @@ (define_predicate "sse_comparison_operator" (ior (match_code "eq,ne,lt,le,unordered,unge,ungt,ordered") - (and (match_code "ge,gt,uneq,unle,unlt,ltgt") - (match_test "TARGET_AVX")))) + (and (match_test "TARGET_AVX") + (match_code "ge,gt,uneq,unle,unlt,ltgt")))) (define_predicate "ix86_comparison_int_operator" (match_code "ne,eq,ge,gt,le,lt")) Index: i386.md =================================================================== --- i386.md (revision 172954) +++ i386.md (working copy) @@ -7932,7 +7932,7 @@ (if_then_else (and (eq_attr "type" "imovx") (and (ne (symbol_ref "INTVAL (operands[2]) == 0xff") (const_int 0)) - (match_operand 1 "ext_QIreg_nomode_operand" ""))) + (match_operand 1 "ext_QIreg_operand" ""))) (const_string "1") (const_string "*"))) (set_attr "mode" "SI,DI,DI,SI")]) @@ -7976,7 +7976,7 @@ (if_then_else (and (eq_attr "type" "imovx") (and (ne (symbol_ref "INTVAL (operands[2]) == 0xff") (const_int 0)) - (match_operand 1 "ext_QIreg_nomode_operand" ""))) + (match_operand 1 "ext_QIreg_operand" ""))) (const_string "1") (const_string "*"))) (set_attr "length_immediate" "*,*,0") @@ -8019,7 +8019,7 @@ (set (attr "prefix_rex") (if_then_else (and (eq_attr "type" "imovx") - (match_operand 1 "ext_QIreg_nomode_operand" "")) + (match_operand 1 "ext_QIreg_operand" "")) (const_string "1") (const_string "*"))) (set_attr "mode" "HI,HI,SI")])