From patchwork Thu Jul 11 12:11:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 1130776 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-504922-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="Tp8+AyWI"; 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 45kw0f1FPXz9sNF for ; Thu, 11 Jul 2019 22:12:16 +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:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=onTFVRbz7jSUqUSLc stwHBQ7nQg2Mua6gBFmAQEx6DxSG93y3BvWX9C02lUlVUTADNR0JyV91znOOR/kn Els9JJRDtLvNTQOKWA0E+e0D89TdZMnUFCpSUS4+pLgyb6PDcEHgbg+BA/6ua7d/ pkVt7Kjeu2UWy1evtb4ShTTZRk= 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:references:mime-version :content-type:in-reply-to; s=default; bh=VomTF7cpA6/LFWAfqFdVM2L gN6E=; b=Tp8+AyWIZQIo5o5AuBUUEWhtcviDwkbxJBwefVvNfkhfhoUcQbrwrwg QgIEVb0Tl4X3fq2yvbEZ1A+pp3CDKL5fxBEQL3lGQr1PacgtsbpJVpCx5MxxgYKq wAc4/JbFI9NmQcse7JEld2jXlwN88k3WPo2pTgiHabyiAYEkNOHk= Received: (qmail 31945 invoked by alias); 11 Jul 2019 12:12:01 -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 31936 invoked by uid 89); 11 Jul 2019 12:12:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=irregularities 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, 11 Jul 2019 12:12:00 +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 x6BC36lB096273; Thu, 11 Jul 2019 08:11:56 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2tp2nkx6gq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2019 08:11:56 -0400 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x6BC3DTn096803; Thu, 11 Jul 2019 08:11:56 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 2tp2nkx6ga-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2019 08:11:56 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x6BBxtp6025084; Thu, 11 Jul 2019 12:11:55 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma03dal.us.ibm.com with ESMTP id 2tjk973yxv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Jul 2019 12:11:55 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x6BCBshD52953570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Jul 2019 12:11:54 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5BB80124060; Thu, 11 Jul 2019 12:11:54 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 277C3124052; Thu, 11 Jul 2019 12:11:54 +0000 (GMT) Received: from ibm-toto.the-meissners.org (unknown [9.32.77.177]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTPS; Thu, 11 Jul 2019 12:11:54 +0000 (GMT) Date: Thu, 11 Jul 2019 08:11:52 -0400 From: Michael Meissner To: Michael Meissner Cc: gcc-patches@gcc.gnu.org, segher@kernel.crashing.org, dje.gcc@gmail.com Subject: [PATCH], PowerPC, Patch #8, rename rs6000_prefixed_address Message-ID: <20190711121152.GA12708@ibm-toto.the-meissners.org> Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, segher@kernel.crashing.org, dje.gcc@gmail.com References: <20190628000602.GA24286@ibm-toto.the-meissners.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190628000602.GA24286@ibm-toto.the-meissners.org> User-Agent: Mutt/1.5.21 (2010-09-15) In a future patch, I plan to introduce a new function that says whether an address is prefixed based on the address format (D-form, DS-form, DQ-form) used by the instruction. I plan on naming the new function: rs6000_prefixed_address_format This means the existing function that takes a mode argument will be renamed to: rs6000_prefixed_address_mode Rs6000_prefixed_address_mode will have a table mapping the mode into the expected address format, and then call rs6000_prefixed_address_format. This is due to the number of irregularities in the PowerPC architecture: LWA is DS-form, but LWZ is D-form LFD is D-form, LXSD is DS-form In the tests that will occur after register allocation, we can check the register type, and more accurately determine if a prefixed instruction must be used if the offset is odd (for DS-form) or the offset is not aligned on a 16-byte boundary (for DQ-form). This patch prepares the way by renaming the current function, and changing its one use. I have bootstrapped a compiler on a little endian power8 and there were no regressions in the test suite. Can I check this patch into the trunk? 2019-07-10 Michael Meissner * config/rs6000/predicates.md (prefixed_mem_operand): Call rs6000_prefixed_address_mode instead of rs6000_prefixed_address. * config/rs6000/rs6000-protos.h (rs6000_prefixed_address_mode): Rename fucntion from rs6000_prefixed_address. * config/rs6000/rs6000.c (rs6000_prefixed_address_mode): Rename fucntion from rs6000_prefixed_address. Index: gcc/config/rs6000/predicates.md =================================================================== --- gcc/config/rs6000/predicates.md (revision 273368) +++ gcc/config/rs6000/predicates.md (working copy) @@ -1686,7 +1686,7 @@ (define_predicate "pcrel_external_addres (define_predicate "prefixed_mem_operand" (match_code "mem") { - return rs6000_prefixed_address (XEXP (op, 0), GET_MODE (op)); + return rs6000_prefixed_address_mode (XEXP (op, 0), GET_MODE (op)); }) ;; Return 1 if op is a memory operand to an external variable when we Index: gcc/config/rs6000/rs6000-protos.h =================================================================== --- gcc/config/rs6000/rs6000-protos.h (revision 273367) +++ gcc/config/rs6000/rs6000-protos.h (working copy) @@ -154,7 +154,7 @@ extern align_flags rs6000_loop_align (rt extern void rs6000_split_logical (rtx [], enum rtx_code, bool, bool, bool); extern bool rs6000_pcrel_p (struct function *); extern bool rs6000_fndecl_pcrel_p (const_tree); -extern bool rs6000_prefixed_address (rtx, machine_mode); +extern bool rs6000_prefixed_address_mode (rtx, machine_mode); #endif /* RTX_CODE */ #ifdef TREE_CODE Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 273368) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -21514,7 +21514,7 @@ mode_supports_prefixed_address_p (machin mode MODE. */ bool -rs6000_prefixed_address (rtx addr, machine_mode mode) +rs6000_prefixed_address_mode (rtx addr, machine_mode mode) { if (!TARGET_PREFIXED_ADDR || !mode_supports_prefixed_address_p (mode)) return false;