diff mbox series

arm: Fix emission of Tag_ABI_VFP_args with MVE and -mfloat-abi=hard (PR target/99773)

Message ID 1617107863-25487-1-git-send-email-christophe.lyon@linaro.org
State New
Headers show
Series arm: Fix emission of Tag_ABI_VFP_args with MVE and -mfloat-abi=hard (PR target/99773) | expand

Commit Message

Christophe Lyon March 30, 2021, 12:37 p.m. UTC
When compiling with -mfloat-abi=hard -march=armv8.1-m.main+mve, we
want to emit Tag_ABI_VFP_args even though we are not emitting
floating-point instructions (we need "+mve.fp" for that), because we
use MVE registers to pass FP arguments.

This patch removes the condition on (! TARGET_SOFT_FLOAT) because this
is a case where TARGET_SOFT_FLOAT is true, and TARGET_HARD_FLOAT_ABI
is true too.

2021-03-30  Richard Earnshaw  <richard.earnshaw@arm.com>

	gcc/
	PR target/99773
	* config/arm/arm.c (arm_file_start): Fix emission of
	Tag_ABI_VFP_args attribute.
---
 gcc/config/arm/arm.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

Comments

Richard Earnshaw March 30, 2021, 12:58 p.m. UTC | #1
On 30/03/2021 13:37, Christophe Lyon via Gcc-patches wrote:
> When compiling with -mfloat-abi=hard -march=armv8.1-m.main+mve, we
> want to emit Tag_ABI_VFP_args even though we are not emitting
> floating-point instructions (we need "+mve.fp" for that), because we
> use MVE registers to pass FP arguments.
> 
> This patch removes the condition on (! TARGET_SOFT_FLOAT) because this
> is a case where TARGET_SOFT_FLOAT is true, and TARGET_HARD_FLOAT_ABI
> is true too.
> 
> 2021-03-30  Richard Earnshaw  <richard.earnshaw@arm.com>
> 
> 	gcc/
> 	PR target/99773
> 	* config/arm/arm.c (arm_file_start): Fix emission of
> 	Tag_ABI_VFP_args attribute.

For historical reasons, for commits I use rearnsha@arm.com as my email 
address.

Otherwise, OK.

R.

:)

> ---
>   gcc/config/arm/arm.c | 11 ++++-------
>   1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
> index e89f5e2..518bfed 100644
> --- a/gcc/config/arm/arm.c
> +++ b/gcc/config/arm/arm.c
> @@ -28150,14 +28150,11 @@ arm_file_start (void)
>         if (print_tune_info)
>   	arm_print_tune_info ();
>   
> -      if (! TARGET_SOFT_FLOAT)
> -	{
> -	  if (TARGET_HARD_FLOAT && TARGET_VFP_SINGLE)
> -	    arm_emit_eabi_attribute ("Tag_ABI_HardFP_use", 27, 1);
> +      if (TARGET_HARD_FLOAT && TARGET_VFP_SINGLE)
> +	arm_emit_eabi_attribute ("Tag_ABI_HardFP_use", 27, 1);
>   
> -	  if (TARGET_HARD_FLOAT_ABI)
> -	    arm_emit_eabi_attribute ("Tag_ABI_VFP_args", 28, 1);
> -	}
> +      if (TARGET_HARD_FLOAT_ABI)
> +	arm_emit_eabi_attribute ("Tag_ABI_VFP_args", 28, 1);
>   
>         /* Some of these attributes only apply when the corresponding features
>   	 are used.  However we don't have any easy way of figuring this out.
>
Christophe Lyon March 30, 2021, 1:11 p.m. UTC | #2
On Tue, 30 Mar 2021 at 14:59, Richard Earnshaw
<Richard.Earnshaw@foss.arm.com> wrote:
>
>
>
> On 30/03/2021 13:37, Christophe Lyon via Gcc-patches wrote:
> > When compiling with -mfloat-abi=hard -march=armv8.1-m.main+mve, we
> > want to emit Tag_ABI_VFP_args even though we are not emitting
> > floating-point instructions (we need "+mve.fp" for that), because we
> > use MVE registers to pass FP arguments.
> >
> > This patch removes the condition on (! TARGET_SOFT_FLOAT) because this
> > is a case where TARGET_SOFT_FLOAT is true, and TARGET_HARD_FLOAT_ABI
> > is true too.
> >
> > 2021-03-30  Richard Earnshaw  <richard.earnshaw@arm.com>
> >
> >       gcc/
> >       PR target/99773
> >       * config/arm/arm.c (arm_file_start): Fix emission of
> >       Tag_ABI_VFP_args attribute.
>
> For historical reasons, for commits I use rearnsha@arm.com as my email
> address.
>
> Otherwise, OK.
>
> R.
>
> :)

Oops sorry ;-)

Pushed, thanks

Christophe

>
> > ---
> >   gcc/config/arm/arm.c | 11 ++++-------
> >   1 file changed, 4 insertions(+), 7 deletions(-)
> >
> > diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
> > index e89f5e2..518bfed 100644
> > --- a/gcc/config/arm/arm.c
> > +++ b/gcc/config/arm/arm.c
> > @@ -28150,14 +28150,11 @@ arm_file_start (void)
> >         if (print_tune_info)
> >       arm_print_tune_info ();
> >
> > -      if (! TARGET_SOFT_FLOAT)
> > -     {
> > -       if (TARGET_HARD_FLOAT && TARGET_VFP_SINGLE)
> > -         arm_emit_eabi_attribute ("Tag_ABI_HardFP_use", 27, 1);
> > +      if (TARGET_HARD_FLOAT && TARGET_VFP_SINGLE)
> > +     arm_emit_eabi_attribute ("Tag_ABI_HardFP_use", 27, 1);
> >
> > -       if (TARGET_HARD_FLOAT_ABI)
> > -         arm_emit_eabi_attribute ("Tag_ABI_VFP_args", 28, 1);
> > -     }
> > +      if (TARGET_HARD_FLOAT_ABI)
> > +     arm_emit_eabi_attribute ("Tag_ABI_VFP_args", 28, 1);
> >
> >         /* Some of these attributes only apply when the corresponding features
> >        are used.  However we don't have any easy way of figuring this out.
> >
diff mbox series

Patch

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index e89f5e2..518bfed 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -28150,14 +28150,11 @@  arm_file_start (void)
       if (print_tune_info)
 	arm_print_tune_info ();
 
-      if (! TARGET_SOFT_FLOAT)
-	{
-	  if (TARGET_HARD_FLOAT && TARGET_VFP_SINGLE)
-	    arm_emit_eabi_attribute ("Tag_ABI_HardFP_use", 27, 1);
+      if (TARGET_HARD_FLOAT && TARGET_VFP_SINGLE)
+	arm_emit_eabi_attribute ("Tag_ABI_HardFP_use", 27, 1);
 
-	  if (TARGET_HARD_FLOAT_ABI)
-	    arm_emit_eabi_attribute ("Tag_ABI_VFP_args", 28, 1);
-	}
+      if (TARGET_HARD_FLOAT_ABI)
+	arm_emit_eabi_attribute ("Tag_ABI_VFP_args", 28, 1);
 
       /* Some of these attributes only apply when the corresponding features
 	 are used.  However we don't have any easy way of figuring this out.