diff options
author | J. Neuschäfer <j.ne@posteo.net> | 2024-12-12 18:05:46 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-12-30 15:55:07 -0600 |
commit | fd1c2938c0ef23db322b974a5d2b8020aa6a8750 (patch) | |
tree | 2ce93b0cd5cf39687688e54d2432651b3d3a0d39 /drivers/ddr/imx/imx8m/ddr_init.c | |
parent | e5aef1bbf11412eebd4c242b46adff5301353c30 (diff) |
powerpc: Fix 0 vs. r0 confusion in X/D-form instructions
Instructions such as dcbi are in the X-form; they have RA and RB fields
and the effective address (EA) is computed as (RA|0)+(RB). In words,
this means that if RA is zero, the left-hand side of the addition is
zero, otherwise the corresponding GPR is used. r0 can never be used on
the left-hand side of a X-form instruction.
For D-form instructions such as addis, the Power ISA illustrates this in
the instruction pseudo-code:
if RA = 0 then RT <- EXTS(SI || 0x0000)
else RT <- (RA) + EXIS(SI || 0x0000)
In all of these cases, RA=0 indicates the value zero, not register r0.
I verified with gazerbeam_defconfig (MPC83xx) and qemu-ppce500_defconfig
(MPC85xx) that this patch results in the same machine code.
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Diffstat (limited to 'drivers/ddr/imx/imx8m/ddr_init.c')
0 files changed, 0 insertions, 0 deletions