diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2020-08-28 19:33:46 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2020-09-01 11:38:42 +0100 |
commit | 7b959c5890deb9a6d71bc6800006a0eae0a84c60 (patch) | |
tree | 3d9018f865a9275ae0a6fe54fdd88534322f396d /target/arm/vec_helper.c | |
parent | 7782a9afec81d1efe23572135c1ed777691ccde5 (diff) | |
download | qemu-7b959c5890deb9a6d71bc6800006a0eae0a84c60.zip qemu-7b959c5890deb9a6d71bc6800006a0eae0a84c60.tar.gz qemu-7b959c5890deb9a6d71bc6800006a0eae0a84c60.tar.bz2 |
target/arm: Convert Neon VCVT fixed-point to gvec
Convert the Neon VCVT float<->fixed-point insns to a
gvec style, in preparation for adding fp16 support.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20200828183354.27913-38-peter.maydell@linaro.org
Diffstat (limited to 'target/arm/vec_helper.c')
-rw-r--r-- | target/arm/vec_helper.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c index 6ea9807..6d83953 100644 --- a/target/arm/vec_helper.c +++ b/target/arm/vec_helper.c @@ -1845,3 +1845,23 @@ DO_NEON_PAIRWISE(neon_pmax, max) DO_NEON_PAIRWISE(neon_pmin, min) #undef DO_NEON_PAIRWISE + +#define DO_VCVT_FIXED(NAME, FUNC, TYPE) \ + void HELPER(NAME)(void *vd, void *vn, void *stat, uint32_t desc) \ + { \ + intptr_t i, oprsz = simd_oprsz(desc); \ + int shift = simd_data(desc); \ + TYPE *d = vd, *n = vn; \ + float_status *fpst = stat; \ + for (i = 0; i < oprsz / sizeof(TYPE); i++) { \ + d[i] = FUNC(n[i], shift, fpst); \ + } \ + clear_tail(d, oprsz, simd_maxsz(desc)); \ + } + +DO_VCVT_FIXED(gvec_vcvt_sf, helper_vfp_sltos, uint32_t) +DO_VCVT_FIXED(gvec_vcvt_uf, helper_vfp_ultos, uint32_t) +DO_VCVT_FIXED(gvec_vcvt_fs, helper_vfp_tosls_round_to_zero, uint32_t) +DO_VCVT_FIXED(gvec_vcvt_fu, helper_vfp_touls_round_to_zero, uint32_t) + +#undef DO_VCVT_FIXED |