Correct return value according to the standard.

This commit is contained in:
Ulrich Drepper 2000-01-31 07:56:49 +00:00
parent acb1cd8ea1
commit 16e4bf6fec
7 changed files with 10 additions and 10 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -33,5 +33,5 @@ feholdexcept (fenv_t *envp)
temp &= ~(FE_ALL_EXCEPT << FE_EXCEPT_SHIFT);
_FPU_SETCW(temp);
return 1;
return 0;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}