aboutsummaryrefslogtreecommitdiff
path: root/target/s390x/vec.h
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2019-05-24 11:23:49 +0200
committerDavid Hildenbrand <david@redhat.com>2019-06-07 14:53:25 +0200
commit13b0228f77ffa14a0f82bd8a9d0fd5859b0d6a7d (patch)
treeec017c4342f93d73254f8cf8f0b23e646f252c10 /target/s390x/vec.h
parentbe6324c6b73478f181bba4920de2ef6af317482b (diff)
s390x/tcg: Implement VECTOR STRING RANGE COMPARE
Unfortunately, there is no easy way to avoid looping over all elements in v2. Provide specialized variants for !cc,!rt/!cc,rt/cc,!rt/cc,rt and all element types. Especially for different values of rt, the compiler might be able to optimize the code a lot. Add s390_vec_write_element(). Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: David Hildenbrand <david@redhat.com>
Diffstat (limited to 'target/s390x/vec.h')
-rw-r--r--target/s390x/vec.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/target/s390x/vec.h b/target/s390x/vec.h
index affc62874c..a6e361869b 100644
--- a/target/s390x/vec.h
+++ b/target/s390x/vec.h
@@ -117,4 +117,25 @@ static inline void s390_vec_write_element64(S390Vector *v, uint8_t enr,
v->doubleword[enr] = data;
}
+static inline void s390_vec_write_element(S390Vector *v, uint8_t enr,
+ uint8_t es, uint64_t data)
+{
+ switch (es) {
+ case MO_8:
+ s390_vec_write_element8(v, enr, data);
+ break;
+ case MO_16:
+ s390_vec_write_element16(v, enr, data);
+ break;
+ case MO_32:
+ s390_vec_write_element32(v, enr, data);
+ break;
+ case MO_64:
+ s390_vec_write_element64(v, enr, data);
+ break;
+ default:
+ g_assert_not_reached();
+ }
+}
+
#endif /* S390X_VEC_H */