aboutsummaryrefslogtreecommitdiff
path: root/target/s390x/translate_vx.inc.c
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2019-04-11 11:39:23 +0200
committerDavid Hildenbrand <david@redhat.com>2019-05-17 10:54:13 +0200
commit0abddd6cbf43ed68060a3f8d07d5520340944347 (patch)
tree48f2cf45a47e982b49ba38ed6e5172ec50dd9527 /target/s390x/translate_vx.inc.c
parentdea33fc31bb5664a63f3157425200be3151652a4 (diff)
s390x/tcg: Implement VECTOR SHIFT LEFT DOUBLE BY BYTE
Inline expansion courtesy of Richard H. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: David Hildenbrand <david@redhat.com>
Diffstat (limited to 'target/s390x/translate_vx.inc.c')
-rw-r--r--target/s390x/translate_vx.inc.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.inc.c
index 734c022b36..43f67e3f82 100644
--- a/target/s390x/translate_vx.inc.c
+++ b/target/s390x/translate_vx.inc.c
@@ -2060,3 +2060,32 @@ static DisasJumpType op_vsl(DisasContext *s, DisasOps *o)
tcg_temp_free_i64(shift);
return DISAS_NEXT;
}
+
+static DisasJumpType op_vsldb(DisasContext *s, DisasOps *o)
+{
+ const uint8_t i4 = get_field(s->fields, i4) & 0xf;
+ const int left_shift = (i4 & 7) * 8;
+ const int right_shift = 64 - left_shift;
+ TCGv_i64 t0 = tcg_temp_new_i64();
+ TCGv_i64 t1 = tcg_temp_new_i64();
+ TCGv_i64 t2 = tcg_temp_new_i64();
+
+ if ((i4 & 8) == 0) {
+ read_vec_element_i64(t0, get_field(s->fields, v2), 0, ES_64);
+ read_vec_element_i64(t1, get_field(s->fields, v2), 1, ES_64);
+ read_vec_element_i64(t2, get_field(s->fields, v3), 0, ES_64);
+ } else {
+ read_vec_element_i64(t0, get_field(s->fields, v2), 1, ES_64);
+ read_vec_element_i64(t1, get_field(s->fields, v3), 0, ES_64);
+ read_vec_element_i64(t2, get_field(s->fields, v3), 1, ES_64);
+ }
+ tcg_gen_extract2_i64(t0, t1, t0, right_shift);
+ tcg_gen_extract2_i64(t1, t2, t1, right_shift);
+ write_vec_element_i64(t0, get_field(s->fields, v1), 0, ES_64);
+ write_vec_element_i64(t1, get_field(s->fields, v1), 1, ES_64);
+
+ tcg_temp_free(t0);
+ tcg_temp_free(t1);
+ tcg_temp_free(t2);
+ return DISAS_NEXT;
+}