/* softfloat (and in particular the code in softfloat-specialize.h) is
* target-dependent and needs the TARGET_* macros.
*/
-#include "config.h"
+#include "qemu/osdep.h"
#include "fpu/softfloat.h"
/* We only need stdlib for abort() */
-#include <stdlib.h>
/*----------------------------------------------------------------------------
| Primitive arithmetic functions, including multi-word arithmetic, and
| Returns the exponent bits of the half-precision floating-point value `a'.
*----------------------------------------------------------------------------*/
-static inline int_fast16_t extractFloat16Exp(float16 a)
+static inline int extractFloat16Exp(float16 a)
{
return (float16_val(a) >> 10) & 0x1f;
}
| positive or negative integer is returned.
*----------------------------------------------------------------------------*/
-static int32 roundAndPackInt32(flag zSign, uint64_t absZ, float_status *status)
+static int32_t roundAndPackInt32(flag zSign, uint64_t absZ, float_status *status)
{
- int8 roundingMode;
+ int8_t roundingMode;
flag roundNearestEven;
- int8 roundIncrement, roundBits;
+ int8_t roundIncrement, roundBits;
int32_t z;
roundingMode = status->float_rounding_mode;
| returned.
*----------------------------------------------------------------------------*/
-static int64 roundAndPackInt64(flag zSign, uint64_t absZ0, uint64_t absZ1,
+static int64_t roundAndPackInt64(flag zSign, uint64_t absZ0, uint64_t absZ1,
float_status *status)
{
- int8 roundingMode;
+ int8_t roundingMode;
flag roundNearestEven, increment;
int64_t z;
| exception is raised and the largest unsigned integer is returned.
*----------------------------------------------------------------------------*/
-static int64 roundAndPackUint64(flag zSign, uint64_t absZ0,
+static int64_t roundAndPackUint64(flag zSign, uint64_t absZ0,
uint64_t absZ1, float_status *status)
{
- int8 roundingMode;
+ int8_t roundingMode;
flag roundNearestEven, increment;
roundingMode = status->float_rounding_mode;
| Returns the exponent bits of the single-precision floating-point value `a'.
*----------------------------------------------------------------------------*/
-static inline int_fast16_t extractFloat32Exp(float32 a)
+static inline int extractFloat32Exp(float32 a)
{
return ( float32_val(a)>>23 ) & 0xFF;
*----------------------------------------------------------------------------*/
static void
- normalizeFloat32Subnormal(uint32_t aSig, int_fast16_t *zExpPtr, uint32_t *zSigPtr)
+ normalizeFloat32Subnormal(uint32_t aSig, int *zExpPtr, uint32_t *zSigPtr)
{
- int8 shiftCount;
+ int8_t shiftCount;
shiftCount = countLeadingZeros32( aSig ) - 8;
*zSigPtr = aSig<<shiftCount;
| significand.
*----------------------------------------------------------------------------*/
-static inline float32 packFloat32(flag zSign, int_fast16_t zExp, uint32_t zSig)
+static inline float32 packFloat32(flag zSign, int zExp, uint32_t zSig)
{
return make_float32(
| Binary Floating-Point Arithmetic.
*----------------------------------------------------------------------------*/
-static float32 roundAndPackFloat32(flag zSign, int_fast16_t zExp, uint32_t zSig,
+static float32 roundAndPackFloat32(flag zSign, int zExp, uint32_t zSig,
float_status *status)
{
- int8 roundingMode;
+ int8_t roundingMode;
flag roundNearestEven;
- int8 roundIncrement, roundBits;
+ int8_t roundIncrement, roundBits;
flag isTiny;
roundingMode = status->float_rounding_mode;
*----------------------------------------------------------------------------*/
static float32
- normalizeRoundAndPackFloat32(flag zSign, int_fast16_t zExp, uint32_t zSig,
+ normalizeRoundAndPackFloat32(flag zSign, int zExp, uint32_t zSig,
float_status *status)
{
- int8 shiftCount;
+ int8_t shiftCount;
shiftCount = countLeadingZeros32( zSig ) - 1;
return roundAndPackFloat32(zSign, zExp - shiftCount, zSig<<shiftCount,
| Returns the exponent bits of the double-precision floating-point value `a'.
*----------------------------------------------------------------------------*/
-static inline int_fast16_t extractFloat64Exp(float64 a)
+static inline int extractFloat64Exp(float64 a)
{
return ( float64_val(a)>>52 ) & 0x7FF;
*----------------------------------------------------------------------------*/
static void
- normalizeFloat64Subnormal(uint64_t aSig, int_fast16_t *zExpPtr, uint64_t *zSigPtr)
+ normalizeFloat64Subnormal(uint64_t aSig, int *zExpPtr, uint64_t *zSigPtr)
{
- int8 shiftCount;
+ int8_t shiftCount;
shiftCount = countLeadingZeros64( aSig ) - 11;
*zSigPtr = aSig<<shiftCount;
| significand.
*----------------------------------------------------------------------------*/
-static inline float64 packFloat64(flag zSign, int_fast16_t zExp, uint64_t zSig)
+static inline float64 packFloat64(flag zSign, int zExp, uint64_t zSig)
{
return make_float64(
| Binary Floating-Point Arithmetic.
*----------------------------------------------------------------------------*/
-static float64 roundAndPackFloat64(flag zSign, int_fast16_t zExp, uint64_t zSig,
+static float64 roundAndPackFloat64(flag zSign, int zExp, uint64_t zSig,
float_status *status)
{
- int8 roundingMode;
+ int8_t roundingMode;
flag roundNearestEven;
- int_fast16_t roundIncrement, roundBits;
+ int roundIncrement, roundBits;
flag isTiny;
roundingMode = status->float_rounding_mode;
*----------------------------------------------------------------------------*/
static float64
- normalizeRoundAndPackFloat64(flag zSign, int_fast16_t zExp, uint64_t zSig,
+ normalizeRoundAndPackFloat64(flag zSign, int zExp, uint64_t zSig,
float_status *status)
{
- int8 shiftCount;
+ int8_t shiftCount;
shiftCount = countLeadingZeros64( zSig ) - 1;
return roundAndPackFloat64(zSign, zExp - shiftCount, zSig<<shiftCount,
| value `a'.
*----------------------------------------------------------------------------*/
-static inline int32 extractFloatx80Exp( floatx80 a )
+static inline int32_t extractFloatx80Exp( floatx80 a )
{
return a.high & 0x7FFF;
*----------------------------------------------------------------------------*/
static void
- normalizeFloatx80Subnormal( uint64_t aSig, int32 *zExpPtr, uint64_t *zSigPtr )
+ normalizeFloatx80Subnormal( uint64_t aSig, int32_t *zExpPtr, uint64_t *zSigPtr )
{
- int8 shiftCount;
+ int8_t shiftCount;
shiftCount = countLeadingZeros64( aSig );
*zSigPtr = aSig<<shiftCount;
| extended double-precision floating-point value, returning the result.
*----------------------------------------------------------------------------*/
-static inline floatx80 packFloatx80( flag zSign, int32 zExp, uint64_t zSig )
+static inline floatx80 packFloatx80( flag zSign, int32_t zExp, uint64_t zSig )
{
floatx80 z;
| Floating-Point Arithmetic.
*----------------------------------------------------------------------------*/
-static floatx80 roundAndPackFloatx80(int8 roundingPrecision, flag zSign,
- int32 zExp, uint64_t zSig0, uint64_t zSig1,
+static floatx80 roundAndPackFloatx80(int8_t roundingPrecision, flag zSign,
+ int32_t zExp, uint64_t zSig0, uint64_t zSig1,
float_status *status)
{
- int8 roundingMode;
+ int8_t roundingMode;
flag roundNearestEven, increment, isTiny;
- int64 roundIncrement, roundMask, roundBits;
+ int64_t roundIncrement, roundMask, roundBits;
roundingMode = status->float_rounding_mode;
roundNearestEven = ( roundingMode == float_round_nearest_even );
| normalized.
*----------------------------------------------------------------------------*/
-static floatx80 normalizeRoundAndPackFloatx80(int8 roundingPrecision,
- flag zSign, int32 zExp,
+static floatx80 normalizeRoundAndPackFloatx80(int8_t roundingPrecision,
+ flag zSign, int32_t zExp,
uint64_t zSig0, uint64_t zSig1,
float_status *status)
{
- int8 shiftCount;
+ int8_t shiftCount;
if ( zSig0 == 0 ) {
zSig0 = zSig1;
| `a'.
*----------------------------------------------------------------------------*/
-static inline int32 extractFloat128Exp( float128 a )
+static inline int32_t extractFloat128Exp( float128 a )
{
return ( a.high>>48 ) & 0x7FFF;
normalizeFloat128Subnormal(
uint64_t aSig0,
uint64_t aSig1,
- int32 *zExpPtr,
+ int32_t *zExpPtr,
uint64_t *zSig0Ptr,
uint64_t *zSig1Ptr
)
{
- int8 shiftCount;
+ int8_t shiftCount;
if ( aSig0 == 0 ) {
shiftCount = countLeadingZeros64( aSig1 ) - 15;
*----------------------------------------------------------------------------*/
static inline float128
- packFloat128( flag zSign, int32 zExp, uint64_t zSig0, uint64_t zSig1 )
+ packFloat128( flag zSign, int32_t zExp, uint64_t zSig0, uint64_t zSig1 )
{
float128 z;
| overflow follows the IEC/IEEE Standard for Binary Floating-Point Arithmetic.
*----------------------------------------------------------------------------*/
-static float128 roundAndPackFloat128(flag zSign, int32 zExp,
+static float128 roundAndPackFloat128(flag zSign, int32_t zExp,
uint64_t zSig0, uint64_t zSig1,
uint64_t zSig2, float_status *status)
{
- int8 roundingMode;
+ int8_t roundingMode;
flag roundNearestEven, increment, isTiny;
roundingMode = status->float_rounding_mode;
| point exponent.
*----------------------------------------------------------------------------*/
-static float128 normalizeRoundAndPackFloat128(flag zSign, int32 zExp,
+static float128 normalizeRoundAndPackFloat128(flag zSign, int32_t zExp,
uint64_t zSig0, uint64_t zSig1,
float_status *status)
{
- int8 shiftCount;
+ int8_t shiftCount;
uint64_t zSig2;
if ( zSig0 == 0 ) {
float64 int32_to_float64(int32_t a, float_status *status)
{
flag zSign;
- uint32 absA;
- int8 shiftCount;
+ uint32_t absA;
+ int8_t shiftCount;
uint64_t zSig;
if ( a == 0 ) return float64_zero;
floatx80 int32_to_floatx80(int32_t a, float_status *status)
{
flag zSign;
- uint32 absA;
- int8 shiftCount;
+ uint32_t absA;
+ int8_t shiftCount;
uint64_t zSig;
if ( a == 0 ) return packFloatx80( 0, 0, 0 );
float128 int32_to_float128(int32_t a, float_status *status)
{
flag zSign;
- uint32 absA;
- int8 shiftCount;
+ uint32_t absA;
+ int8_t shiftCount;
uint64_t zSig0;
if ( a == 0 ) return packFloat128( 0, 0, 0, 0 );
float32 int64_to_float32(int64_t a, float_status *status)
{
flag zSign;
- uint64 absA;
- int8 shiftCount;
+ uint64_t absA;
+ int8_t shiftCount;
if ( a == 0 ) return float32_zero;
zSign = ( a < 0 );
floatx80 int64_to_floatx80(int64_t a, float_status *status)
{
flag zSign;
- uint64 absA;
- int8 shiftCount;
+ uint64_t absA;
+ int8_t shiftCount;
if ( a == 0 ) return packFloatx80( 0, 0, 0 );
zSign = ( a < 0 );
float128 int64_to_float128(int64_t a, float_status *status)
{
flag zSign;
- uint64 absA;
- int8 shiftCount;
- int32 zExp;
+ uint64_t absA;
+ int8_t shiftCount;
+ int32_t zExp;
uint64_t zSig0, zSig1;
if ( a == 0 ) return packFloat128( 0, 0, 0, 0 );
| largest integer with the same sign as `a' is returned.
*----------------------------------------------------------------------------*/
-int32 float32_to_int32(float32 a, float_status *status)
+int32_t float32_to_int32(float32 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp, shiftCount;
+ int aExp;
+ int shiftCount;
uint32_t aSig;
uint64_t aSig64;
| returned.
*----------------------------------------------------------------------------*/
-int32 float32_to_int32_round_to_zero(float32 a, float_status *status)
+int32_t float32_to_int32_round_to_zero(float32 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp, shiftCount;
+ int aExp;
+ int shiftCount;
uint32_t aSig;
int32_t z;
a = float32_squash_input_denormal(a, status);
| returned.
*----------------------------------------------------------------------------*/
-int_fast16_t float32_to_int16_round_to_zero(float32 a, float_status *status)
+int16_t float32_to_int16_round_to_zero(float32 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp, shiftCount;
+ int aExp;
+ int shiftCount;
uint32_t aSig;
- int32 z;
+ int32_t z;
aSig = extractFloat32Frac( a );
aExp = extractFloat32Exp( a );
| largest integer with the same sign as `a' is returned.
*----------------------------------------------------------------------------*/
-int64 float32_to_int64(float32 a, float_status *status)
+int64_t float32_to_int64(float32 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp, shiftCount;
+ int aExp;
+ int shiftCount;
uint32_t aSig;
uint64_t aSig64, aSigExtra;
a = float32_squash_input_denormal(a, status);
| raise the inexact exception flag.
*----------------------------------------------------------------------------*/
-uint64 float32_to_uint64(float32 a, float_status *status)
+uint64_t float32_to_uint64(float32 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp, shiftCount;
+ int aExp;
+ int shiftCount;
uint32_t aSig;
uint64_t aSig64, aSigExtra;
a = float32_squash_input_denormal(a, status);
| not round to zero will raise the inexact flag.
*----------------------------------------------------------------------------*/
-uint64 float32_to_uint64_round_to_zero(float32 a, float_status *status)
+uint64_t float32_to_uint64_round_to_zero(float32 a, float_status *status)
{
signed char current_rounding_mode = status->float_rounding_mode;
set_float_rounding_mode(float_round_to_zero, status);
| returned.
*----------------------------------------------------------------------------*/
-int64 float32_to_int64_round_to_zero(float32 a, float_status *status)
+int64_t float32_to_int64_round_to_zero(float32 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp, shiftCount;
+ int aExp;
+ int shiftCount;
uint32_t aSig;
uint64_t aSig64;
- int64 z;
+ int64_t z;
a = float32_squash_input_denormal(a, status);
aSig = extractFloat32Frac( a );
float64 float32_to_float64(float32 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp;
+ int aExp;
uint32_t aSig;
a = float32_squash_input_denormal(a, status);
floatx80 float32_to_floatx80(float32 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp;
+ int aExp;
uint32_t aSig;
a = float32_squash_input_denormal(a, status);
float128 float32_to_float128(float32 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp;
+ int aExp;
uint32_t aSig;
a = float32_squash_input_denormal(a, status);
float32 float32_round_to_int(float32 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp;
+ int aExp;
uint32_t lastBitMask, roundBitsMask;
uint32_t z;
a = float32_squash_input_denormal(a, status);
static float32 addFloat32Sigs(float32 a, float32 b, flag zSign,
float_status *status)
{
- int_fast16_t aExp, bExp, zExp;
+ int aExp, bExp, zExp;
uint32_t aSig, bSig, zSig;
- int_fast16_t expDiff;
+ int expDiff;
aSig = extractFloat32Frac( a );
aExp = extractFloat32Exp( a );
static float32 subFloat32Sigs(float32 a, float32 b, flag zSign,
float_status *status)
{
- int_fast16_t aExp, bExp, zExp;
+ int aExp, bExp, zExp;
uint32_t aSig, bSig, zSig;
- int_fast16_t expDiff;
+ int expDiff;
aSig = extractFloat32Frac( a );
aExp = extractFloat32Exp( a );
float32 float32_mul(float32 a, float32 b, float_status *status)
{
flag aSign, bSign, zSign;
- int_fast16_t aExp, bExp, zExp;
+ int aExp, bExp, zExp;
uint32_t aSig, bSig;
uint64_t zSig64;
uint32_t zSig;
float32 float32_div(float32 a, float32 b, float_status *status)
{
flag aSign, bSign, zSign;
- int_fast16_t aExp, bExp, zExp;
+ int aExp, bExp, zExp;
uint32_t aSig, bSig, zSig;
a = float32_squash_input_denormal(a, status);
b = float32_squash_input_denormal(b, status);
float32 float32_rem(float32 a, float32 b, float_status *status)
{
flag aSign, zSign;
- int_fast16_t aExp, bExp, expDiff;
+ int aExp, bExp, expDiff;
uint32_t aSig, bSig;
uint32_t q;
uint64_t aSig64, bSig64, q64;
float_status *status)
{
flag aSign, bSign, cSign, zSign;
- int_fast16_t aExp, bExp, cExp, pExp, zExp, expDiff;
+ int aExp, bExp, cExp, pExp, zExp, expDiff;
uint32_t aSig, bSig, cSig;
flag pInf, pZero, pSign;
uint64_t pSig64, cSig64, zSig64;
float32 float32_sqrt(float32 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp, zExp;
+ int aExp, zExp;
uint32_t aSig, zSig;
uint64_t rem, term;
a = float32_squash_input_denormal(a, status);
float32 float32_exp2(float32 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp;
+ int aExp;
uint32_t aSig;
float64 r, x, xn;
int i;
float32 float32_log2(float32 a, float_status *status)
{
flag aSign, zSign;
- int_fast16_t aExp;
+ int aExp;
uint32_t aSig, zSig, i;
a = float32_squash_input_denormal(a, status);
| largest integer with the same sign as `a' is returned.
*----------------------------------------------------------------------------*/
-int32 float64_to_int32(float64 a, float_status *status)
+int32_t float64_to_int32(float64 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp, shiftCount;
+ int aExp;
+ int shiftCount;
uint64_t aSig;
a = float64_squash_input_denormal(a, status);
| returned.
*----------------------------------------------------------------------------*/
-int32 float64_to_int32_round_to_zero(float64 a, float_status *status)
+int32_t float64_to_int32_round_to_zero(float64 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp, shiftCount;
+ int aExp;
+ int shiftCount;
uint64_t aSig, savedASig;
int32_t z;
a = float64_squash_input_denormal(a, status);
| returned.
*----------------------------------------------------------------------------*/
-int_fast16_t float64_to_int16_round_to_zero(float64 a, float_status *status)
+int16_t float64_to_int16_round_to_zero(float64 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp, shiftCount;
+ int aExp;
+ int shiftCount;
uint64_t aSig, savedASig;
- int32 z;
+ int32_t z;
aSig = extractFloat64Frac( a );
aExp = extractFloat64Exp( a );
| largest integer with the same sign as `a' is returned.
*----------------------------------------------------------------------------*/
-int64 float64_to_int64(float64 a, float_status *status)
+int64_t float64_to_int64(float64 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp, shiftCount;
+ int aExp;
+ int shiftCount;
uint64_t aSig, aSigExtra;
a = float64_squash_input_denormal(a, status);
| returned.
*----------------------------------------------------------------------------*/
-int64 float64_to_int64_round_to_zero(float64 a, float_status *status)
+int64_t float64_to_int64_round_to_zero(float64 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp, shiftCount;
+ int aExp;
+ int shiftCount;
uint64_t aSig;
- int64 z;
+ int64_t z;
a = float64_squash_input_denormal(a, status);
aSig = extractFloat64Frac( a );
float32 float64_to_float32(float64 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp;
+ int aExp;
uint64_t aSig;
uint32_t zSig;
a = float64_squash_input_denormal(a, status);
| than the desired result exponent whenever `zSig' is a complete, normalized
| significand.
*----------------------------------------------------------------------------*/
-static float16 packFloat16(flag zSign, int_fast16_t zExp, uint16_t zSig)
+static float16 packFloat16(flag zSign, int zExp, uint16_t zSig)
{
return make_float16(
(((uint32_t)zSign) << 15) + (((uint32_t)zExp) << 10) + zSig);
| Binary Floating-Point Arithmetic.
*----------------------------------------------------------------------------*/
-static float32 roundAndPackFloat16(flag zSign, int_fast16_t zExp,
+static float16 roundAndPackFloat16(flag zSign, int zExp,
uint32_t zSig, flag ieee,
float_status *status)
{
return packFloat16(zSign, zExp, zSig >> 13);
}
-static void normalizeFloat16Subnormal(uint32_t aSig, int_fast16_t *zExpPtr,
+static void normalizeFloat16Subnormal(uint32_t aSig, int *zExpPtr,
uint32_t *zSigPtr)
{
int8_t shiftCount = countLeadingZeros32(aSig) - 21;
float32 float16_to_float32(float16 a, flag ieee, float_status *status)
{
flag aSign;
- int_fast16_t aExp;
+ int aExp;
uint32_t aSig;
aSign = extractFloat16Sign(a);
float16 float32_to_float16(float32 a, flag ieee, float_status *status)
{
flag aSign;
- int_fast16_t aExp;
+ int aExp;
uint32_t aSig;
a = float32_squash_input_denormal(a, status);
float64 float16_to_float64(float16 a, flag ieee, float_status *status)
{
flag aSign;
- int_fast16_t aExp;
+ int aExp;
uint32_t aSig;
aSign = extractFloat16Sign(a);
float16 float64_to_float16(float64 a, flag ieee, float_status *status)
{
flag aSign;
- int_fast16_t aExp;
+ int aExp;
uint64_t aSig;
uint32_t zSig;
floatx80 float64_to_floatx80(float64 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp;
+ int aExp;
uint64_t aSig;
a = float64_squash_input_denormal(a, status);
float128 float64_to_float128(float64 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp;
+ int aExp;
uint64_t aSig, zSig0, zSig1;
a = float64_squash_input_denormal(a, status);
float64 float64_round_to_int(float64 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp;
+ int aExp;
uint64_t lastBitMask, roundBitsMask;
uint64_t z;
a = float64_squash_input_denormal(a, status);
static float64 addFloat64Sigs(float64 a, float64 b, flag zSign,
float_status *status)
{
- int_fast16_t aExp, bExp, zExp;
+ int aExp, bExp, zExp;
uint64_t aSig, bSig, zSig;
- int_fast16_t expDiff;
+ int expDiff;
aSig = extractFloat64Frac( a );
aExp = extractFloat64Exp( a );
static float64 subFloat64Sigs(float64 a, float64 b, flag zSign,
float_status *status)
{
- int_fast16_t aExp, bExp, zExp;
+ int aExp, bExp, zExp;
uint64_t aSig, bSig, zSig;
- int_fast16_t expDiff;
+ int expDiff;
aSig = extractFloat64Frac( a );
aExp = extractFloat64Exp( a );
float64 float64_mul(float64 a, float64 b, float_status *status)
{
flag aSign, bSign, zSign;
- int_fast16_t aExp, bExp, zExp;
+ int aExp, bExp, zExp;
uint64_t aSig, bSig, zSig0, zSig1;
a = float64_squash_input_denormal(a, status);
float64 float64_div(float64 a, float64 b, float_status *status)
{
flag aSign, bSign, zSign;
- int_fast16_t aExp, bExp, zExp;
+ int aExp, bExp, zExp;
uint64_t aSig, bSig, zSig;
uint64_t rem0, rem1;
uint64_t term0, term1;
float64 float64_rem(float64 a, float64 b, float_status *status)
{
flag aSign, zSign;
- int_fast16_t aExp, bExp, expDiff;
+ int aExp, bExp, expDiff;
uint64_t aSig, bSig;
uint64_t q, alternateASig;
int64_t sigMean;
float_status *status)
{
flag aSign, bSign, cSign, zSign;
- int_fast16_t aExp, bExp, cExp, pExp, zExp, expDiff;
+ int aExp, bExp, cExp, pExp, zExp, expDiff;
uint64_t aSig, bSig, cSig;
flag pInf, pZero, pSign;
uint64_t pSig0, pSig1, cSig0, cSig1, zSig0, zSig1;
float64 float64_sqrt(float64 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp, zExp;
+ int aExp, zExp;
uint64_t aSig, zSig, doubleZSig;
uint64_t rem0, rem1, term0, term1;
a = float64_squash_input_denormal(a, status);
float64 float64_log2(float64 a, float_status *status)
{
flag aSign, zSign;
- int_fast16_t aExp;
+ int aExp;
uint64_t aSig, aSig0, aSig1, zSig, i;
a = float64_squash_input_denormal(a, status);
| overflows, the largest integer with the same sign as `a' is returned.
*----------------------------------------------------------------------------*/
-int32 floatx80_to_int32(floatx80 a, float_status *status)
+int32_t floatx80_to_int32(floatx80 a, float_status *status)
{
flag aSign;
- int32 aExp, shiftCount;
+ int32_t aExp, shiftCount;
uint64_t aSig;
aSig = extractFloatx80Frac( a );
| sign as `a' is returned.
*----------------------------------------------------------------------------*/
-int32 floatx80_to_int32_round_to_zero(floatx80 a, float_status *status)
+int32_t floatx80_to_int32_round_to_zero(floatx80 a, float_status *status)
{
flag aSign;
- int32 aExp, shiftCount;
+ int32_t aExp, shiftCount;
uint64_t aSig, savedASig;
int32_t z;
| overflows, the largest integer with the same sign as `a' is returned.
*----------------------------------------------------------------------------*/
-int64 floatx80_to_int64(floatx80 a, float_status *status)
+int64_t floatx80_to_int64(floatx80 a, float_status *status)
{
flag aSign;
- int32 aExp, shiftCount;
+ int32_t aExp, shiftCount;
uint64_t aSig, aSigExtra;
aSig = extractFloatx80Frac( a );
| sign as `a' is returned.
*----------------------------------------------------------------------------*/
-int64 floatx80_to_int64_round_to_zero(floatx80 a, float_status *status)
+int64_t floatx80_to_int64_round_to_zero(floatx80 a, float_status *status)
{
flag aSign;
- int32 aExp, shiftCount;
+ int32_t aExp, shiftCount;
uint64_t aSig;
- int64 z;
+ int64_t z;
aSig = extractFloatx80Frac( a );
aExp = extractFloatx80Exp( a );
float32 floatx80_to_float32(floatx80 a, float_status *status)
{
flag aSign;
- int32 aExp;
+ int32_t aExp;
uint64_t aSig;
aSig = extractFloatx80Frac( a );
float64 floatx80_to_float64(floatx80 a, float_status *status)
{
flag aSign;
- int32 aExp;
+ int32_t aExp;
uint64_t aSig, zSig;
aSig = extractFloatx80Frac( a );
float128 floatx80_to_float128(floatx80 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp;
+ int aExp;
uint64_t aSig, zSig0, zSig1;
aSig = extractFloatx80Frac( a );
floatx80 floatx80_round_to_int(floatx80 a, float_status *status)
{
flag aSign;
- int32 aExp;
+ int32_t aExp;
uint64_t lastBitMask, roundBitsMask;
floatx80 z;
static floatx80 addFloatx80Sigs(floatx80 a, floatx80 b, flag zSign,
float_status *status)
{
- int32 aExp, bExp, zExp;
+ int32_t aExp, bExp, zExp;
uint64_t aSig, bSig, zSig0, zSig1;
- int32 expDiff;
+ int32_t expDiff;
aSig = extractFloatx80Frac( a );
aExp = extractFloatx80Exp( a );
static floatx80 subFloatx80Sigs(floatx80 a, floatx80 b, flag zSign,
float_status *status)
{
- int32 aExp, bExp, zExp;
+ int32_t aExp, bExp, zExp;
uint64_t aSig, bSig, zSig0, zSig1;
- int32 expDiff;
+ int32_t expDiff;
floatx80 z;
aSig = extractFloatx80Frac( a );
floatx80 floatx80_mul(floatx80 a, floatx80 b, float_status *status)
{
flag aSign, bSign, zSign;
- int32 aExp, bExp, zExp;
+ int32_t aExp, bExp, zExp;
uint64_t aSig, bSig, zSig0, zSig1;
floatx80 z;
floatx80 floatx80_div(floatx80 a, floatx80 b, float_status *status)
{
flag aSign, bSign, zSign;
- int32 aExp, bExp, zExp;
+ int32_t aExp, bExp, zExp;
uint64_t aSig, bSig, zSig0, zSig1;
uint64_t rem0, rem1, rem2, term0, term1, term2;
floatx80 z;
floatx80 floatx80_rem(floatx80 a, floatx80 b, float_status *status)
{
flag aSign, zSign;
- int32 aExp, bExp, expDiff;
+ int32_t aExp, bExp, expDiff;
uint64_t aSig0, aSig1, bSig;
uint64_t q, term0, term1, alternateASig0, alternateASig1;
floatx80 z;
floatx80 floatx80_sqrt(floatx80 a, float_status *status)
{
flag aSign;
- int32 aExp, zExp;
+ int32_t aExp, zExp;
uint64_t aSig0, aSig1, zSig0, zSig1, doubleZSig0;
uint64_t rem0, rem1, rem2, rem3, term0, term1, term2, term3;
floatx80 z;
| largest integer with the same sign as `a' is returned.
*----------------------------------------------------------------------------*/
-int32 float128_to_int32(float128 a, float_status *status)
+int32_t float128_to_int32(float128 a, float_status *status)
{
flag aSign;
- int32 aExp, shiftCount;
+ int32_t aExp, shiftCount;
uint64_t aSig0, aSig1;
aSig1 = extractFloat128Frac1( a );
| returned.
*----------------------------------------------------------------------------*/
-int32 float128_to_int32_round_to_zero(float128 a, float_status *status)
+int32_t float128_to_int32_round_to_zero(float128 a, float_status *status)
{
flag aSign;
- int32 aExp, shiftCount;
+ int32_t aExp, shiftCount;
uint64_t aSig0, aSig1, savedASig;
int32_t z;
| largest integer with the same sign as `a' is returned.
*----------------------------------------------------------------------------*/
-int64 float128_to_int64(float128 a, float_status *status)
+int64_t float128_to_int64(float128 a, float_status *status)
{
flag aSign;
- int32 aExp, shiftCount;
+ int32_t aExp, shiftCount;
uint64_t aSig0, aSig1;
aSig1 = extractFloat128Frac1( a );
| returned.
*----------------------------------------------------------------------------*/
-int64 float128_to_int64_round_to_zero(float128 a, float_status *status)
+int64_t float128_to_int64_round_to_zero(float128 a, float_status *status)
{
flag aSign;
- int32 aExp, shiftCount;
+ int32_t aExp, shiftCount;
uint64_t aSig0, aSig1;
- int64 z;
+ int64_t z;
aSig1 = extractFloat128Frac1( a );
aSig0 = extractFloat128Frac0( a );
float32 float128_to_float32(float128 a, float_status *status)
{
flag aSign;
- int32 aExp;
+ int32_t aExp;
uint64_t aSig0, aSig1;
uint32_t zSig;
float64 float128_to_float64(float128 a, float_status *status)
{
flag aSign;
- int32 aExp;
+ int32_t aExp;
uint64_t aSig0, aSig1;
aSig1 = extractFloat128Frac1( a );
floatx80 float128_to_floatx80(float128 a, float_status *status)
{
flag aSign;
- int32 aExp;
+ int32_t aExp;
uint64_t aSig0, aSig1;
aSig1 = extractFloat128Frac1( a );
float128 float128_round_to_int(float128 a, float_status *status)
{
flag aSign;
- int32 aExp;
+ int32_t aExp;
uint64_t lastBitMask, roundBitsMask;
float128 z;
static float128 addFloat128Sigs(float128 a, float128 b, flag zSign,
float_status *status)
{
- int32 aExp, bExp, zExp;
+ int32_t aExp, bExp, zExp;
uint64_t aSig0, aSig1, bSig0, bSig1, zSig0, zSig1, zSig2;
- int32 expDiff;
+ int32_t expDiff;
aSig1 = extractFloat128Frac1( a );
aSig0 = extractFloat128Frac0( a );
static float128 subFloat128Sigs(float128 a, float128 b, flag zSign,
float_status *status)
{
- int32 aExp, bExp, zExp;
+ int32_t aExp, bExp, zExp;
uint64_t aSig0, aSig1, bSig0, bSig1, zSig0, zSig1;
- int32 expDiff;
+ int32_t expDiff;
float128 z;
aSig1 = extractFloat128Frac1( a );
float128 float128_mul(float128 a, float128 b, float_status *status)
{
flag aSign, bSign, zSign;
- int32 aExp, bExp, zExp;
+ int32_t aExp, bExp, zExp;
uint64_t aSig0, aSig1, bSig0, bSig1, zSig0, zSig1, zSig2, zSig3;
float128 z;
float128 float128_div(float128 a, float128 b, float_status *status)
{
flag aSign, bSign, zSign;
- int32 aExp, bExp, zExp;
+ int32_t aExp, bExp, zExp;
uint64_t aSig0, aSig1, bSig0, bSig1, zSig0, zSig1, zSig2;
uint64_t rem0, rem1, rem2, rem3, term0, term1, term2, term3;
float128 z;
float128 float128_rem(float128 a, float128 b, float_status *status)
{
flag aSign, zSign;
- int32 aExp, bExp, expDiff;
+ int32_t aExp, bExp, expDiff;
uint64_t aSig0, aSig1, bSig0, bSig1, q, term0, term1, term2;
uint64_t allZero, alternateASig0, alternateASig1, sigMean1;
int64_t sigMean0;
float128 float128_sqrt(float128 a, float_status *status)
{
flag aSign;
- int32 aExp, zExp;
+ int32_t aExp, zExp;
uint64_t aSig0, aSig1, zSig0, zSig1, zSig2, doubleZSig0;
uint64_t rem0, rem1, rem2, rem3, term0, term1, term2, term3;
float128 z;
return int64_to_float64(a, status);
}
-uint32 float32_to_uint32(float32 a, float_status *status)
+uint32_t float32_to_uint32(float32 a, float_status *status)
{
int64_t v;
- uint32 res;
+ uint32_t res;
int old_exc_flags = get_float_exception_flags(status);
v = float32_to_int64(a, status);
return res;
}
-uint32 float32_to_uint32_round_to_zero(float32 a, float_status *status)
+uint32_t float32_to_uint32_round_to_zero(float32 a, float_status *status)
{
int64_t v;
- uint32 res;
+ uint32_t res;
int old_exc_flags = get_float_exception_flags(status);
v = float32_to_int64_round_to_zero(a, status);
return res;
}
-int_fast16_t float32_to_int16(float32 a, float_status *status)
+int16_t float32_to_int16(float32 a, float_status *status)
{
int32_t v;
- int_fast16_t res;
+ int16_t res;
int old_exc_flags = get_float_exception_flags(status);
v = float32_to_int32(a, status);
return res;
}
-uint_fast16_t float32_to_uint16(float32 a, float_status *status)
+uint16_t float32_to_uint16(float32 a, float_status *status)
{
int32_t v;
- uint_fast16_t res;
+ uint16_t res;
int old_exc_flags = get_float_exception_flags(status);
v = float32_to_int32(a, status);
return res;
}
-uint_fast16_t float32_to_uint16_round_to_zero(float32 a, float_status *status)
+uint16_t float32_to_uint16_round_to_zero(float32 a, float_status *status)
{
int64_t v;
- uint_fast16_t res;
+ uint16_t res;
int old_exc_flags = get_float_exception_flags(status);
v = float32_to_int64_round_to_zero(a, status);
return res;
}
-uint32 float64_to_uint32(float64 a, float_status *status)
+uint32_t float64_to_uint32(float64 a, float_status *status)
{
uint64_t v;
- uint32 res;
+ uint32_t res;
int old_exc_flags = get_float_exception_flags(status);
v = float64_to_uint64(a, status);
return res;
}
-uint32 float64_to_uint32_round_to_zero(float64 a, float_status *status)
+uint32_t float64_to_uint32_round_to_zero(float64 a, float_status *status)
{
uint64_t v;
- uint32 res;
+ uint32_t res;
int old_exc_flags = get_float_exception_flags(status);
v = float64_to_uint64_round_to_zero(a, status);
return res;
}
-int_fast16_t float64_to_int16(float64 a, float_status *status)
+int16_t float64_to_int16(float64 a, float_status *status)
{
int64_t v;
- int_fast16_t res;
+ int16_t res;
int old_exc_flags = get_float_exception_flags(status);
v = float64_to_int32(a, status);
return res;
}
-uint_fast16_t float64_to_uint16(float64 a, float_status *status)
+uint16_t float64_to_uint16(float64 a, float_status *status)
{
int64_t v;
- uint_fast16_t res;
+ uint16_t res;
int old_exc_flags = get_float_exception_flags(status);
v = float64_to_int32(a, status);
return res;
}
-uint_fast16_t float64_to_uint16_round_to_zero(float64 a, float_status *status)
+uint16_t float64_to_uint16_round_to_zero(float64 a, float_status *status)
{
int64_t v;
- uint_fast16_t res;
+ uint16_t res;
int old_exc_flags = get_float_exception_flags(status);
v = float64_to_int64_round_to_zero(a, status);
uint64_t float64_to_uint64(float64 a, float_status *status)
{
flag aSign;
- int_fast16_t aExp, shiftCount;
+ int aExp;
+ int shiftCount;
uint64_t aSig, aSigExtra;
a = float64_squash_input_denormal(a, status);