From patchwork Tue Oct 2 04:09:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Sawdey X-Patchwork-Id: 977625 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-486762-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="pnhL4ZYA"; 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 42PQfL3PMgz9sB4 for ; Tue, 2 Oct 2018 14:10:02 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=rOSxY hrbilFHhD1ANQ1ZB/QO6Yvb8DaeB/52iM+yPdd/21t9ZLzOLfL7Vw7LqKjPugvoH 0+5tJnwrlkEuQhcAdcaQHr7m263/uBolzA2Pw3Cjo4Y+Oij2cygANPYxl18f+G8f 3A9zw0aL6XOZoe4cp/8EMimfmyJ5yfMffu2cWA= 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:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=D+CiXTucSm/ dbcZz5aP11ijARlU=; b=pnhL4ZYAfaV31Lt4w/pR9nu/LnJWu2PrglpsK+1hinC 1Ax+zFdx5RrfnRrZbDBN1QggTk3WjJ476GYTNjFvpJjzusUDHjUYB+3jwtMEwSrY NYuPIZw/lGD9JGf+FQPS9xS6aBDWEr3k1x04CI+Yq+gYoN7PclHTMuDy6V0WVZcg = Received: (qmail 60607 invoked by alias); 2 Oct 2018 04:09:55 -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 60596 invoked by uid 89); 2 Oct 2018 04:09:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-12.6 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=UD:D X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 02 Oct 2018 04:09:53 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9249mPt027488 for ; Tue, 2 Oct 2018 00:09:51 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0a-001b2d01.pphosted.com with ESMTP id 2mux23p15d-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 02 Oct 2018 00:09:51 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 1 Oct 2018 22:09:50 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 1 Oct 2018 22:09:46 -0600 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w9249jY546137552 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 1 Oct 2018 21:09:46 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DD8836E054; Mon, 1 Oct 2018 22:09:45 -0600 (MDT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3BBE06E050; Mon, 1 Oct 2018 22:09:45 -0600 (MDT) Received: from [9.80.212.139] (unknown [9.80.212.139]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 1 Oct 2018 22:09:44 -0600 (MDT) To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool , David Edelsohn , Bill Schmidt From: Aaron Sawdey Subject: [PATCH][rs6000][PR target/87474] fix strncmp expansion with -mno-power8-vector Date: Mon, 1 Oct 2018 23:09:44 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 x-cbid: 18100204-8235-0000-0000-00000E0AF3E8 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009806; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000267; SDB=6.01096613; UDB=6.00567053; IPR=6.00876655; MB=3.00023582; MTD=3.00000008; XFM=3.00000015; UTC=2018-10-02 04:09:48 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18100204-8236-0000-0000-000042D80832 Message-Id: <1d76627b-6690-6da1-99b1-29aab0dbf860@linux.ibm.com> X-IsSubscribed: yes PR/87474 happens because I didn't check that both vector and VSX instructions were enabled, so insns that are disabled get generated with -mno-power8-vector. Regstrap passes on ppc64le, ok for trunk? Thanks! Aaron 2018-10-01 Aaron Sawdey PR target/87474 * config/rs6000/rs6000-string.c (expand_strn_compare): Check that both vector and VSX are enabled. Index: gcc/config/rs6000/rs6000-string.c =================================================================== --- gcc/config/rs6000/rs6000-string.c (revision 264760) +++ gcc/config/rs6000/rs6000-string.c (working copy) @@ -2205,6 +2205,7 @@ } else { + /* Implies TARGET_P8_VECTOR here. */ rtx diffix = gen_reg_rtx (DImode); rtx result_gbbd = gen_reg_rtx (V16QImode); /* Since each byte of the input is either 00 or FF, the bytes in @@ -2313,9 +2314,12 @@ /* Is it OK to use vec/vsx for this. TARGET_VSX means we have at least POWER7 but we use TARGET_EFFICIENT_UNALIGNED_VSX which is at least POWER8. That way we can rely on overlapping compares to - do the final comparison of less than 16 bytes. Also I do not want - to deal with making this work for 32 bits. */ - int use_vec = (bytes >= 16 && !TARGET_32BIT && TARGET_EFFICIENT_UNALIGNED_VSX); + do the final comparison of less than 16 bytes. Also I do not + want to deal with making this work for 32 bits. In addition, we + have to make sure that we have at least P8_VECTOR (we don't allow + P9_VECTOR without P8_VECTOR). */ + int use_vec = (bytes >= 16 && !TARGET_32BIT + && TARGET_EFFICIENT_UNALIGNED_VSX && TARGET_P8_VECTOR); if (use_vec) required_align = 16;