From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75600 invoked by alias); 26 Oct 2017 11:57:43 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 75577 invoked by uid 89); 26 Oct 2017 11:57:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=inbound, bah X-HELO: mail-wm0-f47.google.com Received: from mail-wm0-f47.google.com (HELO mail-wm0-f47.google.com) (74.125.82.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Oct 2017 11:57:41 +0000 Received: by mail-wm0-f47.google.com with SMTP id 196so19105362wma.1 for ; Thu, 26 Oct 2017 04:57:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Phibrcr4DHa0CkQ7lOSS7efa0VeCaJyhQ5+o63cQyrc=; b=Bt0EAmyG1ujLnt8ZZpi/UdCw7wzYgVKrY6r00tNOF3xAGO2WkXjLudG7iruyD5VQZ0 YnRxDfkqxDJjW8h9GKav1vud4o0OhPme6Fiy5okG/5ufcn8B3eZrpN+mAZQK0+BPV+oV rMb7YhDx1Iw+8aH3HrCzKWYzyo44sJl3leAGMFugAmn5EXxveLcbZI+lb/v56T21uqDw g6NNdG4y16tRdyQqoZPY0jVCM2eJrO4QIJS8lbDmmog96N0++2Lj7r/PQXRDSCsDvjiz KmsjnT8iPgJZm/SPDY0oiXj3OoabM782Yo9b86nflnAjysej24w8ESfJ4Jz+jV8NnwtT G8YA== X-Gm-Message-State: AMCzsaWoAWp+W15rPS47yerdKgosQeXzPwHqdM8Oj0j/UI3Tq16YMaJu JAbSAQ//KDXsLEK34z/bC/DajxnUg3IvfSvsVdYQxg== X-Google-Smtp-Source: ABhQp+SDN71jkF7G9RW6Bf0bA4c05KfHvi/NnlbPDlJLKfNEctV6JpGkoYvg4+yGMq5/bDXhQFelZgjCOYxqd4PNYIs= X-Received: by 10.80.194.217 with SMTP id u25mr27435457edf.260.1509019058934; Thu, 26 Oct 2017 04:57:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.143.34 with HTTP; Thu, 26 Oct 2017 04:57:38 -0700 (PDT) In-Reply-To: <87tvyqw1ki.fsf@linaro.org> References: <87wp3mxgir.fsf@linaro.org> <87tvyqw1ki.fsf@linaro.org> From: Richard Biener Date: Thu, 26 Oct 2017 11:59:00 -0000 Message-ID: Subject: Re: [09/nn] Add a fixed_size_mode_pod class To: GCC Patches , Richard Sandiford Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg01916.txt.bz2 On Mon, Oct 23, 2017 at 1:22 PM, Richard Sandiford wrote: > 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. Bah - can we update our host compiler to C++11/14 please ...? (maybe requiring that build with GCC 4.8 as host compiler works, GCC 4.3 has -std=c++0x, but I'm quite sure that's not enough). Ok. Thanks, Richard. > > 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; >