From patchwork Mon Nov 5 17:08:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Sawdey X-Patchwork-Id: 993257 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-489070-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="geCPXgL9"; 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 42pfKQ2blMz9s7T for ; Tue, 6 Nov 2018 04:08:58 +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:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=lvtwh S2Al/1vmb8tTauy2E0tvroGYnfSPIpTffIQ8K4Tke65jO63EAJtEoR45QxA7/1jZ 3fdpFozjzaiz2vxi31Jcgyh5B8pfB1zJsB58IWNbcYsOCDWbF1cah9gHOWgKcegg ii51LtNa11jcgXhbwg7NawXxldcjHkgdTbLobU= 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=xN+463eqboU ZwfuI+3gnRVa3CDU=; b=geCPXgL9eM0kA64UReAdBAI7LkrVnNUyUFmTO6oq2Tv 50uexDEUpi3dupnN1oFNZmVaCeSGFaegBkeKyQ6om6pnKCNR94Phyw1IwKWeSafW jMb6Hk78I9Emqx0GLGRTo7T7wmLJrIAgi0IjKFeUp8kUbS800S4hxUJRgzCLqhjo = Received: (qmail 38392 invoked by alias); 5 Nov 2018 17:08:50 -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 38369 invoked by uid 89); 5 Nov 2018 17:08:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.9 required=5.0 tests=BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KHOP_DYNAMIC, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=H*u:Intel, H*UA:Intel, memory_operand 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; Mon, 05 Nov 2018 17:08:47 +0000 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wA5GxSMu095079 for ; Mon, 5 Nov 2018 12:08:44 -0500 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0b-001b2d01.pphosted.com with ESMTP id 2njsd8suun-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 05 Nov 2018 12:08:44 -0500 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 5 Nov 2018 17:08:43 -0000 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 5 Nov 2018 17:08:41 -0000 Received: from b03ledav005.gho.boulder.ibm.com (b03ledav005.gho.boulder.ibm.com [9.17.130.236]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wA5H8eNH13697092 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 5 Nov 2018 17:08:40 GMT Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C6ABDBE054; Mon, 5 Nov 2018 17:08:40 +0000 (GMT) Received: from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 15584BE04F; Mon, 5 Nov 2018 17:08:39 +0000 (GMT) Received: from ragesh4.local (unknown [9.85.208.152]) by b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 5 Nov 2018 17:08:39 +0000 (GMT) To: GCC Patches Cc: Segher Boessenkool , David Edelsohn , Bill Schmidt From: Aaron Sawdey Subject: [PATCH][rs6000] use index form addresses more often for l[wh]brx/st[wh]brx Date: Mon, 5 Nov 2018 11:08:39 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 x-cbid: 18110517-0012-0000-0000-000016D5077E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009991; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000268; SDB=6.01113092; UDB=6.00576975; IPR=6.00893192; MB=3.00024034; MTD=3.00000008; XFM=3.00000015; UTC=2018-11-05 17:08:42 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18110517-0013-0000-0000-00005502BB42 Message-Id: <52b70835-3faf-c136-9fc3-bcf34f93d196@linux.ibm.com> X-IsSubscribed: yes This does the same thing for bswap2 that I previously did for bswapdi2. The predicates for bswap2_{load,store} are now indexed_or_indirect_operand, and bswap2 uses rs6000_force_indexed_or_indirect_mem to make sure the address is appropriate for that predicate. Bootstrap/regtest passes on ppc64le power8/power9, ok for trunk? Thanks! Aaron 2018-11-05 Aaron Sawdey * config/rs6000/rs6000.md (bswap2): Force address into register if not in indexed or indirect form. (bswap2_load): Change predicate to indexed_or_indirect_operand. (bswap2_store): Ditto. Index: gcc/config/rs6000/rs6000.md =================================================================== --- gcc/config/rs6000/rs6000.md (revision 265753) +++ gcc/config/rs6000/rs6000.md (working copy) @@ -2411,9 +2411,15 @@ src = force_reg (mode, src); if (MEM_P (src)) - emit_insn (gen_bswap2_load (dest, src)); + { + src = rs6000_force_indexed_or_indirect_mem (src); + emit_insn (gen_bswap2_load (dest, src)); + } else if (MEM_P (dest)) - emit_insn (gen_bswap2_store (dest, src)); + { + dest = rs6000_force_indexed_or_indirect_mem (dest); + emit_insn (gen_bswap2_store (dest, src)); + } else emit_insn (gen_bswap2_reg (dest, src)); DONE; @@ -2421,13 +2427,13 @@ (define_insn "bswap2_load" [(set (match_operand:HSI 0 "gpc_reg_operand" "=r") - (bswap:HSI (match_operand:HSI 1 "memory_operand" "Z")))] + (bswap:HSI (match_operand:HSI 1 "indexed_or_indirect_operand" "Z")))] "" "lbrx %0,%y1" [(set_attr "type" "load")]) (define_insn "bswap2_store" - [(set (match_operand:HSI 0 "memory_operand" "=Z") + [(set (match_operand:HSI 0 "indexed_or_indirect_operand" "=Z") (bswap:HSI (match_operand:HSI 1 "gpc_reg_operand" "r")))] "" "stbrx %1,%y0"