diff mbox

[ARM] Update GCC to generate Tag_ABI_HardFP_use per the latest EABI doc

Message ID 000401d02fe0$29d48e00$7d7daa00$@arm.com
State New
Headers show

Commit Message

Terry Guo Jan. 14, 2015, 9:54 a.m. UTC
Hi there,

According to the latest EABI at
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0045d/IHI0045D_ABI_adden
da.pdf, the new definition of Tag_ABI_HardFP_use is as below:

Tag_ABI_HardFP_use, (=27), uleb128
0 The user intended that FP use should be implied by Tag_FP_arch
1 The user intended this code to execute on the single-precision variant
 derived from Tag_FP_arch
2 Reserved
3 The user intended that FP use should be implied by Tag_FP_arch
 (Note: This is a deprecated duplicate of the default encoded by 0)

The attached patch intends to update gcc to conform this definition. Tested
with GCC regression test, no regressions. Is it OK?

BR,
Terry

2015-01-14  Terry Guo  <terry.guo@arm.com>

           * config/arm/arm.c (arm_file_start): Update the assignment of
Tag_ABI_HardFP_use.

Comments

Richard Earnshaw Jan. 14, 2015, 10:15 a.m. UTC | #1
On 14/01/15 09:54, Terry Guo wrote:
> Hi there,
> 
> According to the latest EABI at
> http://infocenter.arm.com/help/topic/com.arm.doc.ihi0045d/IHI0045D_ABI_adden
> da.pdf, the new definition of Tag_ABI_HardFP_use is as below:
> 
> Tag_ABI_HardFP_use, (=27), uleb128
> 0 The user intended that FP use should be implied by Tag_FP_arch
> 1 The user intended this code to execute on the single-precision variant
>  derived from Tag_FP_arch
> 2 Reserved
> 3 The user intended that FP use should be implied by Tag_FP_arch
>  (Note: This is a deprecated duplicate of the default encoded by 0)
> 

You don't need to emit tags that have the value 0.  That's the default
for missing tags.

So you only need

	if (TARGET_HARD_FLOAT && TARGET_VFP_SINGLE)
	  => Tag_ABI_HardFP_use = 1

OK with that change.

R.

> The attached patch intends to update gcc to conform this definition. Tested
> with GCC regression test, no regressions. Is it OK?
> 
> BR,
> Terry
> 
> 2015-01-14  Terry Guo  <terry.guo@arm.com>
> 
>            * config/arm/arm.c (arm_file_start): Update the assignment of
> Tag_ABI_HardFP_use.
> 
> 
> gcc-update-Tag_ABI_HardFP_use-v2.txt
> 
> 
> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
> index 0ec526b..378bed9 100644
> --- a/gcc/config/arm/arm.c
> +++ b/gcc/config/arm/arm.c
> @@ -25576,7 +25576,13 @@ arm_file_start (void)
>  	  if (arm_fpu_desc->model == ARM_FP_MODEL_VFP)
>  	    {
>  	      if (TARGET_HARD_FLOAT)
> -		arm_emit_eabi_attribute ("Tag_ABI_HardFP_use", 27, 3);
> +		{
> +		  if (TARGET_VFP_SINGLE)
> +		    arm_emit_eabi_attribute ("Tag_ABI_HardFP_use", 27, 1);
> +		  else
> +		    arm_emit_eabi_attribute ("Tag_ABI_HardFP_use", 27, 0);
> +		}
> +
>  	      if (TARGET_HARD_FLOAT_ABI)
>  		arm_emit_eabi_attribute ("Tag_ABI_VFP_args", 28, 1);
>  	    }
>
diff mbox

Patch

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 0ec526b..378bed9 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -25576,7 +25576,13 @@  arm_file_start (void)
 	  if (arm_fpu_desc->model == ARM_FP_MODEL_VFP)
 	    {
 	      if (TARGET_HARD_FLOAT)
-		arm_emit_eabi_attribute ("Tag_ABI_HardFP_use", 27, 3);
+		{
+		  if (TARGET_VFP_SINGLE)
+		    arm_emit_eabi_attribute ("Tag_ABI_HardFP_use", 27, 1);
+		  else
+		    arm_emit_eabi_attribute ("Tag_ABI_HardFP_use", 27, 0);
+		}
+
 	      if (TARGET_HARD_FLOAT_ABI)
 		arm_emit_eabi_attribute ("Tag_ABI_VFP_args", 28, 1);
 	    }