From patchwork Mon Jun 29 06:32:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 1318812 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=InSDIpY2; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49wN7m6ZrSz9sQx for ; Mon, 29 Jun 2020 19:52:20 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5DAB9388F04A; Mon, 29 Jun 2020 09:52:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5DAB9388F04A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593424338; bh=NqsYWnQPIY7nuUbBgN/OiFFcHOWwYxhha/K43sqF9dA=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=InSDIpY2tz8mSrABVQaczNYIUBC5YTk0p4vtJ2GWxwo0bCrnDK1U6G2T/KMZDuKwO FbV6mdFXuU4me7sJSxcGHN1A3q5zKdQ5E/kqGN6BvLxz5cT4lOBIyc3+gCkwb67lgC 6o0A/xUBHVCglKXfhyaW2MWE4ggCXQZ32sgTwUYA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 9E332383E825 for ; Mon, 29 Jun 2020 09:52:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9E332383E825 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:12480) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jpnQY-0004YX-4W for gcc-patches@gcc.gnu.org; Mon, 29 Jun 2020 02:38:03 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05T61g7X027220; Mon, 29 Jun 2020 02:32:57 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 31x7sk0mwu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jun 2020 02:32:57 -0400 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 05T6Qx4M128729; Mon, 29 Jun 2020 02:32:56 -0400 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 31x7sk0mvt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jun 2020 02:32:56 -0400 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 05T6QbLJ008078; Mon, 29 Jun 2020 06:32:53 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma03fra.de.ibm.com with ESMTP id 31wwr88wm9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jun 2020 06:32:53 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 05T6VVHd59310432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Jun 2020 06:31:31 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C8DF611C04C; Mon, 29 Jun 2020 06:32:50 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AB5A111C050; Mon, 29 Jun 2020 06:32:48 +0000 (GMT) Received: from KewenLins-MacBook-Pro.local (unknown [9.197.251.97]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 29 Jun 2020 06:32:48 +0000 (GMT) Subject: [PATCH 2/7 v5] rs6000: lenload/lenstore optab support To: GCC Patches References: <30906c0d-3b9f-e1e6-156f-c01fcf229cb9@linux.ibm.com> <1dd73439-6bd8-9cc4-3233-50b681a2f494@linux.ibm.com> <66b3b9aa-726c-461c-45df-93fffd69f16f@linux.ibm.com> <6aef86b0-8c48-811a-429b-e8f59bbc6055@linux.ibm.com> <88d2914c-fed8-8b56-1a0a-577c5abf3782@linux.ibm.com> Message-ID: <6cd87a82-afd4-1379-666e-0dcc08264b4e@linux.ibm.com> Date: Mon, 29 Jun 2020 14:32:47 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <88d2914c-fed8-8b56-1a0a-577c5abf3782@linux.ibm.com> Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-29_04:2020-06-26, 2020-06-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 cotscore=-2147483648 lowpriorityscore=0 phishscore=0 clxscore=1015 bulkscore=0 priorityscore=1501 suspectscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006290039 Received-SPF: pass client-ip=148.163.156.1; envelope-from=linkw@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/29 02:26:21 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Kewen.Lin via Gcc-patches" From: "Kewen.Lin" Reply-To: "Kewen.Lin" Cc: Bill Schmidt , Segher Boessenkool , dje.gcc@gmail.com Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, V5: Like V4. V4: Update define_expand names as optab name changes. V3: Update the define_expand as optab changes. BR, Kewen ------ gcc/ChangeLog: 2020-MM-DD Kewen Lin * config/rs6000/vsx.md (len_load_v16qi): New define_expand. (len_store_v16qi): Likewise. diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md index 2a28215ac5b..fe85f60c681 100644 --- a/gcc/config/rs6000/vsx.md +++ b/gcc/config/rs6000/vsx.md @@ -5082,6 +5082,34 @@ (define_expand "stxvl" operands[3] = gen_reg_rtx (DImode); }) +;; Define optab for vector access with length vectorization exploitation. +(define_expand "len_load_v16qi" + [(match_operand:V16QI 0 "vlogical_operand") + (match_operand:V16QI 1 "memory_operand") + (match_operand:QI 2 "gpc_reg_operand")] + "TARGET_P9_VECTOR && TARGET_64BIT" +{ + rtx mem = XEXP (operands[1], 0); + mem = force_reg (DImode, mem); + rtx len = gen_lowpart (DImode, operands[2]); + emit_insn (gen_lxvl (operands[0], mem, len)); + DONE; +}) + +(define_expand "len_store_v16qi" + [(match_operand:V16QI 0 "memory_operand") + (match_operand:V16QI 1 "vlogical_operand") + (match_operand:QI 2 "gpc_reg_operand") + ] + "TARGET_P9_VECTOR && TARGET_64BIT" +{ + rtx mem = XEXP (operands[0], 0); + mem = force_reg (DImode, mem); + rtx len = gen_lowpart (DImode, operands[2]); + emit_insn (gen_stxvl (operands[1], mem, len)); + DONE; +}) + (define_insn "*stxvl" [(set (mem:V16QI (match_operand:DI 1 "gpc_reg_operand" "b")) (unspec:V16QI