aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2024-03-27 12:50:07 -1000
committerRichard Henderson <richard.henderson@linaro.org>2024-05-15 09:58:45 +0200
commit1874e6c2fdb351120c234e6840729c9553d77d05 (patch)
tree9a5d1e17f8edafc09fe5bc00982bf14cd4ad23ae /target
parent0bb0202962a5f77d1e4cac4533628bb7a566de54 (diff)
downloadqemu-1874e6c2fdb351120c234e6840729c9553d77d05.zip
qemu-1874e6c2fdb351120c234e6840729c9553d77d05.tar.gz
qemu-1874e6c2fdb351120c234e6840729c9553d77d05.tar.bz2
target/hppa: Always make a copy in do_ibranch_priv
This simplifies callers, which might otherwise have to make another copy. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target')
-rw-r--r--target/hppa/translate.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index e9ba792..1ede4bd 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -1968,18 +1968,17 @@ static bool do_ibranch(DisasContext *ctx, TCGv_i64 dest, TCGv_i64 dspc,
*/
static TCGv_i64 do_ibranch_priv(DisasContext *ctx, TCGv_i64 offset)
{
- TCGv_i64 dest;
+ TCGv_i64 dest = tcg_temp_new_i64();
switch (ctx->privilege) {
case 0:
/* Privilege 0 is maximum and is allowed to decrease. */
- return offset;
+ tcg_gen_mov_i64(dest, offset);
+ break;
case 3:
/* Privilege 3 is minimum and is never allowed to increase. */
- dest = tcg_temp_new_i64();
tcg_gen_ori_i64(dest, offset, 3);
break;
default:
- dest = tcg_temp_new_i64();
tcg_gen_andi_i64(dest, offset, -4);
tcg_gen_ori_i64(dest, dest, ctx->privilege);
tcg_gen_umax_i64(dest, dest, offset);