From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76516 invoked by alias); 12 Aug 2015 01:11: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 76480 invoked by uid 89); 12 Aug 2015 01:11:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f46.google.com Received: from mail-pa0-f46.google.com (HELO mail-pa0-f46.google.com) (209.85.220.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 12 Aug 2015 01:11:56 +0000 Received: by pacrr5 with SMTP id rr5so2213075pac.3 for ; Tue, 11 Aug 2015 18:11:54 -0700 (PDT) X-Received: by 10.68.103.132 with SMTP id fw4mr62492100pbb.62.1439341914809; Tue, 11 Aug 2015 18:11:54 -0700 (PDT) Received: from bigtime.twiddle.net (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by smtp.gmail.com with ESMTPSA id kv10sm4167810pbc.2.2015.08.11.18.11.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Aug 2015 18:11:54 -0700 (PDT) From: Richard Henderson To: gcc-patches@gcc.gnu.org Cc: David Edelsohn Subject: [PATCH 09/15] rs6000: Use xoris in constant construction Date: Wed, 12 Aug 2015 01:12:00 -0000 Message-Id: <1439341904-9345-10-git-send-email-rth@redhat.com> In-Reply-To: <1439341904-9345-1-git-send-email-rth@redhat.com> References: <1439341904-9345-1-git-send-email-rth@redhat.com> X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00561.txt.bz2 Helps for constants like 0xfffff70008000ul, 0xffffffff55555555ul, 0xffffffff550ffffful. There doesn't appear to be any benefit to using xori; every test that I expected to use it found an alternate solution of the same cost. Cc: David Edelsohn --- * config/rs6000/rs6000.c (genimm_ppc::exam_search): Test for inverting the second half-word. (genimm_ppc::generate): Handle XOR. --- gcc/config/rs6000/rs6000.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 9c08cca..40b29b0 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -8169,6 +8169,11 @@ genimm_ppc::exam_search (HOST_WIDE_INT c, int budget) return true; } } + if (exam_sub (c | 0xffff0000u, sub_budget)) + { + opN (XOR, ~c & 0xffff0000u); /* XORIS */ + return true; + } /* If C is a mask itself, apply it to all ones. */ if (exam_mask (-1, c, sub_budget)) @@ -8253,6 +8258,7 @@ genimm_ppc::generate (rtx dest, machine_mode mode) const case PLUS: case AND: case IOR: + case XOR: case ASHIFT: x = gen_rtx_fmt_ee (r, mode, op1, op2); break; -- 2.4.3