mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
target/arm: Implement fp16 for Neon VRINT-with-specified-rounding-mode
Convert the Neon VRINT-with-specified-rounding-mode insns to gvec, and use this to implement the fp16 versions. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20200828183354.27913-41-peter.maydell@linaro.org
This commit is contained in:
parent
ca88a6efdf
commit
18725916b1
4 changed files with 30 additions and 79 deletions
|
@ -1892,3 +1892,24 @@ DO_VCVT_RMODE(gvec_vcvt_rm_sh, helper_vfp_toshh, uint16_t)
|
|||
DO_VCVT_RMODE(gvec_vcvt_rm_uh, helper_vfp_touhh, uint16_t)
|
||||
|
||||
#undef DO_VCVT_RMODE
|
||||
|
||||
#define DO_VRINT_RMODE(NAME, FUNC, TYPE) \
|
||||
void HELPER(NAME)(void *vd, void *vn, void *stat, uint32_t desc) \
|
||||
{ \
|
||||
float_status *fpst = stat; \
|
||||
intptr_t i, oprsz = simd_oprsz(desc); \
|
||||
uint32_t rmode = simd_data(desc); \
|
||||
uint32_t prev_rmode = get_float_rounding_mode(fpst); \
|
||||
TYPE *d = vd, *n = vn; \
|
||||
set_float_rounding_mode(rmode, fpst); \
|
||||
for (i = 0; i < oprsz / sizeof(TYPE); i++) { \
|
||||
d[i] = FUNC(n[i], fpst); \
|
||||
} \
|
||||
set_float_rounding_mode(prev_rmode, fpst); \
|
||||
clear_tail(d, oprsz, simd_maxsz(desc)); \
|
||||
}
|
||||
|
||||
DO_VRINT_RMODE(gvec_vrint_rm_h, helper_rinth, uint16_t)
|
||||
DO_VRINT_RMODE(gvec_vrint_rm_s, helper_rints, uint32_t)
|
||||
|
||||
#undef DO_VRINT_RMODE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue