From patchwork Mon Oct 23 11:22:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 116695 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4528318qgn; Mon, 23 Oct 2017 04:23:17 -0700 (PDT) X-Received: by 10.98.194.193 with SMTP id w62mr12523790pfk.67.1508757797449; Mon, 23 Oct 2017 04:23:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508757797; cv=none; d=google.com; s=arc-20160816; b=awhgr7Z3+P6Ik25llhB3LEQAdxedwWYeKGESk6I5ft2x/zXhxiwktDisJ8xnD9uFtI bKtJOLRRjmoO4RrsiWMy264gjlXcizXXdJNw+vmPkf0ROVZ/KVdY3gGivM+fZ1daHGkm tFe8ZvkWBCdIh6cIfEK8+uzzOYpWh1Gjt+6+0af/OPQYNZFxLYpICNOmw/Rh2v2Eoa7R a3mszJTlPY1KrSeupZzMdaWsqOGRUh4JkCmVSIEAWDJn6rTRhq/M4Gya/TKBd9m1INZF wGpcwBNFhAURVF3r+P7mYz/5nmH48wiGjfjRiSsEtCYUq6foi6BfuvIZCitq7lZLRfln beCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:mail-followup-to:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=mO5FMTdurxoYpXrWCxZUt87qx7E4Y+WGzQoc3uA6X7Q=; b=jtbHlYr8gUgZZk2gmi/l2iDHU9xVOb1zIXC69//XRELZWGbw+D2BclqAH/kYEnuYA6 PGJmeVAjj4CC/2GknLlLhwfcEJ/hxUBaNNvwauteIGADlPr0b4gDWm9Wy/fDXC1tdMwh ROGOipAFLi1eFt5rLEhF/il02IQfLD4HRYFd/R907y/STRkOTrYROEobjYyjGMyTjEaY AlY7VcH4QDDejOXA77mhgBdZowozlfkM4O+BIeBa+SJtIH4XVk4jje5HA6uWcAGOd899 XwaVc8Dh3Fz0Fdn+715MBlcdvAg3t9I6FIdSGRo1neTfIYrzCUQjGXOgjb9VlqliG00W CT8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=lpJmGdJA; spf=pass (google.com: domain of gcc-patches-return-464736-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464736-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id q13si3447165pgr.170.2017.10.23.04.23.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 04:23:17 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-464736-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=lpJmGdJA; spf=pass (google.com: domain of gcc-patches-return-464736-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464736-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=D6+Vm+8VxaBYWG+Pb19i2M4d5gCoy FkKOl9NH6K6z424KVpsM5ycsgerKlpkwYjhFIRUc8Jsofa3wD7Y9zfCp4jDvecDa XuSuElh5zgCXsDJJIq3HRjO3Iwl9HKwySoEnORa5JQOgpB792+ecEPs/Vl8h9cMR T6IPPF2mU7ZXzQ= 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:from :to:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=RPwCArsASFz6DTjy5ODFszKGhbk=; b=lpJ mGdJA1LxfZuy00b9z+w7/0Z9A4xoerrkP0YRO7So4enoolxf3U3jjfEpbYGLXvlk ZdUy3X9WkaE9Z6NzF45+c7R5AmkGqH0IAHKSmV3qXp/53LCxD8DnGihFldW8ZAzy RpWI82MB9Mu9ZGzuwwuAmoRF6AY/QDimucn/Lu6o= Received: (qmail 59870 invoked by alias); 23 Oct 2017 11:23: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 59811 invoked by uid 89); 23 Oct 2017 11:23:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=outbound, inbound, POD, subclasses X-HELO: mail-wr0-f176.google.com Received: from mail-wr0-f176.google.com (HELO mail-wr0-f176.google.com) (209.85.128.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 11:22:58 +0000 Received: by mail-wr0-f176.google.com with SMTP id y39so16983550wrd.4 for ; Mon, 23 Oct 2017 04:22:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=mO5FMTdurxoYpXrWCxZUt87qx7E4Y+WGzQoc3uA6X7Q=; b=GRIDIr6rdN5Q28eCJxskZadK/OAK3Kt7fVH1jyltaDcV1yCwuymjUnWS4d8ha+B3t3 0qKq24ZTK/tE0W7V6CWiW4/PyOMRPzUMxoEgO8wAHI/GNYkocY1LlzJtvUsoua6aTcxk hX8ShstJ1GNPIaSrkGb5sbi62fSGN6h6T8LGYAK/KpeN3NvBhy0I1bXUQWeUBq+6o6jD AGpiWCL4gZfVGlcU3GvvPNsw+DWmyDlWc8uBOgWZFGCG7Cj7D8L634aBU/x6cUS+hAEY 4UjP9Tzn61L/2dIF/y14FogTysqd8aVrx1DxvL0rZiQg4GGIn4AD0QWnmjekBVRXTI13 Gnow== X-Gm-Message-State: AMCzsaWYbQe63F/zZ11PB3Mg0zjMeW9DnnEsB99SGLKq0Lazz4DrDLxy +gSK+hYF5qed1tfV1/2+7f3CIqX5lmo= X-Google-Smtp-Source: ABhQp+QwuG/2NZ/YBebj08Lekb5B/62cWWGAMtUSWiJ4DsE4ZCu21gxln/X5KWeYvOfUeV3MnQ6SgQ== X-Received: by 10.223.171.241 with SMTP id s104mr11644721wrc.256.1508757776268; Mon, 23 Oct 2017 04:22:56 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id 64sm5851900wrk.46.2017.10.23.04.22.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 04:22:55 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [09/nn] Add a fixed_size_mode_pod class References: <87wp3mxgir.fsf@linaro.org> Date: Mon, 23 Oct 2017 12:22:53 +0100 In-Reply-To: <87wp3mxgir.fsf@linaro.org> (Richard Sandiford's message of "Mon, 23 Oct 2017 12:14:36 +0100") Message-ID: <87tvyqw1ki.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch adds a POD version of fixed_size_mode. The only current use is for storing the __builtin_apply and __builtin_result register modes, which were made fixed_size_modes by the previous patch. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * coretypes.h (fixed_size_mode): Declare. (fixed_size_mode_pod): New typedef. * builtins.h (target_builtins::x_apply_args_mode) (target_builtins::x_apply_result_mode): Change type to fixed_size_mode_pod. * builtins.c (apply_args_size, apply_result_size, result_vector) (expand_builtin_apply_args_1, expand_builtin_apply) (expand_builtin_return): Update accordingly. Index: gcc/coretypes.h =================================================================== --- gcc/coretypes.h 2017-09-11 17:10:58.656085547 +0100 +++ gcc/coretypes.h 2017-10-23 11:42:57.592545063 +0100 @@ -59,6 +59,7 @@ typedef const struct rtx_def *const_rtx; class scalar_int_mode; class scalar_float_mode; class complex_mode; +class fixed_size_mode; template class opt_mode; typedef opt_mode opt_scalar_mode; typedef opt_mode opt_scalar_int_mode; @@ -66,6 +67,7 @@ typedef opt_mode opt_ template class pod_mode; typedef pod_mode scalar_mode_pod; typedef pod_mode scalar_int_mode_pod; +typedef pod_mode fixed_size_mode_pod; /* Subclasses of rtx_def, using indentation to show the class hierarchy, along with the relevant invariant. Index: gcc/builtins.h =================================================================== --- gcc/builtins.h 2017-08-30 12:18:46.602740973 +0100 +++ gcc/builtins.h 2017-10-23 11:42:57.592545063 +0100 @@ -29,14 +29,14 @@ struct target_builtins { the register is not used for calling a function. If the machine has register windows, this gives only the outbound registers. INCOMING_REGNO gives the corresponding inbound register. */ - machine_mode x_apply_args_mode[FIRST_PSEUDO_REGISTER]; + fixed_size_mode_pod x_apply_args_mode[FIRST_PSEUDO_REGISTER]; /* For each register that may be used for returning values, this gives a mode used to copy the register's value. VOIDmode indicates the register is not used for returning values. If the machine has register windows, this gives only the outbound registers. INCOMING_REGNO gives the corresponding inbound register. */ - machine_mode x_apply_result_mode[FIRST_PSEUDO_REGISTER]; + fixed_size_mode_pod x_apply_result_mode[FIRST_PSEUDO_REGISTER]; }; extern struct target_builtins default_target_builtins; Index: gcc/builtins.c =================================================================== --- gcc/builtins.c 2017-10-23 11:41:23.140260335 +0100 +++ gcc/builtins.c 2017-10-23 11:42:57.592545063 +0100 @@ -1358,7 +1358,6 @@ apply_args_size (void) static int size = -1; int align; unsigned int regno; - machine_mode mode; /* The values computed by this function never change. */ if (size < 0) @@ -1374,7 +1373,7 @@ apply_args_size (void) for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) if (FUNCTION_ARG_REGNO_P (regno)) { - mode = targetm.calls.get_raw_arg_mode (regno); + fixed_size_mode mode = targetm.calls.get_raw_arg_mode (regno); gcc_assert (mode != VOIDmode); @@ -1386,7 +1385,7 @@ apply_args_size (void) } else { - apply_args_mode[regno] = VOIDmode; + apply_args_mode[regno] = as_a (VOIDmode); } } return size; @@ -1400,7 +1399,6 @@ apply_result_size (void) { static int size = -1; int align, regno; - machine_mode mode; /* The values computed by this function never change. */ if (size < 0) @@ -1410,7 +1408,7 @@ apply_result_size (void) for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) if (targetm.calls.function_value_regno_p (regno)) { - mode = targetm.calls.get_raw_result_mode (regno); + fixed_size_mode mode = targetm.calls.get_raw_result_mode (regno); gcc_assert (mode != VOIDmode); @@ -1421,7 +1419,7 @@ apply_result_size (void) apply_result_mode[regno] = mode; } else - apply_result_mode[regno] = VOIDmode; + apply_result_mode[regno] = as_a (VOIDmode); /* Allow targets that use untyped_call and untyped_return to override the size so that machine-specific information can be stored here. */ @@ -1440,7 +1438,7 @@ apply_result_size (void) result_vector (int savep, rtx result) { int regno, size, align, nelts; - machine_mode mode; + fixed_size_mode mode; rtx reg, mem; rtx *savevec = XALLOCAVEC (rtx, FIRST_PSEUDO_REGISTER); @@ -1469,7 +1467,7 @@ expand_builtin_apply_args_1 (void) { rtx registers, tem; int size, align, regno; - machine_mode mode; + fixed_size_mode mode; rtx struct_incoming_value = targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 1); /* Create a block where the arg-pointer, structure value address, @@ -1573,7 +1571,7 @@ expand_builtin_apply_args (void) expand_builtin_apply (rtx function, rtx arguments, rtx argsize) { int size, align, regno; - machine_mode mode; + fixed_size_mode mode; rtx incoming_args, result, reg, dest, src; rtx_call_insn *call_insn; rtx old_stack_level = 0; @@ -1734,7 +1732,7 @@ expand_builtin_apply (rtx function, rtx expand_builtin_return (rtx result) { int size, align, regno; - machine_mode mode; + fixed_size_mode mode; rtx reg; rtx_insn *call_fusage = 0;