[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/31] target/loongarch: Sign extend results in VA32 mode
From: |
Song Gao |
Subject: |
[PULL 18/31] target/loongarch: Sign extend results in VA32 mode |
Date: |
Thu, 24 Aug 2023 17:23:56 +0800 |
From: Jiajie Chen <c@jia.je>
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>
---
target/loongarch/translate.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/loongarch/translate.c b/target/loongarch/translate.c
index 9a23ec786d..de7c1c5d1f 100644
--- a/target/loongarch/translate.c
+++ b/target/loongarch/translate.c
@@ -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;
}
--
2.39.1
- [PULL 05/31] target/loongarch: Extract 64-bit specifics to loongarch64_cpu_class_init, (continued)
- [PULL 05/31] target/loongarch: Extract 64-bit specifics to loongarch64_cpu_class_init, Song Gao, 2023/08/24
- [PULL 07/31] target/loongarch: Add new object class for loongarch32 cpus, Song Gao, 2023/08/24
- [PULL 09/31] target/loongarch: Support LoongArch32 TLB entry, Song Gao, 2023/08/24
- [PULL 04/31] target/loongarch: Introduce abstract TYPE_LOONGARCH64_CPU, Song Gao, 2023/08/24
- [PULL 08/31] target/loongarch: Add GDB support for loongarch32 mode, Song Gao, 2023/08/24
- [PULL 06/31] target/loongarch: Add function to check current arch, Song Gao, 2023/08/24
- [PULL 01/31] target/loongarch: Log I/O write accesses to CSR registers, Song Gao, 2023/08/24
- [PULL 22/31] hw/loongarch: Remove restriction of la464 cores in the virt machine, Song Gao, 2023/08/24
- [PULL 23/31] target/loongarch: Add avail_FP/FP_SP/FP_DP to check fpu instructions, Song Gao, 2023/08/24
- [PULL 15/31] target/loongarch: Extract make_address_pc() helper, Song Gao, 2023/08/24
- [PULL 18/31] target/loongarch: Sign extend results in VA32 mode,
Song Gao <=
- [PULL 27/31] target/loongarch: Add avail_IOCSR to check iocsr instructions, Song Gao, 2023/08/24
- [PULL 12/31] target/loongarch: Add LA64 & VA32 to DisasContext, Song Gao, 2023/08/24
- [PULL 16/31] target/loongarch: Extract set_pc() helper, Song Gao, 2023/08/24
- [PULL 20/31] target/loongarch: Add avail_64 to check la64-only instructions, Song Gao, 2023/08/24
- [PULL 24/31] target/loongarch: Add avail_LSPW to check LSPW instructions, Song Gao, 2023/08/24
- [PULL 29/31] hw/intc/loongarch_pch: fix edge triggered irq handling, Song Gao, 2023/08/24
- [PULL 25/31] target/loongarch: Add avail_LAM to check atomic instructions, Song Gao, 2023/08/24
- [PULL 17/31] target/loongarch: Truncate high 32 bits of address in VA32 mode, Song Gao, 2023/08/24
- [PULL 21/31] target/loongarch: Add LoongArch32 cpu la132, Song Gao, 2023/08/24
- [PULL 19/31] target/loongarch: Add a check parameter to the TRANS macro, Song Gao, 2023/08/24