Commit b0c2f8fb authored by Maciej W. Rozycki's avatar Maciej W. Rozycki Committed by Ralf Baechle

MIPS: math-emu: Optimise qNaN handling in `ieee754sp_fdp'

Rewrite qNaN handling in `ieee754sp_fdp' using the `ieee754_class_nan'
helper recently added, removing the external call to `ieee754sp_isnan'
and reducing the size of code by 16 instructions or 64 bytes.
Signed-off-by: default avatarMaciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9692/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 42fa2424
...@@ -30,10 +30,11 @@ static inline union ieee754sp ieee754sp_nan_fdp(int xs, u64 xm) ...@@ -30,10 +30,11 @@ static inline union ieee754sp ieee754sp_nan_fdp(int xs, u64 xm)
union ieee754sp ieee754sp_fdp(union ieee754dp x) union ieee754sp ieee754sp_fdp(union ieee754dp x)
{ {
union ieee754sp y;
u32 rm; u32 rm;
COMPXDP; COMPXDP;
union ieee754sp nan; COMPYSP;
EXPLODEXDP; EXPLODEXDP;
...@@ -46,10 +47,11 @@ union ieee754sp ieee754sp_fdp(union ieee754dp x) ...@@ -46,10 +47,11 @@ union ieee754sp ieee754sp_fdp(union ieee754dp x)
return ieee754sp_nanxcpt(ieee754sp_nan_fdp(xs, xm)); return ieee754sp_nanxcpt(ieee754sp_nan_fdp(xs, xm));
case IEEE754_CLASS_QNAN: case IEEE754_CLASS_QNAN:
nan = ieee754sp_nan_fdp(xs, xm); y = ieee754sp_nan_fdp(xs, xm);
if (!ieee754sp_isnan(nan)) EXPLODEYSP;
nan = ieee754sp_indef(); if (!ieee754_class_nan(yc))
return nan; y = ieee754sp_indef();
return y;
case IEEE754_CLASS_INF: case IEEE754_CLASS_INF:
return ieee754sp_inf(xs); return ieee754sp_inf(xs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment