public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: "Martin Liška" <mliska@suse.cz>
Cc: Joseph Myers <joseph@codesourcery.com>,
	       Richard Biener <richard.guenther@gmail.com>,
	       Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>,
	       "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>,
	       Thomas Koenig <tkoenig@netcologne.de>,
	Toon Moene <toon@moene.org>,
	       GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: Fortran vector math header
Date: Thu, 24 Jan 2019 15:11:00 -0000	[thread overview]
Message-ID: <20190124150529.GO30353@tucnak> (raw)
In-Reply-To: <ca90113a-99f4-2e43-7ba2-97e8d74daceb@suse.cz>

On Thu, Jan 24, 2019 at 03:57:56PM +0100, Martin Liška wrote:
> --- a/gcc/config/i386/i386.c
> +++ b/gcc/config/i386/i386.c
> @@ -29577,6 +29577,17 @@ ix86_warn_parameter_passing_abi (cumulative_args_t cum_v, tree type)
>    cum->warn_empty = false;
>  }
>  
> +static const char *

Missing function comment.  Usually a copy of the target hook description,
perhaps with arch details.

> +ix86_get_multilib_abi_name (void)
> +{
> +  if (!(TARGET_64BIT_P (ix86_isa_flags)))
> +    return "i386";
> +  else if (TARGET_X32_P (ix86_isa_flags))
> +    return "x32";
> +  else
> +    return "x86_64";
> +}
> +
>  /* Compute the alignment for a variable for Intel MCU psABI.  TYPE is
>     the data type, and ALIGN is the alignment that the object would
>     ordinarily have.  */
> @@ -51804,6 +51815,10 @@ ix86_run_selftests (void)
>  #undef TARGET_WARN_PARAMETER_PASSING_ABI
>  #define TARGET_WARN_PARAMETER_PASSING_ABI ix86_warn_parameter_passing_abi
>  
> +#undef TARGET_GET_MULTILIB_ABI_NAME
> +#define TARGET_GET_MULTILIB_ABI_NAME \
> +ix86_get_multilib_abi_name

All other #define TARGET_* that need to wrap line indent the next line
by two spaces, please do that too.

