On Wed, Apr 21, 2021 at 12:30 AM Uros Bizjak <ubiz...@gmail.com> wrote:
>
> On Thu, Apr 15, 2021 at 12:39 AM H.J. Lu <hjl.to...@gmail.com> wrote:
> >
> > commit 87c753ac241f25d222d46ba1ac66ceba89d6a200
> > Author: H.J. Lu <hjl.to...@gmail.com>
> > Date:   Fri Aug 21 09:42:49 2020 -0700
> >
> >     x86: Add target("general-regs-only") function attribute
> >
> > is incomplete since it is impossible to call integer intrinsics from
> > a function with general-regs-only target attribute.
> >
> > 1. Add general_regs_only function attribute to inform the compiler that
> > functions use only general purpose registers.  When making inlining
> > decisions on such functions, non-GPR compiler options are excluded.
> > 2. Add general_regs_only attribute to x86 intrinsics which use only
> > general purpose registers.
>
> I'd like to ask Richard and Jakub if they agree with the approach.

Here is the v5 patch:

https://gcc.gnu.org/pipermail/gcc-patches/2021-April/568407.html

Richard, Jakub,  do they look good to you?

> On a related note, can we declare default attributes like clang does, e.g.:
>
> /* Define the default attributes for the functions.  */
> #define __DEFAULT_FN_ATTRS __attribute__((__gnu_inline__,
> __always_inline__, __artificial__))

This can be defined in x86intrin.h.

> #define __DEFAULT_FN_ATTRS_GRO __attribute__((__gnu_inline__,
> __always_inline__, __general_regs_only, __artificial__))

This can be defined in x86gprintrin.h.

> and use these defines throughout header files?
>
> Uros.
>

Thanks.

-- 
H.J.

Reply via email to