Re: [PATCH 3/3] powerpc: Fix pre-update addressing in inline assembly

From: Christophe Leroy
Date: Tue Oct 20 2020 - 03:44:45 EST




Le 19/10/2020 à 22:24, Segher Boessenkool a écrit :
On Mon, Oct 19, 2020 at 12:12:48PM +0000, Christophe Leroy wrote:
In several places, inline assembly uses the "%Un" modifier
to enable the use of instruction with pre-update addressing,

Calling this "pre-update" is misleading: the register is not updated
before the address is generated (or the memory access done!), and the
addressing is exactly the same as the "non-u" insn would use. It is
called an "update form" instruction, because (at the same time as doing
the memory access, logically anyway) it writes back the address used to
the base register.

but the associated "<>" constraint is missing.

But that is just fine. Pointless, sure, but not a bug.

Most of those are from prehistoric code. So at some point in time it was effective. Then one day GCC changed it's way and they became pointless. So, not a software bug, but still a regression at some point.


Use UPD_CONSTR macro everywhere %Un modifier is used.

Eww. My poor stomach.

There are not that many :)


Have you verified that update form is *correct* in all these, and that
we even *want* this there?

I can't see anything that would militate against it, do you ?

I guess if the elders have put %Us there, it was wanted.

Christophe