aboutsummaryrefslogtreecommitdiff
path: root/softfloat/i64_to_f32.c
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2017-09-24 20:25:34 -0700
committerAndrew Waterman <andrew@sifive.com>2017-09-24 20:25:34 -0700
commitbd85811c35ea38180d27440507fc222d585ef780 (patch)
tree214c6b615d7775f73da5ff9a94bd4a0a2772f9cf /softfloat/i64_to_f32.c
parentb86f2a51f522f020ad0d90f598f4c501f41da232 (diff)
downloadspike-bd85811c35ea38180d27440507fc222d585ef780.zip
spike-bd85811c35ea38180d27440507fc222d585ef780.tar.gz
spike-bd85811c35ea38180d27440507fc222d585ef780.tar.bz2
Update SoftFloat
Diffstat (limited to 'softfloat/i64_to_f32.c')
-rw-r--r--softfloat/i64_to_f32.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/softfloat/i64_to_f32.c b/softfloat/i64_to_f32.c
index ae68ad9..e8a3494 100644
--- a/softfloat/i64_to_f32.c
+++ b/softfloat/i64_to_f32.c
@@ -2,10 +2,10 @@
/*============================================================================
This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic
-Package, Release 3a, by John R. Hauser.
+Package, Release 3d, by John R. Hauser.
-Copyright 2011, 2012, 2013, 2014 The Regents of the University of California.
-All rights reserved.
+Copyright 2011, 2012, 2013, 2014, 2015, 2016 The Regents of the University of
+California. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -44,26 +44,26 @@ float32_t i64_to_f32( int64_t a )
{
bool sign;
uint_fast64_t absA;
- int_fast8_t shiftCount;
+ int_fast8_t shiftDist;
union ui32_f32 u;
uint_fast32_t sig;
sign = (a < 0);
absA = sign ? -(uint_fast64_t) a : (uint_fast64_t) a;
- shiftCount = softfloat_countLeadingZeros64( absA ) - 40;
- if ( 0 <= shiftCount ) {
+ shiftDist = softfloat_countLeadingZeros64( absA ) - 40;
+ if ( 0 <= shiftDist ) {
u.ui =
a ? packToF32UI(
- sign, 0x95 - shiftCount, (uint_fast32_t) absA<<shiftCount )
+ sign, 0x95 - shiftDist, (uint_fast32_t) absA<<shiftDist )
: 0;
return u.f;
} else {
- shiftCount += 7;
+ shiftDist += 7;
sig =
- (shiftCount < 0)
- ? softfloat_shortShiftRightJam64( absA, -shiftCount )
- : (uint_fast32_t) absA<<shiftCount;
- return softfloat_roundPackToF32( sign, 0x9C - shiftCount, sig );
+ (shiftDist < 0)
+ ? softfloat_shortShiftRightJam64( absA, -shiftDist )
+ : (uint_fast32_t) absA<<shiftDist;
+ return softfloat_roundPackToF32( sign, 0x9C - shiftDist, sig );
}
}