mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
target/ppc: Change VSX instructions behavior to fill with zeros
ISA v3.1 changed some VSX instructions behavior by changing what the other words/doubleword in the result should contain when the result is only one word/doubleword. e.g. xsmaxdp operates on doubleword 0 and saves the result also in doubleword 0. Before, the second doubleword result was undefined according to the ISA, but now it's stated that it should be zeroed. Even tough the result was undefined before, hardware implementing these instructions already filled these fields with 0s. Changing every ISA version in QEMU to this behavior makes the results match what happens in hardware. Signed-off-by: Víctor Colombo <victor.colombo@eldorado.org.br> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220204181944.65063-1-victor.colombo@eldorado.org.br> Signed-off-by: Cédric Le Goater <clg@kaod.org>
This commit is contained in:
parent
10895ab6f7
commit
205eb5a89e
2 changed files with 16 additions and 14 deletions
|
@ -747,6 +747,7 @@ static void glue(gen_, name)(DisasContext *ctx) \
|
|||
} \
|
||||
} \
|
||||
set_cpu_vsr(xT(ctx->opcode), xb, true); \
|
||||
set_cpu_vsr(xT(ctx->opcode), tcg_constant_i64(0), false); \
|
||||
tcg_temp_free_i64(xb); \
|
||||
tcg_temp_free_i64(sgm); \
|
||||
}
|
||||
|
@ -1073,6 +1074,7 @@ static void gen_##name(DisasContext *ctx) \
|
|||
get_cpu_vsr(t0, xB(ctx->opcode), true); \
|
||||
gen_helper_##name(t1, cpu_env, t0); \
|
||||
set_cpu_vsr(xT(ctx->opcode), t1, true); \
|
||||
set_cpu_vsr(xT(ctx->opcode), tcg_constant_i64(0), false); \
|
||||
tcg_temp_free_i64(t0); \
|
||||
tcg_temp_free_i64(t1); \
|
||||
}
|
||||
|
@ -1700,7 +1702,7 @@ static void gen_xsiexpdp(DisasContext *ctx)
|
|||
tcg_gen_shli_i64(t0, t0, 52);
|
||||
tcg_gen_or_i64(xth, xth, t0);
|
||||
set_cpu_vsr(xT(ctx->opcode), xth, true);
|
||||
/* dword[1] is undefined */
|
||||
set_cpu_vsr(xT(ctx->opcode), tcg_constant_i64(0), false);
|
||||
tcg_temp_free_i64(t0);
|
||||
tcg_temp_free_i64(xth);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue