sparc: Treat the version field in the FPU control word as reserved

Message ID 20240112092628.2464455-4-cederman@gaisler.com
State Committed
Commit aa4106db1d6f80e64dcc8818cc07aacd7fabb03e
Headers
Series sparc: Treat the version field in the FPU control word as reserved |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Testing passed
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Testing passed

Commit Message

Daniel Cederman Jan. 12, 2024, 9:26 a.m. UTC
  The FSR version field is read-only and might be non-zero.

This allows math/test-fpucw* to correctly pass when the version is
non-zero.

Signed-off-by: Daniel Cederman <cederman@gaisler.com>
---
 sysdeps/sparc/fpu/fpu_control.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Adhemerval Zanella Netto Jan. 12, 2024, 5:42 p.m. UTC | #1
On 12/01/24 06:26, Daniel Cederman wrote:
> The FSR version field is read-only and might be non-zero.
> 
> This allows math/test-fpucw* to correctly pass when the version is
> non-zero.
> 
> Signed-off-by: Daniel Cederman <cederman@gaisler.com>

It looks reasonable to mask off the version _FPU_RESERVED.  It also
means that it would be change by __setfpucw, although afaik the ISA
guarantee that it can not be changed anyway.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  sysdeps/sparc/fpu/fpu_control.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sysdeps/sparc/fpu/fpu_control.h b/sysdeps/sparc/fpu/fpu_control.h
> index 9313743f86..36a2bf5d07 100644
> --- a/sysdeps/sparc/fpu/fpu_control.h
> +++ b/sysdeps/sparc/fpu/fpu_control.h
> @@ -42,7 +42,7 @@
>  #define _FPU_RC_ZERO    0x40000000
>  #define _FPU_RC_NEAREST 0x0        /* RECOMMENDED */
>  
> -#define _FPU_RESERVED   0x30300000  /* Reserved bits in cw */
> +#define _FPU_RESERVED   0x303e0000  /* Reserved bits in cw */
>  
>  
>  /* Now two recommended cw */
  
Daniel Cederman Feb. 15, 2024, 9:31 a.m. UTC | #2
Hello Adhemerval,

Can you apply this to master if you are ok with the patch?

/Daniel

On 2024-01-12 18:42, Adhemerval Zanella Netto wrote:
> 
> 
> On 12/01/24 06:26, Daniel Cederman wrote:
>> The FSR version field is read-only and might be non-zero.
>>
>> This allows math/test-fpucw* to correctly pass when the version is
>> non-zero.
>>
>> Signed-off-by: Daniel Cederman <cederman@gaisler.com>
> 
> It looks reasonable to mask off the version _FPU_RESERVED.  It also
> means that it would be change by __setfpucw, although afaik the ISA
> guarantee that it can not be changed anyway.
> 
> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
> 
>> ---
>>   sysdeps/sparc/fpu/fpu_control.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/sysdeps/sparc/fpu/fpu_control.h b/sysdeps/sparc/fpu/fpu_control.h
>> index 9313743f86..36a2bf5d07 100644
>> --- a/sysdeps/sparc/fpu/fpu_control.h
>> +++ b/sysdeps/sparc/fpu/fpu_control.h
>> @@ -42,7 +42,7 @@
>>   #define _FPU_RC_ZERO    0x40000000
>>   #define _FPU_RC_NEAREST 0x0        /* RECOMMENDED */
>>   
>> -#define _FPU_RESERVED   0x30300000  /* Reserved bits in cw */
>> +#define _FPU_RESERVED   0x303e0000  /* Reserved bits in cw */
>>   
>>   
>>   /* Now two recommended cw */
  
Adhemerval Zanella Netto Feb. 19, 2024, 2:55 p.m. UTC | #3
It seems I forgot to push this one, it is done now.

On 15/02/24 06:31, Daniel Cederman wrote:
> Hello Adhemerval,
> 
> Can you apply this to master if you are ok with the patch?
> 
> /Daniel
> 
> On 2024-01-12 18:42, Adhemerval Zanella Netto wrote:
>>
>>
>> On 12/01/24 06:26, Daniel Cederman wrote:
>>> The FSR version field is read-only and might be non-zero.
>>>
>>> This allows math/test-fpucw* to correctly pass when the version is
>>> non-zero.
>>>
>>> Signed-off-by: Daniel Cederman <cederman@gaisler.com>
>>
>> It looks reasonable to mask off the version _FPU_RESERVED.  It also
>> means that it would be change by __setfpucw, although afaik the ISA
>> guarantee that it can not be changed anyway.
>>
>> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
>>
>>> ---
>>>   sysdeps/sparc/fpu/fpu_control.h | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/sysdeps/sparc/fpu/fpu_control.h b/sysdeps/sparc/fpu/fpu_control.h
>>> index 9313743f86..36a2bf5d07 100644
>>> --- a/sysdeps/sparc/fpu/fpu_control.h
>>> +++ b/sysdeps/sparc/fpu/fpu_control.h
>>> @@ -42,7 +42,7 @@
>>>   #define _FPU_RC_ZERO    0x40000000
>>>   #define _FPU_RC_NEAREST 0x0        /* RECOMMENDED */
>>>   -#define _FPU_RESERVED   0x30300000  /* Reserved bits in cw */
>>> +#define _FPU_RESERVED   0x303e0000  /* Reserved bits in cw */
>>>       /* Now two recommended cw */
  

Patch

diff --git a/sysdeps/sparc/fpu/fpu_control.h b/sysdeps/sparc/fpu/fpu_control.h
index 9313743f86..36a2bf5d07 100644
--- a/sysdeps/sparc/fpu/fpu_control.h
+++ b/sysdeps/sparc/fpu/fpu_control.h
@@ -42,7 +42,7 @@ 
 #define _FPU_RC_ZERO    0x40000000
 #define _FPU_RC_NEAREST 0x0        /* RECOMMENDED */
 
-#define _FPU_RESERVED   0x30300000  /* Reserved bits in cw */
+#define _FPU_RESERVED   0x303e0000  /* Reserved bits in cw */
 
 
 /* Now two recommended cw */