]> git.proxmox.com Git - mirror_qemu.git/commitdiff
s390x/tcg: Implement VECTOR SUBTRACT
authorDavid Hildenbrand <david@redhat.com>
Wed, 10 Apr 2019 19:37:24 +0000 (21:37 +0200)
committerDavid Hildenbrand <david@redhat.com>
Fri, 17 May 2019 08:54:13 +0000 (10:54 +0200)
We can use tcg_gen_sub2_i64() to do 128-bit subtraction and otherwise
existing gvec helpers.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
target/s390x/insn-data.def
target/s390x/translate_vx.inc.c

index f3bf9edfcab5d3e9d8eedd0fd1f0851b383d7563..58a61f41efebd651a0e2fd857e0f7d5ab661d0f2 100644 (file)
     F(0xe77c, VSRL,    VRR_c, V,   0, 0, 0, 0, vsrl, 0, IF_VEC)
 /* VECTOR SHIFT RIGHT LOGICAL BY BYTE */
     F(0xe77d, VSRLB,   VRR_c, V,   0, 0, 0, 0, vsrl, 0, IF_VEC)
+/* VECTOR SUBTRACT */
+    F(0xe7f7, VS,      VRR_c, V,   0, 0, 0, 0, vs, 0, IF_VEC)
 
 #ifndef CONFIG_USER_ONLY
 /* COMPARE AND SWAP AND PURGE */
index 5dfbf1bcd408430d18b5dc337e9ad8bd262150a1..5f53ae7ec546d39c596f94f4b7fcfd87ec4b27c5 100644 (file)
@@ -2123,3 +2123,20 @@ static DisasJumpType op_vsrl(DisasContext *s, DisasOps *o)
     tcg_temp_free_i64(shift);
     return DISAS_NEXT;
 }
+
+static DisasJumpType op_vs(DisasContext *s, DisasOps *o)
+{
+    const uint8_t es = get_field(s->fields, m4);
+
+    if (es > ES_128) {
+        gen_program_exception(s, PGM_SPECIFICATION);
+        return DISAS_NORETURN;
+    } else if (es == ES_128) {
+        gen_gvec128_3_i64(tcg_gen_sub2_i64, get_field(s->fields, v1),
+                          get_field(s->fields, v2), get_field(s->fields, v3));
+        return DISAS_NEXT;
+    }
+    gen_gvec_fn_3(sub, es, get_field(s->fields, v1), get_field(s->fields, v2),
+                  get_field(s->fields, v3));
+    return DISAS_NEXT;
+}