mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
target/arm: Implement fp16 for Neon VRSQRTS
Convert the Neon VRSQRTS insn to using a gvec helper, and use this to implement the fp16 case. As with VRECPS, we adjust the phrasing of the new implementation slightly so that the fp32 version parallels the fp16 one. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20200828183354.27913-35-peter.maydell@linaro.org
This commit is contained in:
parent
ac8c62c4e5
commit
40fde72dda
4 changed files with 34 additions and 36 deletions
|
@ -529,21 +529,6 @@ uint32_t HELPER(vfp_fcvt_f64_to_f16)(float64 a, void *fpstp, uint32_t ahp_mode)
|
|||
return r;
|
||||
}
|
||||
|
||||
float32 HELPER(rsqrts_f32)(CPUARMState *env, float32 a, float32 b)
|
||||
{
|
||||
float_status *s = &env->vfp.standard_fp_status;
|
||||
float32 product;
|
||||
if ((float32_is_infinity(a) && float32_is_zero_or_denormal(b)) ||
|
||||
(float32_is_infinity(b) && float32_is_zero_or_denormal(a))) {
|
||||
if (!(float32_is_zero(a) || float32_is_zero(b))) {
|
||||
float_raise(float_flag_input_denormal, s);
|
||||
}
|
||||
return float32_one_point_five;
|
||||
}
|
||||
product = float32_mul(a, b, s);
|
||||
return float32_div(float32_sub(float32_three, product, s), float32_two, s);
|
||||
}
|
||||
|
||||
/* NEON helpers. */
|
||||
|
||||
/* Constants 256 and 512 are used in some helpers; we avoid relying on
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue