diff mbox

[v4,5/9] softfloat: Clean up white spaces in softfloat-specialize.h

Message ID 1460465891-6142-6-git-send-email-aleksandar.markovic@rt-rk.com (mailing list archive)
State New, archived
Headers show

Commit Message

Aleksandar Markovic April 12, 2016, 12:58 p.m. UTC
From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>

As the development of SoftFloat library took places, many contributors
had different code styles, and the code was left with inconsistent style,
difficult to read, and hard to maintain.

This patch will make spaces around shift operators and braces consistent
within file fpu/softfloat-specialize.h.

Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
---
 fpu/softfloat-specialize.h |   94 ++++++++++++++++++++++----------------------
 1 file changed, 47 insertions(+), 47 deletions(-)
diff mbox

Patch

diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.h
index a5680e0..aa2f793 100644
--- a/fpu/softfloat-specialize.h
+++ b/fpu/softfloat-specialize.h
@@ -283,7 +283,7 @@  static commonNaNT float16ToCommonNaN(float16 a, float_status *status)
     }
     z.sign = float16_val(a) >> 15;
     z.low = 0;
-    z.high = ((uint64_t) float16_val(a))<<54;
+    z.high = ((uint64_t) float16_val(a)) << 54;
     return z;
 }
 
@@ -345,7 +345,7 @@  int float32_is_signaling_nan( float32 a_, float_status *status )
     if (status->snan_bit_is_one) {
         return ((uint32_t)(a << 1) >= 0xFF800000);
     } else {
-        return ( ( ( a>>22 ) & 0x1FF ) == 0x1FE ) && ( a & 0x003FFFFF );
+        return (((a >> 22) & 0x1FF) == 0x1FE) && (a & 0x003FFFFF);
     }
 }
 #endif
@@ -382,9 +382,9 @@  static commonNaNT float32ToCommonNaN(float32 a, float_status *status)
     if (float32_is_signaling_nan(a, status)) {
         float_raise(float_flag_invalid, status);
     }
-    z.sign = float32_val(a)>>31;
+    z.sign = float32_val(a) >> 31;
     z.low = 0;
-    z.high = ( (uint64_t) float32_val(a) )<<41;
+    z.high = ((uint64_t)float32_val(a)) << 41;
     return z;
 }
 
@@ -395,7 +395,7 @@  static commonNaNT float32ToCommonNaN(float32 a, float_status *status)
 
 static float32 commonNaNToFloat32(commonNaNT a, float_status *status)
 {
-    uint32_t mantissa = a.high>>41;
+    uint32_t mantissa = a.high >> 41;
 
     if (status->default_nan_mode) {
         return float32_default_nan(status);
@@ -403,7 +403,7 @@  static float32 commonNaNToFloat32(commonNaNT a, float_status *status)
 
     if ( mantissa ) {
         return make_float32(
-            ( ( (uint32_t) a.sign )<<31 ) | 0x7F800000 | ( a.high>>41 ) );
+            (((uint32_t)a.sign) << 31) | 0x7F800000 | (a.high >> 41));
     } else {
         return float32_default_nan(status);
     }
@@ -656,10 +656,10 @@  static float32 propagateFloat32NaN(float32 a, float32 b, float_status *status)
     flag aIsLargerSignificand;
     uint32_t av, bv;
 
-    aIsQuietNaN = float32_is_quiet_nan( a, status );
-    aIsSignalingNaN = float32_is_signaling_nan( a, status );
-    bIsQuietNaN = float32_is_quiet_nan( b, status );
-    bIsSignalingNaN = float32_is_signaling_nan( b, status );
+    aIsQuietNaN = float32_is_quiet_nan(a, status);
+    aIsSignalingNaN = float32_is_signaling_nan(a, status);
+    bIsQuietNaN = float32_is_quiet_nan(b, status);
+    bIsSignalingNaN = float32_is_signaling_nan(b, status);
     av = float32_val(a);
     bv = float32_val(b);
 
@@ -670,9 +670,9 @@  static float32 propagateFloat32NaN(float32 a, float32 b, float_status *status)
     if (status->default_nan_mode)
         return float32_default_nan(status);
 
-    if ((uint32_t)(av<<1) < (uint32_t)(bv<<1)) {
+    if ((uint32_t)(av << 1) < (uint32_t)(bv << 1)) {
         aIsLargerSignificand = 0;
-    } else if ((uint32_t)(bv<<1) < (uint32_t)(av<<1)) {
+    } else if ((uint32_t)(bv << 1) < (uint32_t)(av << 1)) {
         aIsLargerSignificand = 1;
     } else {
         aIsLargerSignificand = (av < bv) ? 1 : 0;
@@ -777,8 +777,8 @@  int float64_is_signaling_nan( float64 a_, float_status *status )
         return ((a << 1) >= 0xFFF0000000000000ULL);
     } else {
         return
-               ( ( ( a>>51 ) & 0xFFF ) == 0xFFE )
-            && ( a & LIT64( 0x0007FFFFFFFFFFFF ) );
+               (((a >> 51) & 0xFFF) == 0xFFE)
+            && (a & LIT64( 0x0007FFFFFFFFFFFF ));
     }
 }
 #endif
@@ -815,9 +815,9 @@  static commonNaNT float64ToCommonNaN(float64 a, float_status *status)
     if (float64_is_signaling_nan(a, status)) {
         float_raise(float_flag_invalid, status);
     }
-    z.sign = float64_val(a)>>63;
+    z.sign = float64_val(a) >> 63;
     z.low = 0;
-    z.high = float64_val(a)<<12;
+    z.high = float64_val(a) << 12;
     return z;
 }
 
