提交 e223bcad 编写于 作者: T Tristan Gingold 提交者: Alexander Graf

powerpc: use float64 for frsqrte

Remove the code that reduce the result to float32 as the frsqrte
instruction is defined to return a double-precision estimate of
the reciprocal square root.

Although reducing the fractional part is harmless (as the estimation
must have at least 12 bits of precision according to the old PEM),
reducing the exponent range is not correct.
Signed-off-by: NTristan Gingold <gingold@adacore.com>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 23825581
...@@ -977,7 +977,6 @@ uint64_t helper_fres(CPUPPCState *env, uint64_t arg) ...@@ -977,7 +977,6 @@ uint64_t helper_fres(CPUPPCState *env, uint64_t arg)
uint64_t helper_frsqrte(CPUPPCState *env, uint64_t arg) uint64_t helper_frsqrte(CPUPPCState *env, uint64_t arg)
{ {
CPU_DoubleU farg; CPU_DoubleU farg;
float32 f32;
farg.ll = arg; farg.ll = arg;
...@@ -991,8 +990,6 @@ uint64_t helper_frsqrte(CPUPPCState *env, uint64_t arg) ...@@ -991,8 +990,6 @@ uint64_t helper_frsqrte(CPUPPCState *env, uint64_t arg)
} }
farg.d = float64_sqrt(farg.d, &env->fp_status); farg.d = float64_sqrt(farg.d, &env->fp_status);
farg.d = float64_div(float64_one, farg.d, &env->fp_status); farg.d = float64_div(float64_one, farg.d, &env->fp_status);
f32 = float64_to_float32(farg.d, &env->fp_status);
farg.d = float32_to_float64(f32, &env->fp_status);
} }
return farg.ll; return farg.ll;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册