Skip to content

Commit

Permalink
softfloat: Replace int16 type with int_fast16_t
Browse files Browse the repository at this point in the history
Based on the following Coccinelle patch:

@@
typedef int16, int_fast16_t;
@@
-int16
+int_fast16_t

Avoids a workaround for AIX.

Add typedef for pre-10 Solaris.

Signed-off-by: Andreas Färber <[email protected]>
Cc: malc <[email protected]>
Cc: Ben Taylor <[email protected]>
Tested-by: Bernhard Walle <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
  • Loading branch information
afaerber authored and blueswirl committed Apr 28, 2012
1 parent 5aea4c5 commit 94a49d8
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 71 deletions.
18 changes: 9 additions & 9 deletions fpu/softfloat-macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ these four paragraphs for those parts of this code that are retained.
| The result is stored in the location pointed to by `zPtr'.
*----------------------------------------------------------------------------*/

INLINE void shift32RightJamming( uint32_t a, int16 count, uint32_t *zPtr )
INLINE void shift32RightJamming(uint32_t a, int_fast16_t count, uint32_t *zPtr)
{
uint32_t z;

Expand All @@ -81,7 +81,7 @@ INLINE void shift32RightJamming( uint32_t a, int16 count, uint32_t *zPtr )
| The result is stored in the location pointed to by `zPtr'.
*----------------------------------------------------------------------------*/

INLINE void shift64RightJamming( uint64_t a, int16 count, uint64_t *zPtr )
INLINE void shift64RightJamming(uint64_t a, int_fast16_t count, uint64_t *zPtr)
{
uint64_t z;

Expand Down Expand Up @@ -117,7 +117,7 @@ INLINE void shift64RightJamming( uint64_t a, int16 count, uint64_t *zPtr )

INLINE void
shift64ExtraRightJamming(
uint64_t a0, uint64_t a1, int16 count, uint64_t *z0Ptr, uint64_t *z1Ptr )
uint64_t a0, uint64_t a1, int_fast16_t count, uint64_t *z0Ptr, uint64_t *z1Ptr)
{
uint64_t z0, z1;
int8 negCount = ( - count ) & 63;
Expand Down Expand Up @@ -154,7 +154,7 @@ INLINE void

INLINE void
shift128Right(
uint64_t a0, uint64_t a1, int16 count, uint64_t *z0Ptr, uint64_t *z1Ptr )
uint64_t a0, uint64_t a1, int_fast16_t count, uint64_t *z0Ptr, uint64_t *z1Ptr)
{
uint64_t z0, z1;
int8 negCount = ( - count ) & 63;
Expand Down Expand Up @@ -189,7 +189,7 @@ INLINE void

INLINE void
shift128RightJamming(
uint64_t a0, uint64_t a1, int16 count, uint64_t *z0Ptr, uint64_t *z1Ptr )
uint64_t a0, uint64_t a1, int_fast16_t count, uint64_t *z0Ptr, uint64_t *z1Ptr)
{
uint64_t z0, z1;
int8 negCount = ( - count ) & 63;
Expand Down Expand Up @@ -243,7 +243,7 @@ INLINE void
uint64_t a0,
uint64_t a1,
uint64_t a2,
int16 count,
int_fast16_t count,
uint64_t *z0Ptr,
uint64_t *z1Ptr,
uint64_t *z2Ptr
Expand Down Expand Up @@ -298,7 +298,7 @@ INLINE void

INLINE void
shortShift128Left(
uint64_t a0, uint64_t a1, int16 count, uint64_t *z0Ptr, uint64_t *z1Ptr )
uint64_t a0, uint64_t a1, int_fast16_t count, uint64_t *z0Ptr, uint64_t *z1Ptr)
{

*z1Ptr = a1<<count;
Expand All @@ -320,7 +320,7 @@ INLINE void
uint64_t a0,
uint64_t a1,
uint64_t a2,
int16 count,
int_fast16_t count,
uint64_t *z0Ptr,
uint64_t *z1Ptr,
uint64_t *z2Ptr
Expand Down Expand Up @@ -591,7 +591,7 @@ static uint64_t estimateDiv128To64( uint64_t a0, uint64_t a1, uint64_t b )
| value.
*----------------------------------------------------------------------------*/

static uint32_t estimateSqrt32( int16 aExp, uint32_t a )
static uint32_t estimateSqrt32(int_fast16_t aExp, uint32_t a)
{
static const uint16_t sqrtOddAdjustments[] = {
0x0004, 0x0022, 0x005D, 0x00B1, 0x011D, 0x019F, 0x0236, 0x02E0,
Expand Down
Loading

0 comments on commit 94a49d8

Please sign in to comment.