@@ -828,7 +828,7 @@  static commonNaNT float64ToCommonNaN(float64 a, float_status *status)
 
 static float64 commonNaNToFloat64(commonNaNT a, float_status *status)
 {
-    uint64_t mantissa = a.high>>12;
+    uint64_t mantissa = a.high >> 12;
 
     if (status->default_nan_mode) {
         return float64_default_nan(status);
@@ -836,9 +836,9 @@  static float64 commonNaNToFloat64(commonNaNT a, float_status *status)
 
     if ( mantissa ) {
         return make_float64(
-              ( ( (uint64_t) a.sign )<<63 )
+              (((uint64_t)a.sign) << 63)
             | LIT64( 0x7FF0000000000000 )
-            | ( a.high>>12 ));
+            | (a.high >> 12));
     } else {
         return float64_default_nan(status);
     }
@@ -856,10 +856,10 @@  static float64 propagateFloat64NaN(float64 a, float64 b, float_status *status)
     flag aIsLargerSignificand;
     uint64_t av, bv;
 
-    aIsQuietNaN = float64_is_quiet_nan( a, status );
-    aIsSignalingNaN = float64_is_signaling_nan( a, status );
-    bIsQuietNaN = float64_is_quiet_nan( b, status );
-    bIsSignalingNaN = float64_is_signaling_nan( b, status );
+    aIsQuietNaN = float64_is_quiet_nan(a, status);
+    aIsSignalingNaN = float64_is_signaling_nan(a, status);
+    bIsQuietNaN = float64_is_quiet_nan(b, status);
+    bIsSignalingNaN = float64_is_signaling_nan(b, status);
     av = float64_val(a);
     bv = float64_val(b);
 
@@ -870,9 +870,9 @@  static float64 propagateFloat64NaN(float64 a, float64 b, float_status *status)
     if (status->default_nan_mode)
         return float64_default_nan(status);
 
-    if ((uint64_t)(av<<1) < (uint64_t)(bv<<1)) {
+    if ((uint64_t)(av << 1) < (uint64_t)(bv << 1)) {
         aIsLargerSignificand = 0;
-    } else if ((uint64_t)(bv<<1) < (uint64_t)(av<<1)) {
+    } else if ((uint64_t)(bv << 1) < (uint64_t)(av << 1)) {
         aIsLargerSignificand = 1;
     } else {
         aIsLargerSignificand = (av < bv) ? 1 : 0;
@@ -965,8 +965,8 @@  int floatx80_is_quiet_nan( floatx80 a, float_status *status )
             && (aLow << 1)
             && (a.low == aLow);
     } else {
-        return ( ( a.high & 0x7FFF ) == 0x7FFF )
-            && (LIT64( 0x8000000000000000 ) <= ((uint64_t) ( a.low<<1 )));
+        return ((a.high & 0x7FFF) == 0x7FFF)
+            && (LIT64( 0x8000000000000000 ) <= ((uint64_t)(a.low << 1)));
     }
 }
 
@@ -986,9 +986,9 @@  int floatx80_is_signaling_nan( floatx80 a, float_status *status )
 
         aLow = a.low & ~ LIT64( 0x4000000000000000 );
         return
-               ( ( a.high & 0x7FFF ) == 0x7FFF )
-            && (uint64_t) ( aLow<<1 )
-            && ( a.low == aLow );
+               ((a.high & 0x7FFF) == 0x7FFF)
+            && (uint64_t)(aLow << 1)
+            && (a.low == aLow);
     }
 }
 #endif
