Skip to content

Commit

Permalink
MIPS: math-emu: Inline ieee754sp_issnan and ieee754dp_issnan.
Browse files Browse the repository at this point in the history
Shaves another 16 bytes off but more importantly avoids function calls.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed May 23, 2014
1 parent dfbf42b commit f71baa1
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arch/mips/math-emu/ieee754dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int ieee754dp_isnan(union ieee754dp x)
return ieee754dp_class(x) >= IEEE754_CLASS_SNAN;
}

int ieee754dp_issnan(union ieee754dp x)
static inline int ieee754dp_issnan(union ieee754dp x)
{
assert(ieee754dp_isnan(x));
return ((DPMANT(x) & DP_MBIT(DP_FBITS-1)) == DP_MBIT(DP_FBITS-1));
Expand Down
1 change: 0 additions & 1 deletion arch/mips/math-emu/ieee754dp.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ static inline union ieee754dp builddp(int s, int bx, u64 m)
}

extern int ieee754dp_isnan(union ieee754dp);
extern int ieee754dp_issnan(union ieee754dp);
extern int __cold ieee754si_xcpt(int, const char *, ...);
extern s64 __cold ieee754di_xcpt(s64, const char *, ...);
extern union ieee754dp __cold ieee754dp_xcpt(union ieee754dp, const char *, ...);
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/math-emu/ieee754sp.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int ieee754sp_isnan(union ieee754sp x)
return ieee754sp_class(x) >= IEEE754_CLASS_SNAN;
}

int ieee754sp_issnan(union ieee754sp x)
static inline int ieee754sp_issnan(union ieee754sp x)
{
assert(ieee754sp_isnan(x));
return (SPMANT(x) & SP_MBIT(SP_FBITS-1));
Expand Down
1 change: 0 additions & 1 deletion arch/mips/math-emu/ieee754sp.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ static inline union ieee754sp buildsp(int s, int bx, unsigned m)
}

extern int ieee754sp_isnan(union ieee754sp);
extern int ieee754sp_issnan(union ieee754sp);
extern int __cold ieee754si_xcpt(int, const char *, ...);
extern s64 __cold ieee754di_xcpt(s64, const char *, ...);
extern union ieee754sp __cold ieee754sp_xcpt(union ieee754sp, const char *, ...);
Expand Down

0 comments on commit f71baa1

Please sign in to comment.