On 2/4/26 09:00, Philippe Mathieu-Daudé wrote:
Sign-extend the result when the MO_SIGN flag is requested
in TCG common CPU TLB handling.
Remote the SPARC specific handling.
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
accel/tcg/cputlb.c | 37 +++++++++++++++++++++++++++++++------
target/sparc/ldst_helper.c | 9 ---------
2 files changed, 31 insertions(+), 15 deletions(-)
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 76546c66515..97782997881 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -2296,12 +2296,18 @@ static uint8_t do_ld1_mmu(CPUState *cpu, vaddr addr,
MemOpIdx oi,
{
MMULookupLocals l;
bool crosspage;
+ uint8_t ret;
cpu_req_mo(cpu, TCG_MO_LD_LD | TCG_MO_ST_LD);
crosspage = mmu_lookup(cpu, addr, oi, ra, access_type, &l);
tcg_debug_assert(!crosspage);
- return do_ld_1(cpu, &l.page[0], l.mmu_idx, access_type, ra);
+ ret = do_ld_1(cpu, &l.page[0], l.mmu_idx, access_type, ra);
+
+ if (l.memop & MO_SIGN) {
+ ret = (int8_t)ret;
+ }
+ return ret;
}
Nope. The return type is uint8_t, so this doesn't change anything at all.
r~