[PATCH] Fix ARM fegetexceptflag.c

Matt Reynolds <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
The ARM fegetexceptflag() implementation was accidentally replaced with
fesetexceptflag() during refactoring in 3ca43259686187e081d317e2b406724a849c9d7b.
Restore the original implementation.

Tested on Cortex-M7.
---
 newlib/libm/machine/arm/fegetexceptflag.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/newlib/libm/machine/arm/fegetexceptflag.c b/newlib/libm/machine/arm/fegetexceptflag.c
index 2bfcb08ae..17b3a3d7d 100644
--- a/newlib/libm/machine/arm/fegetexceptflag.c
+++ b/newlib/libm/machine/arm/fegetexceptflag.c
@@ -37,9 +37,7 @@ int fegetexceptflag(fexcept_t *flagp, int excepts)
 	fexcept_t __fpsr;
 
 	vmrs_fpscr(__fpsr);
-	__fpsr &= ~excepts;
-	__fpsr |= *flagp & excepts;
-	vmsr_fpscr(__fpsr);
+	*flagp = __fpsr & excepts;
 #endif
 	return (0);
 }
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.