From patchwork Fri Apr 4 16:22:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 337039 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 916CC1400EF for ; Sat, 5 Apr 2014 03:22:48 +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:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=fbdsZEh92hxn0eeapIBHxW8b9p+2q4bn5GzDPZ/71mkD98wnhqnd4 g/inOT1HlSS/onXdGw5VnmJFMHGbziuit4A0eQe4z0eqX3qRr8M9VFR4KMVWnh2j 3ywSAYKLlj3jEZlTOIpKf8RnLph3wtCqalSDsTpYjOSj1iTcd6NiXA= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=ouhLlx+RzgSWjqiFJ2h9T9LfjxQ=; b=C1g6OKJfrqZ40E1WJwBT iU0HBJs7blu/c2o7vNIIyhP+zQh348n1B38wD+G0qbm7c7YwVnsVdLqTnKpq6dOf und//n4mRhI+WG17Dazhc7Qixwq8A4W1QbAOKrCCXTMC5ATGVKIaPhHhQQl1TWQ+ GbEjUwDkCPGYKHj6N0RZknY= Received: (qmail 4233 invoked by alias); 4 Apr 2014 16:22:42 -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 4223 invoked by uid 89); 4 Apr 2014 16:22:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp15.uk.ibm.com Received: from e06smtp15.uk.ibm.com (HELO e06smtp15.uk.ibm.com) (195.75.94.111) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 04 Apr 2014 16:22:41 +0000 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 4 Apr 2014 17:22:37 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 4 Apr 2014 17:22:35 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id B4BA417D8041 for ; Fri, 4 Apr 2014 17:23:25 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s34GMN9n5570846 for ; Fri, 4 Apr 2014 16:22:23 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s34GMZ5i032446 for ; Fri, 4 Apr 2014 10:22:35 -0600 Received: from bart (icon-9-164-139-22.megacenter.de.ibm.com [9.164.139.22]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id s34GMXrx032435 for ; Fri, 4 Apr 2014 10:22:33 -0600 Received: by bart (sSMTP sendmail emulation); Fri, 04 Apr 2014 18:22:32 +0200 Date: Fri, 4 Apr 2014 18:22:32 +0200 From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [PATCH] S/390: Add a (not ...) splitter to help combine Message-ID: <20140404162232.GA27368@bart> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14040416-0342-0000-0000-00000856245D X-IsSubscribed: yes Hi, when combine deals with (xor (x) (const_int -1)) it turns it into a (not (x)) first. This seems to be a disadvantage for targets not providing (not ..) patterns since it prevents intermediate steps from matching. If noticed this for the builtin-bswap-8/9 testcases which are fixed with the attached patch. Bootstrap and regtest clean on s390x. Bye, -Andreas- 2014-04-04 Andreas Krebbel * config/s390/s390.md: Add a splitter for NOT rtx. diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 7d9d1ad..b17c1fa 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -7001,6 +7001,21 @@ "" "s390_expand_logical_operator (XOR, mode, operands); DONE;") +; Combine replaces (xor (x) (const_int -1)) with (not (x)) when doing +; simplifications. So its better to have something matching. +(define_split + [(set (match_operand:INT 0 "nonimmediate_operand" "") + (not:INT (match_operand:INT 1 "nonimmediate_operand" "")))] + "" + [(parallel + [(set (match_dup 0) (xor:INT (match_dup 1) (match_dup 2))) + (clobber (reg:CC CC_REGNUM))])] +{ + operands[2] = constm1_rtx; + if (!s390_logical_operator_ok_p (operands)) + FAIL; +}) + ; ; xordi3 instruction pattern(s). ;