public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>,
		Richard Sandiford <richard.sandiford@linaro.org>
Subject: Re: [09/nn] Add a fixed_size_mode_pod class
Date: Thu, 26 Oct 2017 11:59:00 -0000	[thread overview]
Message-ID: <CAFiYyc2HVnJSurbSk=_4hwmg__hdkq_7EQfk1PFwP8AtFxv3Gg@mail.gmail.com> (raw)
In-Reply-To: <87tvyqw1ki.fsf@linaro.org>

On Mon, Oct 23, 2017 at 1:22 PM, Richard Sandiford
<richard.sandiford@linaro.org> 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  <richard.sandiford@linaro.org>
>             Alan Hayward  <alan.hayward@arm.com>
>             David Sherwood  <david.sherwood@arm.com>
>
> 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<typename> class opt_mode;
>  typedef opt_mode<scalar_mode> opt_scalar_mode;
>  typedef opt_mode<scalar_int_mode> opt_scalar_int_mode;
> @@ -66,6 +67,7 @@ typedef opt_mode<scalar_float_mode> opt_
>  template<typename> class pod_mode;
>  typedef pod_mode<scalar_mode> scalar_mode_pod;
>  typedef pod_mode<scalar_int_mode> scalar_int_mode_pod;
> +typedef pod_mode<fixed_size_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 <fixed_size_mode> (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 <fixed_size_mode> (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;
>

  reply	other threads:[~2017-10-26 11:57 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23 11:16 [00/nn] Patches preparing for runtime offsets and sizes Richard Sandiford
2017-10-23 11:17 ` [01/nn] Add gen_(const_)vec_duplicate helpers Richard Sandiford
2017-10-25 16:29   ` Jeff Law
2017-10-27 16:12     ` Richard Sandiford
2017-10-23 11:19 ` [03/nn] Allow vector CONSTs Richard Sandiford
2017-10-25 16:59   ` Jeff Law
2017-10-27 16:19     ` Richard Sandiford
2017-10-23 11:19 ` [02/nn] Add more vec_duplicate simplifications Richard Sandiford
2017-10-25 16:35   ` Jeff Law
2017-11-10  9:42     ` Christophe Lyon
2017-10-23 11:20 ` [04/nn] Add a VEC_SERIES rtl code Richard Sandiford
2017-10-26 11:49   ` Richard Biener
2017-10-23 11:21 ` [05/nn] Add VEC_DUPLICATE_{CST,EXPR} and associated optab Richard Sandiford
2017-10-26 11:53   ` Richard Biener
2017-11-06 15:09     ` Richard Sandiford
2017-11-07 10:37       ` Richard Biener
2017-12-15  0:29   ` Richard Sandiford
2017-12-15  8:58     ` Richard Biener
2017-12-15 12:52       ` Richard Sandiford
2017-12-15 13:20         ` Richard Biener
2017-10-23 11:22 ` [06/nn] Add VEC_SERIES_{CST,EXPR} " Richard Sandiford
2017-10-26 12:26   ` Richard Biener
2017-10-26 12:43     ` Richard Biener
2017-11-06 15:21       ` Richard Sandiford
2017-11-07 10:38         ` Richard Biener
2017-12-15  0:34   ` Richard Sandiford
2017-12-15  9:03     ` Richard Biener
2017-10-23 11:22 ` [07/nn] Add unique CONSTs Richard Sandiford
2017-10-27 15:51   ` Jeff Law
2017-10-27 15:58     ` Richard Sandiford
2017-10-30 14:49       ` Jeff Law
2017-10-23 11:22 ` [08/nn] Add a fixed_size_mode class Richard Sandiford
2017-10-26 11:57   ` Richard Biener
2017-10-23 11:23 ` [09/nn] Add a fixed_size_mode_pod class Richard Sandiford
2017-10-26 11:59   ` Richard Biener [this message]
2017-10-26 12:18     ` Richard Sandiford
2017-10-26 12:46       ` Richard Biener
2017-10-26 19:42         ` Eric Botcazou
2017-10-27  8:34           ` Richard Biener
2017-10-27  9:28             ` Eric Botcazou
2017-10-30  3:14           ` Trevor Saunders
2017-10-30  8:52             ` Richard Sandiford
2017-10-30 10:13             ` Eric Botcazou
2017-10-31 10:39               ` Trevor Saunders
2017-10-31 17:29                 ` Eric Botcazou
2017-10-31 17:57                   ` Jeff Law
2017-11-01  2:50                     ` Trevor Saunders
2017-11-01 16:30                       ` Jeff Law
2017-11-02  4:28                         ` Trevor Saunders
2017-10-26 19:44         ` Richard Sandiford
2017-10-26 19:45         ` Jakub Jelinek
2017-10-27  8:43           ` Richard Biener
2017-10-27  8:45             ` Jakub Jelinek
2017-10-27 10:19             ` Pedro Alves
2017-10-27 15:23             ` Jeff Law
2017-10-23 11:24 ` [10/nn] Widening optab cleanup Richard Sandiford
2017-10-30 18:32   ` Jeff Law
2017-10-23 11:24 ` [11/nn] Add narrower_subreg_mode helper function Richard Sandiford
2017-10-30 15:06   ` Jeff Law
2017-10-23 11:25 ` [13/nn] More is_a <scalar_int_mode> Richard Sandiford
2017-10-26 12:03   ` Richard Biener
2017-10-23 11:25 ` [12/nn] Add an is_narrower_int_mode helper function Richard Sandiford
2017-10-26 11:59   ` Richard Biener
2017-10-23 11:26 ` [14/nn] Add helpers for shift count modes Richard Sandiford
2017-10-26 12:07   ` Richard Biener
2017-10-26 12:07     ` Richard Biener
2017-11-20 21:04       ` Richard Sandiford
2017-11-21 15:00         ` Richard Biener
2017-12-15  0:48           ` Richard Sandiford
2017-12-15  9:06             ` Richard Biener
2017-12-15 15:17               ` Richard Sandiford
2017-12-19 19:13                 ` Richard Sandiford
2017-12-20  0:27                   ` Jeff Law
2017-10-30 15:03     ` Jeff Law
2017-10-23 11:27 ` [16/nn] Factor out the mode handling in lower-subreg.c Richard Sandiford
2017-10-26 12:09   ` Richard Biener
2017-10-23 11:27 ` [15/nn] Use more specific hash functions in rtlhash.c Richard Sandiford
2017-10-26 12:08   ` Richard Biener
2017-10-23 11:28 ` [17/nn] Turn var-tracking.c:INT_MEM_OFFSET into a function Richard Sandiford
2017-10-26 12:10   ` Richard Biener
2017-10-23 11:29 ` [18/nn] Use (CONST_VECTOR|GET_MODE)_NUNITS in simplify-rtx.c Richard Sandiford
2017-10-26 12:13   ` Richard Biener
2017-10-23 11:29 ` [19/nn] Don't treat zero-sized ranges as overlapping Richard Sandiford
2017-10-26 12:14   ` Richard Biener
2017-10-23 11:30 ` [20/nn] Make tree-ssa-dse.c:normalize_ref return a bool Richard Sandiford
2017-10-30 17:49   ` Jeff Law
2017-10-23 11:31 ` [21/nn] Minor vn_reference_lookup_3 tweak Richard Sandiford
2017-10-26 12:18   ` Richard Biener
2017-10-23 11:45 ` [22/nn] Make dse.c use offset/width instead of start/end Richard Sandiford
2017-10-26 12:18   ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFiYyc2HVnJSurbSk=_4hwmg__hdkq_7EQfk1PFwP8AtFxv3Gg@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).