@@ -1053,7 +1053,7 @@  static floatx80 commonNaNToFloatx80(commonNaNT a, float_status *status)
 
     if (a.high >> 1) {
         z.low = LIT64( 0x8000000000000000 ) | a.high >> 1;
-        z.high = ( ( (uint16_t) a.sign )<<15 ) | 0x7FFF;
+        z.high = (((uint16_t)a.sign) << 15) | 0x7FFF;
     } else {
         z = floatx80_default_nan(status);
     }
@@ -1072,10 +1072,10 @@  static floatx80 propagateFloatx80NaN(floatx80 a, floatx80 b,
     flag aIsQuietNaN, aIsSignalingNaN, bIsQuietNaN, bIsSignalingNaN;
     flag aIsLargerSignificand;
 
-    aIsQuietNaN = floatx80_is_quiet_nan( a, status );
-    aIsSignalingNaN = floatx80_is_signaling_nan( a, status );
-    bIsQuietNaN = floatx80_is_quiet_nan( b, status );
-    bIsSignalingNaN = floatx80_is_signaling_nan( b, status );
+    aIsQuietNaN = floatx80_is_quiet_nan(a, status);
+    aIsSignalingNaN = floatx80_is_signaling_nan(a, status);
+    bIsQuietNaN = floatx80_is_quiet_nan(b, status);
+    bIsSignalingNaN = floatx80_is_signaling_nan(b, status);
 
     if (aIsSignalingNaN | bIsSignalingNaN) {
         float_raise(float_flag_invalid, status);
@@ -1142,8 +1142,8 @@  int float128_is_signaling_nan( float128 a, float_status *status )
             && (a.low || (a.high & 0x0000FFFFFFFFFFFFULL));
     } else {
         return
-               ( ( ( a.high>>47 ) & 0xFFFF ) == 0xFFFE )
-            && ( a.low || ( a.high & LIT64( 0x00007FFFFFFFFFFF ) ) );
+               (((a.high >> 47) & 0xFFFF) == 0xFFFE)
+            && (a.low || (a.high & LIT64( 0x00007FFFFFFFFFFF )));
     }
 }
 #endif
@@ -1179,8 +1179,8 @@  static commonNaNT float128ToCommonNaN(float128 a, float_status *status)
     if (float128_is_signaling_nan(a, status)) {
         float_raise(float_flag_invalid, status);
     }
-    z.sign = a.high>>63;
-    shortShift128Left( a.high, a.low, 16, &z.high, &z.low );
+    z.sign = a.high >> 63;
+    shortShift128Left(a.high, a.low, 16, &z.high, &z.low);
     return z;
 }
 
@@ -1197,8 +1197,8 @@  static float128 commonNaNToFloat128(commonNaNT a, float_status *status)
         return float128_default_nan(status);
     }
 
-    shift128Right( a.high, a.low, 16, &z.high, &z.low );
-    z.high |= ( ( (uint64_t) a.sign )<<63 ) | LIT64( 0x7FFF000000000000 );
+    shift128Right(a.high, a.low, 16, &z.high, &z.low);
+    z.high |= (((uint64_t)a.sign) << 63) | LIT64( 0x7FFF000000000000 );
     return z;
 }
 
@@ -1214,10 +1214,10 @@  static float128 propagateFloat128NaN(float128 a, float128 b,
     flag aIsQuietNaN, aIsSignalingNaN, bIsQuietNaN, bIsSignalingNaN;
     flag aIsLargerSignificand;
 
-    aIsQuietNaN = float128_is_quiet_nan( a, status );
-    aIsSignalingNaN = float128_is_signaling_nan( a, status );
-    bIsQuietNaN = float128_is_quiet_nan( b, status );
-    bIsSignalingNaN = float128_is_signaling_nan( b, status );
+    aIsQuietNaN = float128_is_quiet_nan(a, status);
+    aIsSignalingNaN = float128_is_signaling_nan(a, status);
+    bIsQuietNaN = float128_is_quiet_nan(b, status);
+    bIsSignalingNaN = float128_is_signaling_nan(b, status);
 
     if (aIsSignalingNaN | bIsSignalingNaN) {
         float_raise(float_flag_invalid, status);
@@ -1227,9 +1227,9 @@  static float128 propagateFloat128NaN(float128 a, float128 b,
         return float128_default_nan(status);
     }
 
-    if (lt128(a.high<<1, a.low, b.high<<1, b.low)) {
+    if (lt128(a.high << 1, a.low, b.high << 1, b.low)) {
         aIsLargerSignificand = 0;
-    } else if (lt128(b.high<<1, b.low, a.high<<1, a.low)) {
+    } else if (lt128(b.high << 1, b.low, a.high << 1, a.low)) {
         aIsLargerSignificand = 1;
     } else {
         aIsLargerSignificand = (a.high < b.high) ? 1 : 0;