From patchwork Tue Nov 13 03:21:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 996768 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-489813-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="lIBFuZn3"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="r6cnzlwQ"; dkim-atps=neutral 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 42vCb15QQ9z9s9G for ; Tue, 13 Nov 2018 14:21:32 +1100 (AEDT) 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:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=H+qnJWtGdPbscTQoKJyQVgbrAxb7FEsZjYbTG3XjVEdGFblSqr ZkKY9gdFkB+y8Az7Jo1vUNbD+IuDnrcoGcarM6VoRFjagC/7S06t4he5lAsnocn8 6vSBhR4Kn6E0QuPt94NykXHb0jOLllpnTVLTeUrGtc0ckTy2/jSfScI/A= 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:cc:subject:message-id:mime-version:content-type; s= default; bh=WoiQ0MDEz5iRIfuHSXAThx+PJt0=; b=lIBFuZn3bQCmt0gR0ozr xrgmP4asVGGHOkN+mRl+FeS5CScRoIzMWmapuCD5xdbU2/Jc5MdO0Mf5Z0GnXNFj I+Vpn8Lk4YYATsD54nZaxRKABRDPWbxsbzBfynY/WI+DC44NbKpt/pXlKANiTKrj ISmDLaFXCAODjwmAkZYtqUA= Received: (qmail 2302 invoked by alias); 13 Nov 2018 03:21:24 -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 2289 invoked by uid 89); 13 Nov 2018 03:21:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-HELO:sk:mail-pg, H*RU:sk:mail-pg, Hx-spam-relays-external:sk:mail-pg, HX-Received:a63 X-HELO: mail-pg1-f173.google.com Received: from mail-pg1-f173.google.com (HELO mail-pg1-f173.google.com) (209.85.215.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 Nov 2018 03:21:22 +0000 Received: by mail-pg1-f173.google.com with SMTP id 17so4741738pgg.1 for ; Mon, 12 Nov 2018 19:21:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=MVhSFd6t46SvJ1MJSOo0/HDto80VRx9rhA8tvBLkXjg=; b=r6cnzlwQrLkuCOMUnrLGc0qMbbC0AZbYiF25wF31IsOil3DGZusobaszkfreuq0lOR EbyCfbPIw/luvhHeUkO362ELCf2gRb+7Fw8Fza2ZDjziywF2sTRWsv4jo7zS243Y+/51 lbBAABTyq9yEn/zQreTkNaqvr3hcnx6BE2VInruosP6yf6bFLe4zaDstrHZM08CL5nDb rDX2YQY98o0WyqLcRYCPth3e3jxI4mQsLa3o8tsu38ocPqzUgppBs/ECzfr1oz9l0Up1 XzT0nwYCvIm57+rBeLtddDj3pOOGQJSrzZGHaEkqcaFlfux99O+EMuxopPtwRwaqbedk E8EA== Received: from bubble.grove.modra.org ([58.175.241.133]) by smtp.gmail.com with ESMTPSA id a4sm16585327pgv.70.2018.11.12.19.21.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Nov 2018 19:21:19 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 7C7C5804D6; Tue, 13 Nov 2018 13:51:16 +1030 (ACDT) Date: Tue, 13 Nov 2018 13:51:16 +1030 From: Alan Modra To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [RS6000] Rotate testcase Message-ID: <20181113032116.GK29784@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-IsSubscribed: yes The testcase exercises one of the rotate patterns. Segher okayed the testcase a long time ago, and the comments are obvious. Committed rev 266046. gcc/ * config/rs6000/predicates.md (logical_const_operand), (logical_operand): Correct comment. gcc/testsuite/ * gcc.target/powerpc/rotmask.c: New. diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md index 805d92ea1f1..1af01935b5e 100644 --- a/gcc/config/rs6000/predicates.md +++ b/gcc/config/rs6000/predicates.md @@ -922,7 +922,7 @@ (define_predicate "non_add_cint_operand" && !satisfies_constraint_L (op)"))) ;; Return 1 if the operand is a constant that can be used as the operand -;; of an OR or XOR. +;; of an AND, OR or XOR. (define_predicate "logical_const_operand" (match_code "const_int") { @@ -935,7 +935,7 @@ (define_predicate "logical_const_operand" }) ;; Return 1 if the operand is a non-special register or a constant that -;; can be used as the operand of an OR or XOR. +;; can be used as the operand of an AND, OR or XOR. (define_predicate "logical_operand" (ior (match_operand 0 "gpc_reg_operand") (match_operand 0 "logical_const_operand"))) diff --git a/gcc/testsuite/gcc.target/powerpc/rotmask.c b/gcc/testsuite/gcc.target/powerpc/rotmask.c new file mode 100644 index 00000000000..4d1b9174921 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/rotmask.c @@ -0,0 +1,8 @@ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-O2" } */ +/* { dg-final { scan-assembler-not "rotldi" } } */ + +unsigned long f (unsigned long x) +{ + return ((x << 1) | (x >> 63)) & 0xffffffff; +}