[09/12] Add fesetexcept: powerpc

Message ID alpine.DEB.2.20.1608121749530.2561@digraph.polyomino.org.uk
State Committed
Headers

Commit Message

Joseph Myers Aug. 12, 2016, 5:50 p.m. UTC
  On Fri, 12 Aug 2016, Paul E. Murphy wrote:

> I don't like the naked constants.  I am not faulting the patch for them.
> But in trying to understand them, I had to do some digging.  A similar
> snippet shows up in three places in ppc code.  fpu/fraiseexcpt.c
> seems to contain the only useful comment.  Both clear and succinct.

I've added that comment to fsetexcptflg.c and will add it to fesetexcept.c 
in my patch.

2016-08-12  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/powerpc/fpu/fsetexcptflg.c (__fesetexceptflag): Add
	comment from fraiseexcpt.c.
  

Patch

diff --git a/sysdeps/powerpc/fpu/fsetexcptflg.c b/sysdeps/powerpc/fpu/fsetexcptflg.c
index cb440d5..70dd07c 100644
--- a/sysdeps/powerpc/fpu/fsetexcptflg.c
+++ b/sysdeps/powerpc/fpu/fsetexcptflg.c
@@ -36,6 +36,7 @@  __fesetexceptflag (const fexcept_t *flagp, int excepts)
     excepts_mask |= FE_ALL_INVALID;
   n.l = ((u.l & ~excepts_mask)
 	 | (flag & FPSCR_STICKY_BITS)
+	 /* Turn FE_INVALID into FE_INVALID_SOFTWARE.  */
 	 | (flag >> ((31 - FPSCR_VX) - (31 - FPSCR_VXSOFT))
 	    & FE_INVALID_SOFTWARE));