From patchwork Thu Sep 12 18:02:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Carl Love X-Patchwork-Id: 1161726 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-508968-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="vYwx5vwu"; 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 46TmpH4WwLz9s7T for ; Fri, 13 Sep 2019 04:03:01 +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 :message-id:subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding; q=dns; s=default; b=eoJYoucM/XKHiNPD mQcHnS+ZBcJ5tsvDe/YH5e6zBmgOSZ17M8bMHUQZYDkj0DrEnvM31CW8yZSFyHp8 BLPKrvAun4p/SGgHeKpdDUOj/uh2SM6MH3eINH1Zv1Klh4xTfsDJVDUqS6nch/P8 qMwY8R1unifOXOwcGETApRIQBqo= 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 :message-id:subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding; s=default; bh=YWuWltoIXMIqq1NZL4DfcR 6NaN8=; b=vYwx5vwuJrKzeYOgfZgweIMcEDvUZQdOPstKk7sgF29d8h7NY8oPwl lP0iz8U1kXyUQrW9fyfTqMEtXA7/Y2qvAdSdaspr0cCFS0mq/ZhEol0tYb6W14hT lm0Io1JyFQhgSzTcvuy7ewiWh5RRVbUKcXChbPEmYFZM3KoHeWRek= Received: (qmail 117975 invoked by alias); 12 Sep 2019 18:02:53 -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 117967 invoked by uid 89); 12 Sep 2019 18:02:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=vsxmd, UD:vsx.md, maintainers, vsx.md X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Sep 2019 18:02:50 +0000 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8CHvKsV022654 for ; Thu, 12 Sep 2019 14:02:46 -0400 Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0b-001b2d01.pphosted.com with ESMTP id 2uytcc1aak-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 12 Sep 2019 14:02:46 -0400 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8CI16rZ003177 for ; Thu, 12 Sep 2019 18:02:46 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma05wdc.us.ibm.com with ESMTP id 2uytdx08cy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 12 Sep 2019 18:02:46 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8CI2jCV40042758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Sep 2019 18:02:45 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 78471124053; Thu, 12 Sep 2019 18:02:45 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 186FA124052; Thu, 12 Sep 2019 18:02:45 +0000 (GMT) Received: from oc3304648336.ibm.com (unknown [9.70.82.49]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 12 Sep 2019 18:02:44 +0000 (GMT) Message-ID: <1568311364.3756.10.camel@us.ibm.com> Subject: [PATCH RS6000], add xxswapd support From: Carl Love To: gcc-patches@gcc.gnu.org Cc: Bill Schmidt , cel@ibm.com Date: Thu, 12 Sep 2019 11:02:44 -0700 Mime-Version: 1.0 X-IsSubscribed: yes GCC maintainers: The following patch adds define_insn support for xxswapd mnemonic. The xxswapd mnemonic is the more prefered name for the xxpermdi mnemonic. The following patch replaces the define_insn xxpermdi with define_insn xxswapd. The patch has been tested on:   powerpc64le-unknown-linux-gnu (Power 8 LE)   powerpc64le-unknown-linux-gnu (Power 9 LE) with no regressions. Please let me know if the patch is acceptable for trunk. Carl Love ----------------------------------------------------------- RS6000, add xxswapd support gcc/ChangeLog: 2019-09-10 Carl Love * config/rs6000/vsx.md (xxswapd_v4si, xxswapd_v8hi, xxswapd_v16qi): New define_insn. (vsx_xxpermdi4_le_, vsx_xxpermdi8_le_V8HI, vsx_xxpermdi16_le_V16QI): Removed define_insn. --- gcc/config/rs6000/vsx.md | 74 ++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md index 7633171df..cd67131eb 100644 --- a/gcc/config/rs6000/vsx.md +++ b/gcc/config/rs6000/vsx.md @@ -2941,43 +2941,49 @@ "xxpermdi %x0,%x1,%x1,2" [(set_attr "type" "vecperm")]) -(define_insn "*vsx_xxpermdi4_le_" - [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa") - (vec_select:VSX_W - (match_operand:VSX_W 1 "vsx_register_operand" "wa") - (parallel [(const_int 2) (const_int 3) - (const_int 0) (const_int 1)])))] - "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (mode)" - "xxpermdi %x0,%x1,%x1,2" +(define_insn "xxswapd_v16qi" + [(set (match_operand:V16QI 0 "vsx_register_operand" "=wa") + (vec_select:V16QI + (match_operand:V16QI 1 "vsx_register_operand" "wa") + (parallel [(const_int 8) (const_int 9) + (const_int 10) (const_int 11) + (const_int 12) (const_int 13) + (const_int 14) (const_int 15) + (const_int 0) (const_int 1) + (const_int 2) (const_int 3) + (const_int 4) (const_int 5) + (const_int 6) (const_int 7)])))] + "TARGET_VSX" +;; AIX does not support the extended mnemonic xxswapd. Use the basic +;; mnemonic xxpermdi instead. + "xxpermdi %x0,%x1,%x1,2" [(set_attr "type" "vecperm")]) -(define_insn "*vsx_xxpermdi8_le_V8HI" +(define_insn "xxswapd_v8hi" [(set (match_operand:V8HI 0 "vsx_register_operand" "=wa") - (vec_select:V8HI - (match_operand:V8HI 1 "vsx_register_operand" "wa") - (parallel [(const_int 4) (const_int 5) - (const_int 6) (const_int 7) - (const_int 0) (const_int 1) - (const_int 2) (const_int 3)])))] - "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (V8HImode)" - "xxpermdi %x0,%x1,%x1,2" - [(set_attr "type" "vecperm")]) - -(define_insn "*vsx_xxpermdi16_le_V16QI" - [(set (match_operand:V16QI 0 "vsx_register_operand" "=wa") - (vec_select:V16QI - (match_operand:V16QI 1 "vsx_register_operand" "wa") - (parallel [(const_int 8) (const_int 9) - (const_int 10) (const_int 11) - (const_int 12) (const_int 13) - (const_int 14) (const_int 15) - (const_int 0) (const_int 1) - (const_int 2) (const_int 3) - (const_int 4) (const_int 5) - (const_int 6) (const_int 7)])))] - "!BYTES_BIG_ENDIAN && VECTOR_MEM_VSX_P (V16QImode)" - "xxpermdi %x0,%x1,%x1,2" - [(set_attr "type" "vecperm")]) + (vec_select:V8HI + (match_operand:V8HI 1 "vsx_register_operand" "wa") + (parallel [(const_int 4) (const_int 5) + (const_int 6) (const_int 7) + (const_int 0) (const_int 1) + (const_int 2) (const_int 3)])))] + "TARGET_VSX" +;; AIX does not support the extended mnemonic xxswapd. Use the basic +;; mnemonic xxpermdi instead. + "xxpermdi %x0,%x1,%x1,2" + [(set_attr "type" "vecperm")]) + +(define_insn "xxswapd_" + [(set (match_operand:VSX_W 0 "vsx_register_operand" "=wa") + (vec_select:VSX_W + (match_operand:VSX_W 1 "vsx_register_operand" "wa") + (parallel [(const_int 2) (const_int 3) + (const_int 0) (const_int 1)])))] + "TARGET_VSX" +;; AIX does not support extended mnemonic xxswapd. Use the basic +;; mnemonic xxpermdi instead. + "xxpermdi %x0,%x1,%x1,2" + [(set_attr "type" "vecperm")]) ;; lxvd2x for little endian loads. We need several of ;; these since the form of the PARALLEL differs by mode.