From patchwork Tue Apr 2 17:20:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 233099 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 367862C008D for ; Wed, 3 Apr 2013 04:20:33 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=kTcA22QgLAnnb22BNnVFOzQcL4ONjceK1rLTDbHdJlgCN0 skIlZJwu941Elwt95ROcPi3NB3quab+V84DDOtSA7trKUbYH6D6RrrPHoEi12MeH O3mJmuEhbGloZ4iHreNvf8NXYJ76GHnUikSGk9c4guCInCAhVW4nAl5chL80g= 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 :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=gs+pHGNi4P0m0fFHacYrGN5U17U=; b=P5HzeglEyfUrK5cInTCT YN+UAnrrmtAwC8NxIbLnvDl2Ed8R+XYlU4MrciuRnnVbyL14ObhFYgYnfAwyd3nH PzPVago9gMqQkwqAvPetJ9YueTgsl3krsbNV51nEWIRmCdnriaaopmOI7EU1hz6Q 75y6MUKFsNbiN1zLxKkHLsw= Received: (qmail 5400 invoked by alias); 2 Apr 2013 17:20:19 -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 5325 invoked by uid 89); 2 Apr 2013 17:20:09 -0000 X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_ZJ autolearn=ham version=3.3.1 Received: from mail-oa0-f49.google.com (HELO mail-oa0-f49.google.com) (209.85.219.49) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 02 Apr 2013 17:20:05 +0000 Received: by mail-oa0-f49.google.com with SMTP id j6so618570oag.8 for ; Tue, 02 Apr 2013 10:20:04 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.133.4 with SMTP id oy4mr6089865oeb.56.1364923204183; Tue, 02 Apr 2013 10:20:04 -0700 (PDT) Received: by 10.182.49.68 with HTTP; Tue, 2 Apr 2013 10:20:04 -0700 (PDT) Date: Tue, 2 Apr 2013 19:20:04 +0200 Message-ID: Subject: [PATCH, i386]: Merge *testqi_ext_3_rex64 and *testqi_ext_3 From: Uros Bizjak To: "gcc-patches@gcc.gnu.org" X-Virus-Found: No Hello! 2013-04-02 Uros Bizjak * config/i386/i386.md (*testqi_ext_3): Merge with *testqi_ext_3_rex64 using SWI48 mode attribute. Tested on x86_64-pc-linux-gnu {,-m32} and committed to mainline SVN. Uros. Index: config/i386/i386.md =================================================================== --- config/i386/i386.md (revision 197339) +++ config/i386/i386.md (working copy) @@ -7134,43 +7134,26 @@ [(set_attr "type" "test") (set_attr "mode" "QI")]) -(define_insn "*testqi_ext_3_rex64" - [(set (reg FLAGS_REG) - (compare (zero_extract:DI - (match_operand 0 "nonimmediate_operand" "rm") - (match_operand:DI 1 "const_int_operand") - (match_operand:DI 2 "const_int_operand")) - (const_int 0)))] - "TARGET_64BIT - && ix86_match_ccmode (insn, CCNOmode) - && INTVAL (operands[1]) > 0 - && INTVAL (operands[2]) >= 0 - /* Ensure that resulting mask is zero or sign extended operand. */ - && (INTVAL (operands[1]) + INTVAL (operands[2]) <= 32 - || (INTVAL (operands[1]) + INTVAL (operands[2]) == 64 - && INTVAL (operands[1]) > 32)) - && (GET_MODE (operands[0]) == SImode - || GET_MODE (operands[0]) == DImode - || GET_MODE (operands[0]) == HImode - || GET_MODE (operands[0]) == QImode)" - "#") - ;; Combine likes to form bit extractions for some tests. Humor it. (define_insn "*testqi_ext_3" [(set (reg FLAGS_REG) - (compare (zero_extract:SI + (compare (zero_extract:SWI48 (match_operand 0 "nonimmediate_operand" "rm") - (match_operand:SI 1 "const_int_operand") - (match_operand:SI 2 "const_int_operand")) + (match_operand:SWI48 1 "const_int_operand") + (match_operand:SWI48 2 "const_int_operand")) (const_int 0)))] "ix86_match_ccmode (insn, CCNOmode) - && INTVAL (operands[1]) > 0 - && INTVAL (operands[2]) >= 0 - && INTVAL (operands[1]) + INTVAL (operands[2]) <= 32 - && (GET_MODE (operands[0]) == SImode - || (TARGET_64BIT && GET_MODE (operands[0]) == DImode) + && ((TARGET_64BIT && GET_MODE (operands[0]) == DImode) + || GET_MODE (operands[0]) == SImode || GET_MODE (operands[0]) == HImode - || GET_MODE (operands[0]) == QImode)" + || GET_MODE (operands[0]) == QImode) + /* Ensure that resulting mask is zero or sign extended operand. */ + && INTVAL (operands[2]) >= 0 + && ((INTVAL (operands[1]) > 0 + && INTVAL (operands[1]) + INTVAL (operands[2]) <= 32) + || (mode == DImode + && INTVAL (operands[1]) > 32 + && INTVAL (operands[1]) + INTVAL (operands[2]) == 64))" "#") (define_split