From patchwork Mon Jun 22 10:17:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 1314242 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=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 49r51z4FBJz9sPF for ; Mon, 22 Jun 2020 20:17:26 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8C9293851C04; Mon, 22 Jun 2020 10:17:22 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 3DDAA385B834 for ; Mon, 22 Jun 2020 10:17:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3DDAA385B834 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Andrew_Stubbs@mentor.com IronPort-SDR: 2UeaoALofA6bzkEGQp1qGHetLmE0B6bUEi0LVD7xvFdOMP2b/GjcGiwfbvg07XMOOHItvYl27J y/7bnE4K3QBwPrlcOEkdtHOBqjlvBwx7iwcQJZ7NCWvdAhq5CFomn+biKWwJyosMrco3IYKmNU P4MXAZzrF+x+x50nwB5jxP/qsX/xe2BctSt8YeoYZKyXGQ9LT4SKAaNTWf0yCuyK64p/KgAYS7 c0aLIcfHzoBDmPphVjXDJd4YxyMSA75Dd3HAAcauVLJAlT2wWq2xU4nQHcObvjYllAWAEgg4kc l24= X-IronPort-AV: E=Sophos;i="5.75,266,1589270400"; d="scan'208";a="50167121" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 22 Jun 2020 02:17:06 -0800 IronPort-SDR: hZlgSmetJTkLyPK94nr1PQaOwF50zldMWjNEzglFpKdBiRQLG/7h2+4rSNE/hzAisraOZ00P61 fLPaFYhM523LOizovaaykm50LCRqetqZ+17Z7SBIxiaPRlJQJKXtS9duwYGPRZLXh2JQ9QoY+k baqbHMgsN9FLyczPe3nHm94A9wdgXsw0MHdt0zumPEnc1euEpQn9vjydmkOh5jJnjFrQgRLnY0 BAS1+A9PkCJx6iq8qPaqz65XrQfahMX/12XclR18iXbJPqUnIy38yCUVMgm+5VdOKiNNqAyqzf in8= From: Andrew Stubbs Subject: [committed] amdgcn: Pass vector parameters in memory To: "gcc-patches@gcc.gnu.org" Message-ID: <28751de5-1e10-2e2f-88b3-60fa39f3f419@codesourcery.com> Date: Mon, 22 Jun 2020 11:17:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 Content-Language: en-GB X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, 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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" This patch ensures that programs using vector extensions to pass vectors to functions pass the vectors in memory. Even though we could technically do this in registers, the ABI would have to be reworked to do so, and there's no call for that yet (maybe if we want vector libgcc/libm). This change doesn't have any observable affect on the testsuite, just yet, but when I add smaller vector sizes (still a work-in-progress) then the testcase failures become apparent. Andrew amdgcn: Pass vector parameters in memory gcc/ChangeLog: * config/gcn/gcn.c (gcn_function_arg): Disallow vector arguments. (gcn_return_in_memory): Return vectors in memory. diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c index b6ff0bbc2af..5693b75b672 100644 --- a/gcc/config/gcn/gcn.c +++ b/gcc/config/gcn/gcn.c @@ -2291,6 +2291,10 @@ gcn_function_arg (cumulative_args_t cum_v, const function_arg_info &arg) if (targetm.calls.must_pass_in_stack (arg)) return 0; + /* Vector parameters are not supported yet. */ + if (VECTOR_MODE_P (arg.mode)) + return 0; + int reg_num = FIRST_PARM_REG + cum->num; int num_regs = num_arg_regs (arg); if (num_regs > 0) @@ -2478,6 +2482,10 @@ gcn_return_in_memory (const_tree type, const_tree ARG_UNUSED (fntype)) if (AGGREGATE_TYPE_P (type)) return true; + /* Vector return values are not supported yet. */ + if (VECTOR_TYPE_P (type)) + return true; + if (mode == BLKmode) return true;