> -/* Match a !GCC$ builtin (b) attributes simd flags form:
> +/* Match a !GCC$ builtin (b) attributes simd flags if(target) form:
>  
>     The parameter b is name of a middle-end built-in.
> -   Flags are one of:
> -     - (empty)
> +   FLAGS is optional and must be one of:
>       - inbranch
>       - notinbranch

FLAGS must be one of (inbranch) or (notinbranch) actually.

>  match
>  gfc_match_gcc_builtin (void)
>  {
>    char builtin[GFC_MAX_SYMBOL_LEN + 1];
> +  char target[GFC_MAX_SYMBOL_LEN + 1];
>  
>    if (gfc_match (" ( %n ) attributes simd", builtin) != MATCH_YES)
>      return MATCH_ERROR;
> @@ -11361,6 +11365,13 @@ gfc_match_gcc_builtin (void)
>    else if (gfc_match (" ( inbranch ) ") == MATCH_YES)
>      clause = SIMD_INBRANCH;
>  
> +  if (gfc_match (" if ( %n ) ", target) == MATCH_YES)
> +    {
> +      const char *abi = targetm.get_multilib_abi_name ();
> +      if (abi == NULL || strcmp (abi, target) != 0)
> +	return MATCH_YES;
> +    }

Wonder whether we want if (x86_64) or if ('x86_64'), I'd lean for the
latter.

> +
>    if (gfc_vectorized_builtins == NULL)
>      gfc_vectorized_builtins = new hash_map<nofree_string_hash, int> ();
>  
> diff --git a/gcc/target.def b/gcc/target.def
> index 05c9cc1da28..4ba6b167e26 100644
> --- a/gcc/target.def
> +++ b/gcc/target.def
> @@ -5791,6 +5791,12 @@ call_2 may be NULL or a call insn.",
>   rtx_insn *, (rtx_insn *call_1, rtx_insn *call_2),
>   NULL)
>  
> +DEFHOOK
> +(get_multilib_abi_name,
> + "This hook returns name of multilib ABI name.",
> + const char *, (void),
> + NULL)
> +
>  DEFHOOK
>  (remove_extra_call_preserved_regs,
>   "This hook removes registers from the set of call-clobbered registers\n\
> diff --git a/gcc/targhooks.c b/gcc/targhooks.c
> index 529590b55df..a03b967b913 100644
> --- a/gcc/targhooks.c
> +++ b/gcc/targhooks.c
> @@ -2379,4 +2379,10 @@ default_remove_extra_call_preserved_regs (rtx_insn *, HARD_REG_SET *)
>  {
>  }
>  
> +const char *
> +default_get_multilib_abi_name (void)
> +{
> +  return NULL;
> +}

Just use hook_constcharptr_void_null instead of adding yet another hook that
does the same thing?

	Jakub

  reply	other threads:[~2019-01-24 15:05 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <d749cd46-e231-1405-5713-ae7d966ff8c1@suse.cz>
     [not found] ` <CAFiYyc0QyhpvQxam9E3BHn2hPkr1izQM13oo+_QvkhQvwroJqw@mail.gmail.com>
     [not found]   ` <ee42ab7d-12b8-d7d2-1769-1c96252bbd7b@netcologne.de>
     [not found]     ` <CAFiYyc1cHpw-7CEE8-1ipqHKCqpL+sX6dWOCK88iVk0cn2Mm8A@mail.gmail.com>
     [not found]       ` <48dcb864-bad1-5e09-d209-def296ed1cd3@suse.cz>
     [not found]         ` <676acdda-1253-b3bd-4e03-60298c4c995c@netcologne.de>
     [not found]           ` <4f37f79f-647a-4851-2ff2-e0e5592b3e7f@suse.cz>
     [not found]             ` <2082f59c-7c61-6b81-79f7-addf70da39fa@netcologne.de>
     [not found]               ` <CAFiYyc2AFExBnak5YX8-L_STQYxORuwWHnD9ETRMWN3u0gB1gg@mail.gmail.com>
     [not found]                 ` <6b852ddd-001c-40d6-383b-0b36f3d13ee7@suse.cz>
     [not found]                   ` <CAFiYyc2Q4eXBXBSisaWDE2JH_tS82AnZBPJv1D9fkZnAQpz0CA@mail.gmail.com>
     [not found]                     ` <60df9de6-9607-c88a-de0d-1f2c83bf3970@suse.cz>
     [not found]                       ` <D6325C52-AE0D-49DB-86A2-F5CBDE6BAC0B@gmail.com>
     [not found]                         ` <916e3e10-e020-f4f3-6f8e-c57909c81d55@suse.cz>
     [not found]                           ` <CAFiYyc14yjzAojw0o+mJoLvBwobLGhN1ppLKHOt56wan_-ApZw@mail.gmail.com>
     [not found]                             ` <20181112163347.4cc3537e@nbbrfq.loc>
     [not found]                               ` <CAFiYyc1cczXvCf1v4PPhHVmuvT_W8RuU+8R05vjuJ=_c_nP-6w@mail.gmail.com>
2018-11-14 10:06                                 ` [PATCH] Support simd function declarations via a pre-include. (was: [PATCH][RFC]Overloading intrinsics) Martin Liška
2018-11-14 11:35                                   ` Jakub Jelinek
2018-11-14 11:56                                     ` Jakub Jelinek
2018-11-14 11:57                                       ` Jakub Jelinek
2018-11-14 14:09                                     ` [PATCH] Support simd function declarations via a pre-include Martin Liška
2018-11-14 14:14                                       ` Jakub Jelinek
2018-11-15 19:40                                     ` [PATCH] Support simd function declarations via a pre-include. (was: [PATCH][RFC]Overloading intrinsics) Bernhard Reutner-Fischer
2018-11-15 20:54                                       ` Jakub Jelinek
2018-11-16 13:25                                         ` [PATCH] Support simd function declarations via a pre-include Martin Liška
2018-11-16 13:50                                           ` Jakub Jelinek
2018-11-16 15:12                                             ` Martin Liška
2018-11-17 13:30                                               ` Paul Richard Thomas
2018-11-17 17:57                                                 ` Paul Richard Thomas
2018-11-17 18:16                                               ` Bernhard Reutner-Fischer
2018-11-19 12:14                                                 ` Martin Liška
2018-11-19 12:16                                               ` Martin Liška
2018-11-19 12:33                                                 ` Jakub Jelinek
2018-11-20 14:14                                                 ` [PATCH][RFC] Extend locations where to seach for Fortran pre-include Martin Liška
2018-11-20 14:27                                                   ` Jakub Jelinek
2018-11-20 18:11                                                     ` Joseph Myers
2018-11-22  8:58                                                       ` Martin Liška
2018-11-22 14:35                                                         ` Joseph Myers
2018-11-23 13:59                                                           ` Martin Liška
2018-11-23 18:08                                                             ` Joseph Myers
2018-11-26 12:20                                                               ` Martin Liška
2018-11-26 16:19                                                                 ` Matthias Klose
2018-11-26 16:35                                                                   ` Martin Liška
2018-11-26 18:33                                                                     ` Joseph Myers
2018-11-27 13:34                                                                       ` Martin Liška
2018-11-27  7:57                                                                     ` Thomas Koenig
2018-11-27 13:32                                                                       ` Martin Liška
2018-11-27 16:22                                                                     ` Steve Ellcey
2018-11-27 21:12                                                                       ` Thomas Koenig
2019-02-18 13:23                                                                         ` Martin Liška
2019-02-19 18:18                                                                           ` Steve Kargl
2019-02-20  7:09                                                                             ` Bernhard Reutner-Fischer
2019-02-20  9:23                                                                               ` Martin Liška
2019-02-20  9:37                                                                                 ` Thomas König
2019-02-20 14:17                                                                                   ` Martin Liška
2019-02-20 20:11                                                                                     ` Thomas König
2019-02-20  9:52                                                                                 ` Bernhard Reutner-Fischer
2019-02-20  9:57                                                                                   ` Martin Liška
2019-02-20 10:46                                                                                     ` Bernhard Reutner-Fischer
2019-02-20 11:12                                                                                       ` Martin Liška
2018-11-26 16:54                                                               ` Martin Liška
2018-11-26 18:45                                                                 ` Joseph Myers
2018-11-27 13:40                                                                   ` Martin Liška
2018-11-30 13:51                                                                     ` Martin Liška
2019-01-09 16:01                                                                       ` Martin Liška
2019-01-09 17:16                                                                         ` Joseph Myers
2019-01-09 17:21                                                                           ` Joseph Myers
2019-01-11 15:17                                                                           ` Martin Liška
2019-01-11 18:06                                                                             ` Joseph Myers
2019-01-14 14:09                                                                               ` Martin Liška
2019-01-15 17:45                                                                                 ` Joseph Myers
2019-01-16  9:42                                                                                   ` Fortran vector math header Martin Liška
2019-01-16 12:39                                                                                     ` Jakub Jelinek
2019-01-16 14:05                                                                                       ` Joseph Myers
2019-01-16 17:42                                                                                         ` Joseph Myers
2019-01-16 18:04                                                                                           ` Jakub Jelinek
2019-01-16 20:35                                                                                             ` Joseph Myers
2019-01-18  8:18                                                                                               ` Martin Liška
2019-01-18  8:40                                                                                                 ` Jakub Jelinek
2019-01-21  7:47                                                                                                   ` Martin Liška
2019-01-21  7:58                                                                                                     ` Jakub Jelinek
2019-01-21  9:09                                                                                                       ` Martin Liška
2019-01-21  9:19                                                                                                         ` Jakub Jelinek
2019-01-21  9:36                                                                                                           ` Martin Liška
2019-01-21  9:40                                                                                                             ` Jakub Jelinek
2019-01-21 14:25                                                                                                     ` Joseph Myers
2019-01-22 11:01                                                                                                       ` Martin Liška
2019-01-22 11:15                                                                                                         ` Jakub Jelinek
2019-01-22 12:18                                                                                                           ` Richard Biener
2019-01-23  1:18                                                                                                             ` Joseph Myers
2019-01-24 14:59                                                                                                               ` Martin Liška
2019-01-24 15:11                                                                                                                 ` Jakub Jelinek [this message]
2019-01-24 15:36                                                                                                                   ` Martin Liška
2019-01-24 22:10                                                                                                                     ` Steve Ellcey
2019-01-25 13:17                                                                                                                       ` Martin Liška
2019-02-04  9:59                                                                                                                     ` Martin Liška
2019-02-04 10:10                                                                                                                     ` Jakub Jelinek
2019-02-05  1:31                                                                                                                       ` Joseph Myers
2019-02-05 12:48                                                                                                                         ` Martin Liška
2019-02-13 11:34                                                                                                                           ` Martin Liška
2019-02-14 21:14                                                                                                                             ` Steve Ellcey
2019-02-15 11:16                                                                                                                               ` Martin Liška
2019-02-05 12:48                                                                                                                       ` Martin Liška
2019-02-14 18:27                                                                                                                         ` Joseph Myers
2019-02-16  0:05                                                                                                                         ` Steve Kargl
2019-01-23 22:53                                                                                                             ` Steve Ellcey
2019-01-23 22:57                                                                                                               ` Jakub Jelinek
2019-01-23 23:14                                                                                                                 ` [EXT] " Steve Ellcey
2019-01-16 13:59                                                                                     ` Joseph Myers
2018-11-17 21:13                                         ` [PATCH] Support simd function declarations via a pre-include. (was: [PATCH][RFC]Overloading intrinsics) Bernhard Reutner-Fischer

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=20190124150529.GO30353@tucnak \
    --to=jakub@redhat.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=mliska@suse.cz \
    --cc=rep.dot.nop@gmail.com \
    --cc=richard.guenther@gmail.com \
    --cc=tkoenig@netcologne.de \
    --cc=toon@moene.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).