Skip to content

Commit b3ea5b3

Browse files
committed
xtensa: Check for invalidate argument to fesetround
This function needs to return an error for invalid argument and not change the rounding mode. Signed-off-by: Keith Packard <[email protected]>
1 parent b14e180 commit b3ea5b3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

newlib/libc/machine/xtensa/machine/fenv-fp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ __declare_fenv_inline(int) fesetexceptflag(const fexcept_t *flagp, int excepts)
144144

145145
__declare_fenv_inline(int) fesetround(int round)
146146
{
147+
if (round & ~_FE_ROUND_MODE_MASK)
148+
return 1;
147149
__asm__ volatile ("wur.fcr %0" : : "a"(round));
148150
return 0;
149151
}

0 commit comments

Comments
 (0)