From nobody Mon May 6 17:48:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510238698246610.7028714922152; Thu, 9 Nov 2017 06:44:58 -0800 (PST) Received: from localhost ([::1]:37249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCo4a-0007Mi-EF for importer@patchew.org; Thu, 09 Nov 2017 09:44:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCo2L-0005mJ-OM for qemu-devel@nongnu.org; Thu, 09 Nov 2017 09:42:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCo2H-0002rD-66 for qemu-devel@nongnu.org; Thu, 09 Nov 2017 09:42:33 -0500 Received: from bran.ispras.ru ([83.149.199.196]:54420 helo=smtp.ispras.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCo2G-0002r0-UT for qemu-devel@nongnu.org; Thu, 09 Nov 2017 09:42:29 -0500 Received: from bulbul.intra.ispras.ru (bulbul.intra.ispras.ru [10.10.3.51]) by smtp.ispras.ru (Postfix) with ESMTP id 4611C203C2; Thu, 9 Nov 2017 17:42:28 +0300 (MSK) From: Kirill Batuzov To: qemu-devel@nongnu.org Date: Thu, 9 Nov 2017 17:41:53 +0300 Message-Id: <20171109144155.17076-2-batuzovk@ispras.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171109144155.17076-1-batuzovk@ispras.ru> References: <20171109144155.17076-1-batuzovk@ispras.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 83.149.199.196 Subject: [Qemu-devel] [PATCH RFC 1/3] tcg: support MOV_VEC and MOVI_VEC opcodes in register allocator X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kirill Batuzov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Kirill Batuzov --- tcg/tcg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tcg/tcg.c b/tcg/tcg.c index a7854a59a1..6db7dd526a 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -3327,10 +3327,12 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *t= b) switch (opc) { case INDEX_op_mov_i32: case INDEX_op_mov_i64: + case INDEX_op_mov_vec: tcg_reg_alloc_mov(s, op); break; case INDEX_op_movi_i32: case INDEX_op_movi_i64: + case INDEX_op_movi_vec: tcg_reg_alloc_movi(s, op); break; case INDEX_op_insn_start: --=20 2.11.0 From nobody Mon May 6 17:48:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510238679952886.1396942086855; Thu, 9 Nov 2017 06:44:39 -0800 (PST) Received: from localhost ([::1]:37244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCo4G-00072j-2C for importer@patchew.org; Thu, 09 Nov 2017 09:44:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCo2O-0005os-Ua for qemu-devel@nongnu.org; Thu, 09 Nov 2017 09:42:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCo2M-0002vf-0W for qemu-devel@nongnu.org; Thu, 09 Nov 2017 09:42:37 -0500 Received: from bran.ispras.ru ([83.149.199.196]:54493 helo=smtp.ispras.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCo2L-0002vH-GO for qemu-devel@nongnu.org; Thu, 09 Nov 2017 09:42:33 -0500 Received: from bulbul.intra.ispras.ru (bulbul.intra.ispras.ru [10.10.3.51]) by smtp.ispras.ru (Postfix) with ESMTP id D5E44203C2; Thu, 9 Nov 2017 17:42:32 +0300 (MSK) From: Kirill Batuzov To: qemu-devel@nongnu.org Date: Thu, 9 Nov 2017 17:41:54 +0300 Message-Id: <20171109144155.17076-3-batuzovk@ispras.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171109144155.17076-1-batuzovk@ispras.ru> References: <20171109144155.17076-1-batuzovk@ispras.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 83.149.199.196 Subject: [Qemu-devel] [PATCH RFC 2/3] tcg/optimize: do copy propagation for memory locations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kirill Batuzov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" During copy propagation phase, keep track of memory locations that store va= lue of a known live variable. Only memory locations that are addressed relative= to ENV are accounted. Any other access types are handled conservatively. When a load is encountered, source memory location is checked against list = of known memory locations. If its content is a copy of some variable, then MOV= or EXT from this variable is issued instead of load. This allows us to keep va= lues of some CPUState fields that are not represented by global variables on host registers during computations involving them. Signed-off-by: Kirill Batuzov --- tcg/optimize.c | 266 +++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 266 insertions(+) diff --git a/tcg/optimize.c b/tcg/optimize.c index 847dfa44c9..da7f069444 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -38,8 +38,28 @@ struct tcg_temp_info { TCGTemp *next_copy; tcg_target_ulong val; tcg_target_ulong mask; + struct TCGMemLocation *mem_loc; }; =20 +typedef struct TCGMemLocation { + /* Offset is relative to ENV. Only fields of CPUState are accounted. = */ + tcg_target_ulong offset; + tcg_target_ulong size; + TCGType type; + /* Pointer to a temp containing a valid copy of this memory location. = */ + TCGTemp *copy; + /* Pointer to the next memory location containing copy of the same + content. */ + struct TCGMemLocation *next_copy; + + /* Double-linked list of all memory locations. */ + struct TCGMemLocation *next; + struct TCGMemLocation **prev_ptr; +} TCGMemLocation; + +struct TCGMemLocation *mem_locations; +struct TCGMemLocation *free_mls; + static inline struct tcg_temp_info *ts_info(TCGTemp *ts) { return ts->state_ptr; @@ -70,6 +90,34 @@ static inline bool arg_is_copy(TCGArg arg) return ts_is_copy(arg_temp(arg)); } =20 +/* Reset MEMORY LOCATION state. */ +static void reset_ml(TCGMemLocation *ml) +{ + if (!ml) { + return ; + } + if (ml->copy) { + TCGMemLocation **prev_ptr =3D &ts_info(ml->copy)->mem_loc; + TCGMemLocation *cur_ptr =3D ts_info(ml->copy)->mem_loc; + while (cur_ptr && cur_ptr !=3D ml) { + prev_ptr =3D &cur_ptr->next_copy; + cur_ptr =3D cur_ptr->next_copy; + } + *prev_ptr =3D ml->next_copy; + if (ts_info(ml->copy)->mem_loc =3D=3D ml) { + ts_info(ml->copy)->mem_loc =3D ml->next_copy; + } + } + + *ml->prev_ptr =3D ml->next; + if (ml->next) { + ml->next->prev_ptr =3D ml->prev_ptr; + } + ml->prev_ptr =3D NULL; + ml->next =3D free_mls; + free_mls =3D ml; +} + /* Reset TEMP's state, possibly removing the temp for the list of copies. = */ static void reset_ts(TCGTemp *ts) { @@ -77,12 +125,27 @@ static void reset_ts(TCGTemp *ts) struct tcg_temp_info *pi =3D ts_info(ti->prev_copy); struct tcg_temp_info *ni =3D ts_info(ti->next_copy); =20 + if (ti->mem_loc && ts_is_copy(ts) && 0) { + TCGMemLocation *ml, *nml; + for (ml =3D ti->mem_loc; ml; ml =3D nml) { + nml =3D ml->next_copy; + ml->copy =3D ti->next_copy; + ml->next_copy =3D ni->mem_loc; + ni->mem_loc =3D ml; + } + } else { + while (ti->mem_loc) { + reset_ml(ti->mem_loc); + } + } + ni->prev_copy =3D ti->prev_copy; pi->next_copy =3D ti->next_copy; ti->next_copy =3D ts; ti->prev_copy =3D ts; ti->is_const =3D false; ti->mask =3D -1; + ti->mem_loc =3D NULL; } =20 static void reset_temp(TCGArg arg) @@ -103,6 +166,7 @@ static void init_ts_info(struct tcg_temp_info *infos, ti->prev_copy =3D ts; ti->is_const =3D false; ti->mask =3D -1; + ti->mem_loc =3D NULL; set_bit(idx, temps_used->l); } } @@ -119,6 +183,92 @@ static int op_bits(TCGOpcode op) return def->flags & TCG_OPF_64BIT ? 64 : 32; } =20 +/* Allocate a new MEMORY LOCATION of reuse a free one. */ +static TCGMemLocation *alloc_ml(void) +{ + if (free_mls) { + TCGMemLocation *ml =3D free_mls; + free_mls =3D free_mls->next; + return ml; + } + return tcg_malloc(sizeof(TCGMemLocation)); +} + +/* Allocate and initialize MEMORY LOCATION. */ +static TCGMemLocation *new_ml(tcg_target_ulong off, tcg_target_ulong sz, + TCGTemp *copy) +{ + TCGMemLocation *ml =3D alloc_ml(); + + ml->offset =3D off; + ml->size =3D sz; + ml->copy =3D copy; + if (copy) { + ml->type =3D copy->base_type; + ml->next_copy =3D ts_info(copy)->mem_loc; + ts_info(copy)->mem_loc =3D ml; + } else { + tcg_abort(); + } + ml->next =3D mem_locations; + if (ml->next) { + ml->next->prev_ptr =3D &ml->next; + } + ml->prev_ptr =3D &mem_locations; + mem_locations =3D ml; + return ml; +} + +static TCGMemLocation *find_ml(tcg_target_ulong off, tcg_target_ulong sz, + TCGType type) +{ + TCGMemLocation *mi; + for (mi =3D mem_locations; mi; mi =3D mi->next) { + if (mi->offset =3D=3D off && mi->size =3D=3D sz && mi->type =3D=3D= type) { + return mi; + } + } + return NULL; +} + +static bool range_intersect(tcg_target_ulong off1, tcg_target_ulong sz1, + tcg_target_ulong off2, tcg_target_ulong sz2) +{ + if (off1 + sz1 <=3D off2) { + return false; + } + if (off2 + sz2 <=3D off1) { + return false; + } + return true; +} + +static void remove_ml_range(tcg_target_ulong off, tcg_target_ulong sz) +{ + TCGMemLocation *mi, *next; + for (mi =3D mem_locations; mi; mi =3D next) { + next =3D mi->next; + if (range_intersect(mi->offset, mi->size, off, sz)) { + reset_ml(mi); + } + } +} + +static void reset_all_ml(void) +{ + TCGMemLocation *ml, *nml; + for (ml =3D mem_locations; ml; ml =3D nml) { + nml =3D ml->next; + if (ml->copy) { + ts_info(ml->copy)->mem_loc =3D NULL; + } + ml->next =3D free_mls; + ml->copy =3D NULL; + free_mls =3D ml; + } + mem_locations =3D NULL; +} + static TCGOpcode op_to_mov(TCGOpcode op) { switch (op_bits(op)) { @@ -147,6 +297,34 @@ static TCGOpcode op_to_movi(TCGOpcode op) } } =20 +static TCGOpcode ld_to_mov(TCGOpcode op) +{ +#define LD_TO_EXT(sz, w) \ + case glue(glue(INDEX_op_ld, sz), glue(_i, w)): \ + return glue(glue(INDEX_op_ext, sz), glue(_i, w)) + + switch (op) { + LD_TO_EXT(8s, 32); + LD_TO_EXT(8u, 32); + LD_TO_EXT(16s, 32); + LD_TO_EXT(16u, 32); + LD_TO_EXT(8s, 64); + LD_TO_EXT(8u, 64); + LD_TO_EXT(16s, 64); + LD_TO_EXT(16u, 64); + LD_TO_EXT(32s, 64); + LD_TO_EXT(32u, 64); + case INDEX_op_ld_i32: + return INDEX_op_mov_i32; + case INDEX_op_ld_i64: + return INDEX_op_mov_i64; + default: + tcg_abort(); + } + +#undef LD_TO_EXT +} + static TCGTemp *find_better_copy(TCGContext *s, TCGTemp *ts) { TCGTemp *i; @@ -604,6 +782,32 @@ static bool swap_commutative2(TCGArg *p1, TCGArg *p2) return false; } =20 +static int ldst_size(const TCGOp *op) +{ + switch (op->opc) { + CASE_OP_32_64(st8): + CASE_OP_32_64(ld8u): + CASE_OP_32_64(ld8s): + return 1; + CASE_OP_32_64(st16): + CASE_OP_32_64(ld16u): + CASE_OP_32_64(ld16s): + return 2; + case INDEX_op_st32_i64: + case INDEX_op_ld32u_i64: + case INDEX_op_ld32s_i64: + case INDEX_op_st_i32: + case INDEX_op_ld_i32: + return 4; + case INDEX_op_st_i64: + case INDEX_op_ld_i64: + return 8; + default: + /* Some unsupported opcode? */ + tcg_abort(); + } +} + /* Propagate constants and copies, fold constant expressions. */ void tcg_optimize(TCGContext *s) { @@ -611,6 +815,10 @@ void tcg_optimize(TCGContext *s) TCGOp *prev_mb =3D NULL; struct tcg_temp_info *infos; TCGTempSet temps_used; + TCGMemLocation *ml; + + mem_locations =3D NULL; + free_mls =3D NULL; =20 /* Array VALS has an element for each temp. If this temp holds a constant then its value is kept in VALS' eleme= nt. @@ -644,6 +852,9 @@ void tcg_optimize(TCGContext *s) init_ts_info(infos, &temps_used, ts); } } + if (!(op->args[nb_oargs + nb_iargs + 1] & TCG_CALL_NO_SE)) { + reset_all_ml(); + } } else { nb_oargs =3D def->nb_oargs; nb_iargs =3D def->nb_iargs; @@ -660,6 +871,10 @@ void tcg_optimize(TCGContext *s) } } =20 + if (def->flags & TCG_OPF_BB_END) { + reset_all_ml(); + } + /* For commutative operations make constant second argument */ switch (opc) { CASE_OP_32_64(add): @@ -1441,6 +1656,57 @@ void tcg_optimize(TCGContext *s) } break; =20 + CASE_OP_32_64(st8): + CASE_OP_32_64(st16): + CASE_OP_32_64(st): + case INDEX_op_st32_i64: + if (op->args[1] =3D=3D tcgv_ptr_arg(cpu_env)) { + remove_ml_range(op->args[2], ldst_size(op)); + new_ml(op->args[2], ldst_size(op), arg_temp(op->args[0])); + } else { + /* Store to an unknown location. Any of the exisitng + locations could be affected. Reset them all. */ + reset_all_ml(); + } + goto do_default; + + CASE_OP_32_64(ld8u): + CASE_OP_32_64(ld8s): + CASE_OP_32_64(ld16u): + CASE_OP_32_64(ld16s): + CASE_OP_32_64(ld): + case INDEX_op_ld32s_i64: + case INDEX_op_ld32u_i64: + /* Only loads that are relative to ENV can be handled. */ + if (op->args[1] =3D=3D tcgv_ptr_arg(cpu_env)) { + ml =3D find_ml(op->args[2], ldst_size(op), + arg_temp(op->args[0])->base_type); + if (ml && ml->copy) { + TCGOpcode re =3D ld_to_mov(opc); + if (re =3D=3D INDEX_op_mov_i32 || re =3D=3D INDEX_op_m= ov_i64) { + /* No sign/zero extension needed. OP is a move. + Handle this case separately to track copies. */ + TCGTemp *copy =3D find_better_copy(s, ml->copy); + tcg_opt_gen_mov(s, op, op->args[0], temp_arg(copy)= ); + break; + } else { + if (tcg_op_defs[re].flags & TCG_OPF_NOT_PRESENT) { + /* Required operation is not supported by host= . */ + goto do_default; + } + op->opc =3D re; + op->args[1] =3D temp_arg(find_better_copy(s, ml->c= opy)); + } + } else { + assert(!ml); + reset_temp(op->args[0]); + arg_info(op->args[0])->mask =3D mask; + new_ml(op->args[2], ldst_size(op), arg_temp(op->args[0= ])); + break; + } + } + goto do_reset_output; + case INDEX_op_call: if (!(op->args[nb_oargs + nb_iargs + 1] & (TCG_CALL_NO_READ_GLOBALS | TCG_CALL_NO_WRITE_GLOBALS)= )) { --=20 2.11.0 From nobody Mon May 6 17:48:35 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510238800295446.7156002738675; Thu, 9 Nov 2017 06:46:40 -0800 (PST) Received: from localhost ([::1]:37261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCo66-00008F-8P for importer@patchew.org; Thu, 09 Nov 2017 09:46:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCo2S-0005rW-09 for qemu-devel@nongnu.org; Thu, 09 Nov 2017 09:42:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCo2R-000304-0T for qemu-devel@nongnu.org; Thu, 09 Nov 2017 09:42:40 -0500 Received: from bran.ispras.ru ([83.149.199.196]:54554 helo=smtp.ispras.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCo2Q-0002zO-Os for qemu-devel@nongnu.org; Thu, 09 Nov 2017 09:42:38 -0500 Received: from bulbul.intra.ispras.ru (bulbul.intra.ispras.ru [10.10.3.51]) by smtp.ispras.ru (Postfix) with ESMTP id 24DAC203C2; Thu, 9 Nov 2017 17:42:38 +0300 (MSK) From: Kirill Batuzov To: qemu-devel@nongnu.org Date: Thu, 9 Nov 2017 17:41:55 +0300 Message-Id: <20171109144155.17076-4-batuzovk@ispras.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171109144155.17076-1-batuzovk@ispras.ru> References: <20171109144155.17076-1-batuzovk@ispras.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 83.149.199.196 Subject: [Qemu-devel] [PATCH RFC 3/3] tcg/optimize: handle vector loads and stores during copy propagation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Kirill Batuzov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Kirill Batuzov --- tcg/optimize.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tcg/optimize.c b/tcg/optimize.c index da7f069444..1b6962c6c5 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -318,6 +318,8 @@ static TCGOpcode ld_to_mov(TCGOpcode op) return INDEX_op_mov_i32; case INDEX_op_ld_i64: return INDEX_op_mov_i64; + case INDEX_op_ld_vec: + return INDEX_op_mov_vec; default: tcg_abort(); } @@ -782,6 +784,13 @@ static bool swap_commutative2(TCGArg *p1, TCGArg *p2) return false; } =20 +static int tcg_vec_size(const TCGOp *op) +{ + TCGArg arg =3D op->args[0]; + TCGTemp *tmp =3D arg_temp(arg); + return 1 << (3 + tmp->base_type - TCG_TYPE_V64); +} + static int ldst_size(const TCGOp *op) { switch (op->opc) { @@ -802,6 +811,9 @@ static int ldst_size(const TCGOp *op) case INDEX_op_st_i64: case INDEX_op_ld_i64: return 8; + case INDEX_op_ld_vec: + case INDEX_op_st_vec: + return tcg_vec_size(op); default: /* Some unsupported opcode? */ tcg_abort(); @@ -1660,6 +1672,7 @@ void tcg_optimize(TCGContext *s) CASE_OP_32_64(st16): CASE_OP_32_64(st): case INDEX_op_st32_i64: + case INDEX_op_st_vec: if (op->args[1] =3D=3D tcgv_ptr_arg(cpu_env)) { remove_ml_range(op->args[2], ldst_size(op)); new_ml(op->args[2], ldst_size(op), arg_temp(op->args[0])); @@ -1677,6 +1690,7 @@ void tcg_optimize(TCGContext *s) CASE_OP_32_64(ld): case INDEX_op_ld32s_i64: case INDEX_op_ld32u_i64: + case INDEX_op_ld_vec: /* Only loads that are relative to ENV can be handled. */ if (op->args[1] =3D=3D tcgv_ptr_arg(cpu_env)) { ml =3D find_ml(op->args[2], ldst_size(op), @@ -1689,6 +1703,14 @@ void tcg_optimize(TCGContext *s) TCGTemp *copy =3D find_better_copy(s, ml->copy); tcg_opt_gen_mov(s, op, op->args[0], temp_arg(copy)= ); break; + } else if (re =3D=3D INDEX_op_mov_vec) { + if (ts_are_copies(arg_temp(op->args[0]), ml->copy)= ) { + tcg_op_remove(s, op); + break; + } + op->opc =3D re; + op->args[1] =3D temp_arg(find_better_copy(s, ml->c= opy)); + op->args[2] =3D op->args[3]; } else { if (tcg_op_defs[re].flags & TCG_OPF_NOT_PRESENT) { /* Required operation is not supported by host= . */ --=20 2.11.0