mirror of
git://sourceware.org/git/glibc.git
synced 2024-12-27 04:41:02 +08:00
Correct return value according to the standard.
This commit is contained in:
parent
acb1cd8ea1
commit
16e4bf6fec
@ -29,5 +29,5 @@ feholdexcept (fenv_t *envp)
|
||||
/* Clear all exception status bits and exception enable bits. */
|
||||
__ieee_set_fp_control(0);
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ fesetround (int round)
|
||||
unsigned long fpcr;
|
||||
|
||||
if (round & ~3)
|
||||
return 0;
|
||||
return 1;
|
||||
|
||||
/* Get the current state. */
|
||||
__asm__ __volatile__("excb; mf_fpcr %0" : "=f"(fpcr));
|
||||
@ -37,5 +37,5 @@ fesetround (int round)
|
||||
/* Put the new state in effect. */
|
||||
__asm__ __volatile__("mt_fpcr %0; excb" : : "f"(fpcr));
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
@ -33,5 +33,5 @@ feholdexcept (fenv_t *envp)
|
||||
temp &= ~(FE_ALL_EXCEPT << FE_EXCEPT_SHIFT);
|
||||
_FPU_SETCW(temp);
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
@ -23,5 +23,5 @@ int
|
||||
fesetround (int round)
|
||||
{
|
||||
/* We only support FE_TONEAREST, so there is no need for any work. */
|
||||
return (round == FE_TONEAREST)?1:0;
|
||||
return (round == FE_TONEAREST)?0:1;
|
||||
}
|
||||
|
@ -35,5 +35,5 @@ feholdexcept (fenv_t *envp)
|
||||
fpcr = envp->__control_register & ~(FE_ALL_EXCEPT << 6);
|
||||
__asm__ __volatile__ ("fmove%.l %0,%!" : : "dm" (fpcr));
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
@ -27,12 +27,12 @@ fesetround (int round)
|
||||
|
||||
if (round & ~FE_UPWARD)
|
||||
/* ROUND is no valid rounding mode. */
|
||||
return 0;
|
||||
return 1;
|
||||
|
||||
__asm__ ("fmove%.l %!,%0" : "=dm" (fpcr));
|
||||
fpcr &= ~FE_UPWARD;
|
||||
fpcr |= round;
|
||||
__asm__ __volatile__ ("fmove%.l %0,%!" : : "dm" (fpcr));
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ fesetround (int round)
|
||||
|
||||
if ((round & ~0x3) != 0)
|
||||
/* ROUND is no valid rounding mode. */
|
||||
return 0;
|
||||
return 1;
|
||||
|
||||
/* Get current state. */
|
||||
_FPU_GETCW (cw);
|
||||
@ -39,5 +39,5 @@ fesetround (int round)
|
||||
/* Set new state. */
|
||||
_FPU_SETCW (cw);
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user