Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
target/loongarch: Sign extend results in VA32 mode
In VA32 mode, BL, JIRL and PC* instructions should sign-extend the low
32 bit result to 64 bits.

Signed-off-by: Jiajie Chen <c@jia.je>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230822032724.1353391-7-gaosong@loongson.cn>
Message-Id: <20230822071959.35620-1-philmd@linaro.org>
  • Loading branch information
jiegec authored and gaosong-loongson committed Aug 24, 2023
1 parent 7033c0e commit 6496269
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions target/loongarch/translate.c
Expand Up @@ -238,6 +238,9 @@ static TCGv make_address_i(DisasContext *ctx, TCGv base, target_long ofs)

static uint64_t make_address_pc(DisasContext *ctx, uint64_t addr)
{
if (ctx->va32) {
addr = (int32_t)addr;
}
return addr;
}

Expand Down

0 comments on commit 6496269

Please sign in to comment.