diff options
Diffstat (limited to 'libm/powerpc/classic')
-rw-r--r-- | libm/powerpc/classic/s_ceil.c | 4 | ||||
-rw-r--r-- | libm/powerpc/classic/s_floor.c | 4 | ||||
-rw-r--r-- | libm/powerpc/classic/s_modf.c | 42 | ||||
-rw-r--r-- | libm/powerpc/classic/s_nearbyint.c | 4 | ||||
-rw-r--r-- | libm/powerpc/classic/s_round.c | 6 | ||||
-rw-r--r-- | libm/powerpc/classic/s_trunc.c | 4 |
6 files changed, 32 insertions, 32 deletions
diff --git a/libm/powerpc/classic/s_ceil.c b/libm/powerpc/classic/s_ceil.c index 8db5ce537..ee4ceb5fc 100644 --- a/libm/powerpc/classic/s_ceil.c +++ b/libm/powerpc/classic/s_ceil.c @@ -75,9 +75,9 @@ double ceil ( double x ) return ( x ); else { // inexact case - asm ("mffs %0" : "=f" (OldEnvironment.dbl)); + __asm__ ("mffs %0" : "=f" (OldEnvironment.dbl)); OldEnvironment.words.lo |= 0x02000000ul; - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); if ( target ) return ( 1.0 ); else diff --git a/libm/powerpc/classic/s_floor.c b/libm/powerpc/classic/s_floor.c index ff3436707..2cd720eff 100644 --- a/libm/powerpc/classic/s_floor.c +++ b/libm/powerpc/classic/s_floor.c @@ -75,9 +75,9 @@ double floor ( double x ) return ( x ); else { // inexact case - asm ("mffs %0" : "=f" (OldEnvironment.dbl)); + __asm__ ("mffs %0" : "=f" (OldEnvironment.dbl)); OldEnvironment.words.lo |= 0x02000000ul; - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); if ( target ) return ( 0.0 ); else diff --git a/libm/powerpc/classic/s_modf.c b/libm/powerpc/classic/s_modf.c index b9d69445d..c2221bc0b 100644 --- a/libm/powerpc/classic/s_modf.c +++ b/libm/powerpc/classic/s_modf.c @@ -104,12 +104,12 @@ long int rinttol ( double x ) return ( ( long ) argument.words.lo ); } - asm ("mffs %0" : "=f" (OldEnvironment.dbl)); // get environment + __asm__ ("mffs %0" : "=f" (OldEnvironment.dbl)); // get environment if ( xHead > 0x41dffffful ) { // x is safely out of long range OldEnvironment.words.lo |= SET_INVALID; - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); return ( LONG_MAX ); } @@ -121,7 +121,7 @@ long int rinttol ( double x ) if ( y > ( double ) LONG_MAX ) { // out of range of long OldEnvironment.words.lo |= SET_INVALID; - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); return ( LONG_MAX ); } argument.dbl = y + doubleToLong; // in range @@ -138,12 +138,12 @@ long int rinttol ( double x ) return ( ( long ) argument.words.lo ); } - asm ("mffs %0" : "=f" (OldEnvironment.dbl)); // get environment + __asm__ ("mffs %0" : "=f" (OldEnvironment.dbl)); // get environment if ( xHead > 0x41e00000ul ) { // x is safely out of long range OldEnvironment.words.lo |= SET_INVALID; - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); return ( LONG_MIN ); } @@ -155,7 +155,7 @@ long int rinttol ( double x ) if ( y < ( double ) LONG_MIN ) { // out of range of long OldEnvironment.words.lo |= SET_INVALID; - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); return ( LONG_MIN ); } argument.dbl = y + doubleToLong; // in range @@ -193,9 +193,9 @@ long int roundtol ( double x ) * Is x is out of long range or NaN? * *******************************************************************************/ { - asm ("mffs %0" : "=f" (OldEnvironment.dbl)); // get environment + __asm__ ("mffs %0" : "=f" (OldEnvironment.dbl)); // get environment OldEnvironment.words.lo |= SET_INVALID; - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); if ( target ) // pin result return ( LONG_MAX ); else @@ -215,11 +215,11 @@ long int roundtol ( double x ) y = ( x + doubleToLong ) - doubleToLong; // round at binary point if ( y != x ) { // inexact case - asm ("mffs %0" : "=f" (OldEnvironment.dbl)); // save environment - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( kTZ.dbl )); // truncate rounding + __asm__ ("mffs %0" : "=f" (OldEnvironment.dbl)); // save environment + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( kTZ.dbl )); // truncate rounding z = x + 0.5; // truncate x + 0.5 argument.dbl = z + doubleToLong; - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); return ( ( long ) argument.words.lo ); } @@ -229,9 +229,9 @@ long int roundtol ( double x ) /******************************************************************************* * Rounded positive x is out of the range of a long. * *******************************************************************************/ - asm ("mffs %0" : "=f" (OldEnvironment.dbl)); + __asm__ ("mffs %0" : "=f" (OldEnvironment.dbl)); OldEnvironment.words.lo |= SET_INVALID; - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); return ( LONG_MAX ); // return pinned result } /******************************************************************************* @@ -245,11 +245,11 @@ long int roundtol ( double x ) y = ( x + doubleToLong ) - doubleToLong; // round at binary point if ( y != x ) { // inexact case - asm ("mffs %0" : "=f" (OldEnvironment.dbl)); // save environment - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( kUP.dbl )); // round up + __asm__ ("mffs %0" : "=f" (OldEnvironment.dbl)); // save environment + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( kUP.dbl )); // round up z = x - 0.5; // truncate x - 0.5 argument.dbl = z + doubleToLong; - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); return ( ( long ) argument.words.lo ); } @@ -259,9 +259,9 @@ long int roundtol ( double x ) /******************************************************************************* * Rounded negative x is out of the range of a long. * *******************************************************************************/ - asm ("mffs %0" : "=f" (OldEnvironment.dbl)); + __asm__ ("mffs %0" : "=f" (OldEnvironment.dbl)); OldEnvironment.words.lo |= SET_INVALID; - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); return ( LONG_MIN ); // return pinned result } @@ -311,15 +311,15 @@ double modf ( double x, double *iptr ) /******************************************************************************* * Is 1.0 < |x| < 2.0^52? * *******************************************************************************/ - asm ("mffs %0" : "=f" (OldEnvironment)); // save environment + __asm__ ("mffs %0" : "=f" (OldEnvironment)); // save environment // round toward zero - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( TOWARDZERO.dbl )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( TOWARDZERO.dbl )); if ( signBit == 0ul ) // truncate to integer xtrunc = ( x + twoTo52 ) - twoTo52; else xtrunc = ( x - twoTo52 ) + twoTo52; // restore caller's env - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment )); *iptr = xtrunc; // store integral part if ( x != xtrunc ) // nonzero fraction return ( x - xtrunc ); diff --git a/libm/powerpc/classic/s_nearbyint.c b/libm/powerpc/classic/s_nearbyint.c index 068e21378..d08430dc6 100644 --- a/libm/powerpc/classic/s_nearbyint.c +++ b/libm/powerpc/classic/s_nearbyint.c @@ -23,7 +23,7 @@ double nearbyint ( double x ) y = twoTo52; - asm ("mffs %0" : "=f" (OldEnvironment)); /* get the environement */ + __asm__ ("mffs %0" : "=f" (OldEnvironment)); /* get the environement */ if ( fabs ( x ) >= y ) /* huge case is exact */ return x; @@ -32,7 +32,7 @@ double nearbyint ( double x ) if ( y == 0.0 ) /* zero results mirror sign of x */ y = copysign ( y, x ); // restore old flags - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment )); return ( y ); } libm_hidden_def(nearbyint) diff --git a/libm/powerpc/classic/s_round.c b/libm/powerpc/classic/s_round.c index 62d5936d9..9fd73801d 100644 --- a/libm/powerpc/classic/s_round.c +++ b/libm/powerpc/classic/s_round.c @@ -51,7 +51,7 @@ double round ( double x ) * Is |x| < 1.0? * *******************************************************************************/ { - asm ("mffs %0" : "=f" (OldEnvironment.dbl)); // get environment + __asm__ ("mffs %0" : "=f" (OldEnvironment.dbl)); // get environment if ( xHead < 0x3fe00000ul ) /******************************************************************************* * Is |x| < 0.5? * @@ -59,7 +59,7 @@ double round ( double x ) { if ( ( xHead | argument.words.lo ) != 0ul ) OldEnvironment.words.lo |= 0x02000000ul; - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); if ( target ) return ( 0.0 ); else @@ -69,7 +69,7 @@ double round ( double x ) * Is 0.5 ² |x| < 1.0? * *******************************************************************************/ OldEnvironment.words.lo |= 0x02000000ul; - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); if ( target ) return ( 1.0 ); else diff --git a/libm/powerpc/classic/s_trunc.c b/libm/powerpc/classic/s_trunc.c index f793992a7..e9c668127 100644 --- a/libm/powerpc/classic/s_trunc.c +++ b/libm/powerpc/classic/s_trunc.c @@ -51,9 +51,9 @@ double trunc ( double x ) { if ( ( xhi | argument.words.lo ) != 0ul ) { // raise deserved INEXACT - asm ("mffs %0" : "=f" (OldEnvironment.dbl)); + __asm__ ("mffs %0" : "=f" (OldEnvironment.dbl)); OldEnvironment.words.lo |= 0x02000000ul; - asm ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); + __asm__ ("mtfsf 255,%0" : /*NULLOUT*/ : /*IN*/ "f" ( OldEnvironment.dbl )); } if ( target ) // return properly signed zero return ( 0.0 ); |