diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-04-24 09:24:59 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-04-24 09:24:59 +0000 |
commit | 1d8abd74c4ae9b28035b549345f9f736cdb98c10 (patch) | |
tree | 9a534ad59f2ddfc18076a92e3331128d4c5bd2da /libm/powerpc | |
parent | 1db4be5334a327dde925c73b8d924440257cf487 (diff) |
- fixup asm. No object-code changes
Diffstat (limited to 'libm/powerpc')
-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 | ||||
-rw-r--r-- | libm/powerpc/e500/fpu/fenv_libc.h | 4 | ||||
-rw-r--r-- | libm/powerpc/e500/spe-raise.c | 10 |
8 files changed, 39 insertions, 39 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 ); diff --git a/libm/powerpc/e500/fpu/fenv_libc.h b/libm/powerpc/e500/fpu/fenv_libc.h index cd003eab7..22c3f1452 100644 --- a/libm/powerpc/e500/fpu/fenv_libc.h +++ b/libm/powerpc/e500/fpu/fenv_libc.h @@ -28,11 +28,11 @@ extern int __feraiseexcept_internal (int __excepts); /* Equivalent to fegetenv, but returns a fenv_t instead of taking a pointer. */ #define fegetenv_register() \ - ({ unsigned fscr; asm volatile ("mfspefscr %0" : "=r" (fscr)); fscr; }) + ({ unsigned fscr; __asm__ __volatile__ ("mfspefscr %0" : "=r" (fscr)); fscr; }) /* Equivalent to fesetenv, but takes a fenv_t instead of a pointer. */ #define fesetenv_register(fscr) \ - ({ asm volatile ("mtspefscr %0" : : "r" (fscr)); }) + ({ __asm__ __volatile__ ("mtspefscr %0" : : "r" (fscr)); }) typedef union { diff --git a/libm/powerpc/e500/spe-raise.c b/libm/powerpc/e500/spe-raise.c index fb53dcec7..b83087fd0 100644 --- a/libm/powerpc/e500/spe-raise.c +++ b/libm/powerpc/e500/spe-raise.c @@ -33,33 +33,33 @@ __FERAISEEXCEPT_INTERNAL (int excepts) { /* ?? Does not set sticky bit ?? */ /* 0 / 0 */ - asm volatile ("efsdiv %0,%0,%1" : : "r" (0), "r" (0)); + __asm__ __volatile__ ("efsdiv %0,%0,%1" : : "r" (0), "r" (0)); } if ((FE_DIVBYZERO & excepts) != 0) { /* 1.0 / 0.0 */ - asm volatile ("efsdiv %0,%0,%1" : : "r" (1.0F), "r" (0)); + __asm__ __volatile__ ("efsdiv %0,%0,%1" : : "r" (1.0F), "r" (0)); } if ((FE_OVERFLOW & excepts) != 0) { /* ?? Does not set sticky bit ?? */ /* Largest normalized number plus itself. */ - asm volatile ("efsadd %0,%0,%1" : : "r" (0x7f7fffff), "r" (0x7f7fffff)); + __asm__ __volatile__ ("efsadd %0,%0,%1" : : "r" (0x7f7fffff), "r" (0x7f7fffff)); } if ((FE_UNDERFLOW & excepts) != 0) { /* ?? Does not set sticky bit ?? */ /* Smallest normalized number times itself. */ - asm volatile ("efsmul %0,%0,%1" : : "r" (0x800000), "r" (0x800000)); + __asm__ __volatile__ ("efsmul %0,%0,%1" : : "r" (0x800000), "r" (0x800000)); } if ((FE_INEXACT & excepts) != 0) { /* Smallest normalized minus 1.0 raises the inexact flag. */ - asm volatile ("efssub %0,%0,%1" : : "r" (0x00800000), "r" (1.0F)); + __asm__ __volatile__ ("efssub %0,%0,%1" : : "r" (0x00800000), "r" (1.0F)); } /* Success. */ |