提交 cab48881 编写于 作者: M Miodrag Dinic 提交者: Yongbok Kim

target/mips: fix msa copy_[s|u]_df rd = 0 corner case

This patch fixes the msa copy_[s|u]_df instruction emulation when
the destination register rd is zero. Without this patch the zero
register would get clobbered, which should never happen because it
is supposed to be hardwired to 0.

Fix this corner case by explicitly checking rd = 0 and effectively
making these instructions emulation no-op in that case.
Signed-off-by: NMiodrag Dinic <miodrag.dinic@imgtec.com>
Reviewed-by: NAurelien Jarno <aurelien@aurel32.net>
Acked-by: NAurelien Jarno <aurelien@aurel32.net>
Signed-off-by: NYongbok Kim <yongbok.kim@imgtec.com>
上级 b5ed2e11
......@@ -18712,10 +18712,14 @@ static void gen_msa_elm_df(CPUMIPSState *env, DisasContext *ctx, uint32_t df,
#endif
switch (MASK_MSA_ELM(ctx->opcode)) {
case OPC_COPY_S_df:
gen_helper_msa_copy_s_df(cpu_env, tdf, twd, tws, tn);
if (likely(wd != 0)) {
gen_helper_msa_copy_s_df(cpu_env, tdf, twd, tws, tn);
}
break;
case OPC_COPY_U_df:
gen_helper_msa_copy_u_df(cpu_env, tdf, twd, tws, tn);
if (likely(wd != 0)) {
gen_helper_msa_copy_u_df(cpu_env, tdf, twd, tws, tn);
}
break;
case OPC_INSERT_df:
gen_helper_msa_insert_df(cpu_env, tdf, twd, tws, tn);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册