From 5c4b0ab460ef1f8c6fb9ebf7e057ad09e88b1846 Mon Sep 17 00:00:00 2001 From: David Hildenbrand Date: Thu, 11 Apr 2019 11:27:29 +0200 Subject: s390x/tcg: Implement VECTOR ELEMENT ROTATE AND INSERT UNDER MASK Use the new vector expansion for GVecGen3i. Reviewed-by: Richard Henderson Signed-off-by: David Hildenbrand --- target/s390x/vec_int_helper.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'target/s390x/vec_int_helper.c') diff --git a/target/s390x/vec_int_helper.c b/target/s390x/vec_int_helper.c index a3c8f09eac..b881fb722d 100644 --- a/target/s390x/vec_int_helper.c +++ b/target/s390x/vec_int_helper.c @@ -14,6 +14,7 @@ #include "cpu.h" #include "vec.h" #include "exec/helper-proto.h" +#include "tcg/tcg-gvec-desc.h" static bool s390_vec_is_zero(const S390Vector *v) { @@ -509,3 +510,22 @@ void HELPER(gvec_verll##BITS)(void *v1, const void *v2, uint64_t count, \ } DEF_VERLL(8) DEF_VERLL(16) + +#define DEF_VERIM(BITS) \ +void HELPER(gvec_verim##BITS)(void *v1, const void *v2, const void *v3, \ + uint32_t desc) \ +{ \ + const uint8_t count = simd_data(desc); \ + int i; \ + \ + for (i = 0; i < (128 / BITS); i++) { \ + const uint##BITS##_t a = s390_vec_read_element##BITS(v1, i); \ + const uint##BITS##_t b = s390_vec_read_element##BITS(v2, i); \ + const uint##BITS##_t mask = s390_vec_read_element##BITS(v3, i); \ + const uint##BITS##_t d = (a & ~mask) | (rol##BITS(b, count) & mask); \ + \ + s390_vec_write_element##BITS(v1, i, d); \ + } \ +} +DEF_VERIM(8) +DEF_VERIM(16) -- cgit v1.2.3