[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/33] s390x/tcg: Implement VECTOR LOAD
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 08/33] s390x/tcg: Implement VECTOR LOAD |
Date: |
Mon, 11 Mar 2019 10:02:57 +0100 |
From: David Hildenbrand <address@hidden>
When loading from memory, load both elements into temps first before
modifying the target vector
Loading with strange alingment from the end of the address space will
not properly wrap, we can ignore that for now.
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
target/s390x/insn-data.def | 3 +++
target/s390x/translate_vx.inc.c | 24 ++++++++++++++++++++++++
2 files changed, 27 insertions(+)
diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def
index c8cd5dfa249e..f129e51d4161 100644
--- a/target/s390x/insn-data.def
+++ b/target/s390x/insn-data.def
@@ -981,6 +981,9 @@
F(0xe744, VGBM, VRI_a, V, 0, 0, 0, 0, vgbm, 0, IF_VEC)
/* VECTOR GENERATE MASK */
F(0xe746, VGM, VRI_b, V, 0, 0, 0, 0, vgm, 0, IF_VEC)
+/* VECTOR LOAD */
+ F(0xe706, VL, VRX, V, la2, 0, 0, 0, vl, 0, IF_VEC)
+ F(0xe756, VLR, VRR_a, V, 0, 0, 0, 0, vlr, 0, IF_VEC)
#ifndef CONFIG_USER_ONLY
/* COMPARE AND SWAP AND PURGE */
diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.inc.c
index 28edd9b0c4cc..9063784a7666 100644
--- a/target/s390x/translate_vx.inc.c
+++ b/target/s390x/translate_vx.inc.c
@@ -113,6 +113,9 @@ static void write_vec_element_i64(TCGv_i64 src, int reg,
uint8_t enr,
}
}
+#define gen_gvec_mov(v1, v2) \
+ tcg_gen_gvec_mov(0, vec_full_reg_offset(v1), vec_full_reg_offset(v2), 16, \
+ 16)
#define gen_gvec_dup64i(v1, c) \
tcg_gen_gvec_dup64i(vec_full_reg_offset(v1), 16, 16, c)
@@ -219,3 +222,24 @@ static DisasJumpType op_vgm(DisasContext *s, DisasOps *o)
gen_gvec_dupi(es, get_field(s->fields, v1), mask);
return DISAS_NEXT;
}
+
+static DisasJumpType op_vl(DisasContext *s, DisasOps *o)
+{
+ TCGv_i64 t0 = tcg_temp_new_i64();
+ TCGv_i64 t1 = tcg_temp_new_i64();
+
+ tcg_gen_qemu_ld_i64(t0, o->addr1, get_mem_index(s), MO_TEQ);
+ gen_addi_and_wrap_i64(s, o->addr1, o->addr1, 8);
+ tcg_gen_qemu_ld_i64(t1, o->addr1, get_mem_index(s), MO_TEQ);
+ 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);
+ return DISAS_NEXT;
+}
+
+static DisasJumpType op_vlr(DisasContext *s, DisasOps *o)
+{
+ gen_gvec_mov(get_field(s->fields, v1), get_field(s->fields, v2));
+ return DISAS_NEXT;
+}
--
2.17.2
- [Qemu-devel] [PULL 00/33] final s390x patches for 4.0 soft freeze, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 01/33] target/s390x: Remove non-architected entries from struct LowCore, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 02/33] s390x/tcg: Define vector instruction formats, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 03/33] s390x/tcg: Check vector register instructions at central point, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 04/33] s390x/tcg: Utilities for vector instruction helpers, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 05/33] s390x/tcg: Implement VECTOR GATHER ELEMENT, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 06/33] s390x/tcg: Implement VECTOR GENERATE BYTE MASK, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 07/33] s390x/tcg: Implement VECTOR GENERATE MASK, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 08/33] s390x/tcg: Implement VECTOR LOAD,
Cornelia Huck <=
- [Qemu-devel] [PULL 10/33] s390x/tcg: Implement VECTOR LOAD ELEMENT, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 09/33] s390x/tcg: Implement VECTOR LOAD AND REPLICATE, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 12/33] s390x/tcg: Implement VECTOR LOAD GR FROM VR ELEMENT, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 11/33] s390x/tcg: Implement VECTOR LOAD ELEMENT IMMEDIATE, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 14/33] s390x/tcg: Implement VECTOR LOAD MULTIPLE, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 13/33] s390x/tcg: Implement VECTOR LOAD LOGICAL ELEMENT AND ZERO, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 15/33] s390x/tcg: Implement VECTOR LOAD TO BLOCK BOUNDARY, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 16/33] s390x/tcg: Implement VECTOR LOAD VR ELEMENT FROM GR, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 17/33] s390x/tcg: Implement VECTOR LOAD VR FROM GRS DISJOINT, Cornelia Huck, 2019/03/11
- [Qemu-devel] [PULL 18/33] s390x/tcg: Implement VECTOR LOAD WITH LENGTH, Cornelia Huck, 2019/03/11