diff mbox

[3/13] AArch64: Cleanup fenv implementation

Message ID 000d01cfeee7$927ee700$b77cb500$@com
State New
Headers show

Commit Message

Wilco Oct. 23, 2014, 5:34 p.m. UTC
Cleanup fesetexceptflag to use the same logic as the ARM version. No functional changes.

ChangeLog:
2014-10-23  Wilco Dijkstra  <wdijkstr@arm.com>

	* sysdeps/aarch64/fpu/fsetexcptflg.c (fsetexceptflag):
	Cleanup logic.

---
 sysdeps/aarch64/fpu/fsetexcptflg.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Carlos O'Donell Oct. 23, 2014, 10:35 p.m. UTC | #1
On 10/23/2014 01:34 PM, Wilco Dijkstra wrote:
> 
> Cleanup fesetexceptflag to use the same logic as the ARM version. No functional changes.
> 
> ChangeLog:
> 2014-10-23  Wilco Dijkstra  <wdijkstr@arm.com>
> 
> 	* sysdeps/aarch64/fpu/fsetexcptflg.c (fsetexceptflag):
> 	Cleanup logic.
> 
> ---
>  sysdeps/aarch64/fpu/fsetexcptflg.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/sysdeps/aarch64/fpu/fsetexcptflg.c b/sysdeps/aarch64/fpu/fsetexcptflg.c
> index 316fbd6..77e6cae 100644
> --- a/sysdeps/aarch64/fpu/fsetexcptflg.c
> +++ b/sysdeps/aarch64/fpu/fsetexcptflg.c
> @@ -27,10 +27,11 @@ fesetexceptflag (const fexcept_t *flagp, int excepts)
>  
>    /* Get the current environment.  */
>    _FPU_GETFPSR (fpsr);
> +  excepts &= FE_ALL_EXCEPT;
>  
>    /* Set the desired exception mask.  */
> -  fpsr_new = fpsr & ~(excepts & FE_ALL_EXCEPT);
> -  fpsr_new |= (*flagp & excepts & FE_ALL_EXCEPT);
> +  fpsr_new = fpsr & ~excepts;
> +  fpsr_new |= *flagp & excepts;
>  
>    /* Save state back to the FPU.  */
>    if (fpsr != fpsr_new)
> 

Obvious cleanup. Please feel free to checkin things like this
as [COMMITTED].

c.
diff mbox

Patch

diff --git a/sysdeps/aarch64/fpu/fsetexcptflg.c b/sysdeps/aarch64/fpu/fsetexcptflg.c
index 316fbd6..77e6cae 100644
--- a/sysdeps/aarch64/fpu/fsetexcptflg.c
+++ b/sysdeps/aarch64/fpu/fsetexcptflg.c
@@ -27,10 +27,11 @@  fesetexceptflag (const fexcept_t *flagp, int excepts)
 
   /* Get the current environment.  */
   _FPU_GETFPSR (fpsr);
+  excepts &= FE_ALL_EXCEPT;
 
   /* Set the desired exception mask.  */
-  fpsr_new = fpsr & ~(excepts & FE_ALL_EXCEPT);
-  fpsr_new |= (*flagp & excepts & FE_ALL_EXCEPT);
+  fpsr_new = fpsr & ~excepts;
+  fpsr_new |= *flagp & excepts;
 
   /* Save state back to the FPU.  */
   if (fpsr != fpsr_new)