|
| From: | Richard Henderson |
| Subject: | Re: [PATCH v2 06/12] target/ppc: Add PPR32 SPR |
| Date: | Tue, 21 May 2024 10:40:37 -0700 |
| User-agent: | Mozilla Thunderbird |
On 5/20/24 18:30, Nicholas Piggin wrote:
+void spr_write_ppr32(DisasContext *ctx, int sprn, int gprn)
+{
+ TCGv t0 = tcg_temp_new();
+
+ tcg_gen_shli_tl(t0, cpu_gpr[gprn], 32);
+ gen_store_spr(SPR_PPR, t0);
+ spr_store_dump_spr(SPR_PPR);
+}
The documentation isn't clear on whether this zaps the low 32 bits. If the low bits of PPR are {reserved, must-be-zero, undefined} or suchlike, this is fine.
If not, then you need a deposit here, to preserve those bits, e.g.:
gen_load_spr(t0, SPR_PPR);
tcg_gen_deposit_tl(t0, t0, cpu_gpr[gprn], 32, 32);
gen_store_spr(SPR_PPR, t0);
Anyway, it might be best to add a comment here re the above.
r~
| [Prev in Thread] | Current Thread | [Next in Thread] |