mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
target/arm: Implement SVE2 saturating/rounding bitwise shift left (predicated)
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210525010358.152808-7-richard.henderson@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
8b3f15b0a3
commit
45d9503d0a
4 changed files with 176 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
|||
#include "tcg/tcg-gvec-desc.h"
|
||||
#include "fpu/softfloat.h"
|
||||
#include "tcg/tcg.h"
|
||||
#include "vec_internal.h"
|
||||
|
||||
|
||||
/* Note that vector data is stored in host-endian 64-bit chunks,
|
||||
|
@ -561,6 +562,92 @@ DO_ZPZZ(sve2_uadalp_zpzz_h, uint16_t, H1_2, do_uadalp_h)
|
|||
DO_ZPZZ(sve2_uadalp_zpzz_s, uint32_t, H1_4, do_uadalp_s)
|
||||
DO_ZPZZ_D(sve2_uadalp_zpzz_d, uint64_t, do_uadalp_d)
|
||||
|
||||
#define do_srshl_b(n, m) do_sqrshl_bhs(n, m, 8, true, NULL)
|
||||
#define do_srshl_h(n, m) do_sqrshl_bhs(n, m, 16, true, NULL)
|
||||
#define do_srshl_s(n, m) do_sqrshl_bhs(n, m, 32, true, NULL)
|
||||
#define do_srshl_d(n, m) do_sqrshl_d(n, m, true, NULL)
|
||||
|
||||
DO_ZPZZ(sve2_srshl_zpzz_b, int8_t, H1, do_srshl_b)
|
||||
DO_ZPZZ(sve2_srshl_zpzz_h, int16_t, H1_2, do_srshl_h)
|
||||
DO_ZPZZ(sve2_srshl_zpzz_s, int32_t, H1_4, do_srshl_s)
|
||||
DO_ZPZZ_D(sve2_srshl_zpzz_d, int64_t, do_srshl_d)
|
||||
|
||||
#define do_urshl_b(n, m) do_uqrshl_bhs(n, (int8_t)m, 8, true, NULL)
|
||||
#define do_urshl_h(n, m) do_uqrshl_bhs(n, (int16_t)m, 16, true, NULL)
|
||||
#define do_urshl_s(n, m) do_uqrshl_bhs(n, m, 32, true, NULL)
|
||||
#define do_urshl_d(n, m) do_uqrshl_d(n, m, true, NULL)
|
||||
|
||||
DO_ZPZZ(sve2_urshl_zpzz_b, uint8_t, H1, do_urshl_b)
|
||||
DO_ZPZZ(sve2_urshl_zpzz_h, uint16_t, H1_2, do_urshl_h)
|
||||
DO_ZPZZ(sve2_urshl_zpzz_s, uint32_t, H1_4, do_urshl_s)
|
||||
DO_ZPZZ_D(sve2_urshl_zpzz_d, uint64_t, do_urshl_d)
|
||||
|
||||
/*
|
||||
* Unlike the NEON and AdvSIMD versions, there is no QC bit to set.
|
||||
* We pass in a pointer to a dummy saturation field to trigger
|
||||
* the saturating arithmetic but discard the information about
|
||||
* whether it has occurred.
|
||||
*/
|
||||
#define do_sqshl_b(n, m) \
|
||||
({ uint32_t discard; do_sqrshl_bhs(n, m, 8, false, &discard); })
|
||||
#define do_sqshl_h(n, m) \
|
||||
({ uint32_t discard; do_sqrshl_bhs(n, m, 16, false, &discard); })
|
||||
#define do_sqshl_s(n, m) \
|
||||
({ uint32_t discard; do_sqrshl_bhs(n, m, 32, false, &discard); })
|
||||
#define do_sqshl_d(n, m) \
|
||||
({ uint32_t discard; do_sqrshl_d(n, m, false, &discard); })
|
||||
|
||||
DO_ZPZZ(sve2_sqshl_zpzz_b, int8_t, H1_2, do_sqshl_b)
|
||||
DO_ZPZZ(sve2_sqshl_zpzz_h, int16_t, H1_2, do_sqshl_h)
|
||||
DO_ZPZZ(sve2_sqshl_zpzz_s, int32_t, H1_4, do_sqshl_s)
|
||||
DO_ZPZZ_D(sve2_sqshl_zpzz_d, int64_t, do_sqshl_d)
|
||||
|
||||
#define do_uqshl_b(n, m) \
|
||||
({ uint32_t discard; do_uqrshl_bhs(n, (int8_t)m, 8, false, &discard); })
|
||||
#define do_uqshl_h(n, m) \
|
||||
({ uint32_t discard; do_uqrshl_bhs(n, (int16_t)m, 16, false, &discard); })
|
||||
#define do_uqshl_s(n, m) \
|
||||
({ uint32_t discard; do_uqrshl_bhs(n, m, 32, false, &discard); })
|
||||
#define do_uqshl_d(n, m) \
|
||||
({ uint32_t discard; do_uqrshl_d(n, m, false, &discard); })
|
||||
|
||||
DO_ZPZZ(sve2_uqshl_zpzz_b, uint8_t, H1_2, do_uqshl_b)
|
||||
DO_ZPZZ(sve2_uqshl_zpzz_h, uint16_t, H1_2, do_uqshl_h)
|
||||
DO_ZPZZ(sve2_uqshl_zpzz_s, uint32_t, H1_4, do_uqshl_s)
|
||||
DO_ZPZZ_D(sve2_uqshl_zpzz_d, uint64_t, do_uqshl_d)
|
||||
|
||||
#define do_sqrshl_b(n, m) \
|
||||
({ uint32_t discard; do_sqrshl_bhs(n, m, 8, true, &discard); })
|
||||
#define do_sqrshl_h(n, m) \
|
||||
({ uint32_t discard; do_sqrshl_bhs(n, m, 16, true, &discard); })
|
||||
#define do_sqrshl_s(n, m) \
|
||||
({ uint32_t discard; do_sqrshl_bhs(n, m, 32, true, &discard); })
|
||||
#define do_sqrshl_d(n, m) \
|
||||
({ uint32_t discard; do_sqrshl_d(n, m, true, &discard); })
|
||||
|
||||
DO_ZPZZ(sve2_sqrshl_zpzz_b, int8_t, H1_2, do_sqrshl_b)
|
||||
DO_ZPZZ(sve2_sqrshl_zpzz_h, int16_t, H1_2, do_sqrshl_h)
|
||||
DO_ZPZZ(sve2_sqrshl_zpzz_s, int32_t, H1_4, do_sqrshl_s)
|
||||
DO_ZPZZ_D(sve2_sqrshl_zpzz_d, int64_t, do_sqrshl_d)
|
||||
|
||||
#undef do_sqrshl_d
|
||||
|
||||
#define do_uqrshl_b(n, m) \
|
||||
({ uint32_t discard; do_uqrshl_bhs(n, (int8_t)m, 8, true, &discard); })
|
||||
#define do_uqrshl_h(n, m) \
|
||||
({ uint32_t discard; do_uqrshl_bhs(n, (int16_t)m, 16, true, &discard); })
|
||||
#define do_uqrshl_s(n, m) \
|
||||
({ uint32_t discard; do_uqrshl_bhs(n, m, 32, true, &discard); })
|
||||
#define do_uqrshl_d(n, m) \
|
||||
({ uint32_t discard; do_uqrshl_d(n, m, true, &discard); })
|
||||
|
||||
DO_ZPZZ(sve2_uqrshl_zpzz_b, uint8_t, H1_2, do_uqrshl_b)
|
||||
DO_ZPZZ(sve2_uqrshl_zpzz_h, uint16_t, H1_2, do_uqrshl_h)
|
||||
DO_ZPZZ(sve2_uqrshl_zpzz_s, uint32_t, H1_4, do_uqrshl_s)
|
||||
DO_ZPZZ_D(sve2_uqrshl_zpzz_d, uint64_t, do_uqrshl_d)
|
||||
|
||||
#undef do_uqrshl_d
|
||||
|
||||
#undef DO_ZPZZ
|
||||
#undef DO_ZPZZ_D
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue