[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-7.1 v6 42/51] target/nios2: Implement rdprs, wrprs
From: |
Peter Maydell |
Subject: |
Re: [PATCH for-7.1 v6 42/51] target/nios2: Implement rdprs, wrprs |
Date: |
Thu, 17 Mar 2022 18:47:58 +0000 |
On Thu, 17 Mar 2022 at 05:55, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Implement these out of line, so that tcg global temps
> (aka the architectural registers) are synced back to
> tcg storage as required. This makes sure that we get
> the proper results when status.PRS == status.CRS.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> +void helper_wrprs(CPUNios2State *env, uint32_t regno, uint32_t val)
> +{
> + unsigned prs = FIELD_EX32(env->ctrl[CR_STATUS], CR_STATUS, PRS);
> + env->shadow_regs[prs][regno] = val;
> +}
If we have the TB flag for "r0 is 0", then we'd need to make
wrprs writes to r0 in the current register set end the TB.
(If I'd been designing the ISA, I'd have made attempts to
use wrprs/rdprs with CRS == PRS cause an exception.)
Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
- Re: [PATCH for-7.1 v6 39/51] target/nios2: Implement Misaligned destination exception, (continued)
- [PATCH for-7.1 v6 38/51] target/nios2: Use tcg_gen_lookup_and_goto_ptr, Richard Henderson, 2022/03/17
- [PATCH for-7.1 v6 40/51] linux-user/nios2: Handle various SIGILL exceptions, Richard Henderson, 2022/03/17
- [PATCH for-7.1 v6 41/51] target/nios2: Introduce shadow register sets, Richard Henderson, 2022/03/17
- [PATCH for-7.1 v6 42/51] target/nios2: Implement rdprs, wrprs, Richard Henderson, 2022/03/17
- Re: [PATCH for-7.1 v6 42/51] target/nios2: Implement rdprs, wrprs,
Peter Maydell <=
- [PATCH for-7.1 v6 43/51] target/nios2: Update helper_eret for shadow registers, Richard Henderson, 2022/03/17
- [PATCH for-7.1 v6 44/51] target/nios2: Implement EIC interrupt processing, Richard Henderson, 2022/03/17
- [PATCH for-7.1 v6 46/51] hw/nios2: Introduce Nios2MachineState, Richard Henderson, 2022/03/17
- [PATCH for-7.1 v6 45/51] hw/intc: Vectored Interrupt Controller (VIC), Richard Henderson, 2022/03/17
- [PATCH for-7.1 v6 50/51] test/tcg/nios2: Add semihosting multiarch tests, Richard Henderson, 2022/03/17
- [PATCH for-7.1 v6 51/51] tests/tcg/nios2: Add test-shadow-1, Richard Henderson, 2022/03/17
- [PATCH for-7.1 v6 47/51] hw/nios2: Move memory regions into Nios2Machine, Richard Henderson, 2022/03/17