[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250705220538.1bbe5195@pumpkin>
Date: Sat, 5 Jul 2025 22:05:38 +0100
From: David Laight <david.laight.linux@...il.com>
To: Segher Boessenkool <segher@...nel.crashing.org>
Cc: Christophe Leroy <christophe.leroy@...roup.eu>, Michael Ellerman
<mpe@...erman.id.au>, Nicholas Piggin <npiggin@...il.com>, Naveen N Rao
<naveen@...nel.org>, Madhavan Srinivasan <maddy@...ux.ibm.com>, Alexander
Viro <viro@...iv.linux.org.uk>, Christian Brauner <brauner@...nel.org>, Jan
Kara <jack@...e.cz>, Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar
<mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>, Darren Hart
<dvhart@...radead.org>, Davidlohr Bueso <dave@...olabs.net>, Andre Almeida
<andrealmeid@...lia.com>, Andrew Morton <akpm@...ux-foundation.org>, Dave
Hansen <dave.hansen@...ux.intel.com>, Linus Torvalds
<torvalds@...ux-foundation.org>, linux-kernel@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org
Subject: Re: [PATCH 0/5] powerpc: Implement masked user access
On Sat, 5 Jul 2025 15:15:57 -0500
Segher Boessenkool <segher@...nel.crashing.org> wrote:
...
> The isel machine instruction is super expensive on p8: it is marked as
> first in an instruction group, and has latency 5 for the GPR sources,
> and 8 for the CR field source.
>
> On p7 it wasn't great either, it was actually converted to a branch
> sequence internally!
Ugg...
You'd think they'd add instructions that can be implemented.
It isn't as though isel is any harder than 'add with carry'.
Not that uncommon, IIRC amd added adox/adcx (add carry using the
overflow/carry flag and without changing any other flags) as very
slow instructions. Intel invented them without making jcxz (dec %cx
and jump non-zero) fast - so you can't (easily) put them in a loop.
Not to mention all the AVX512 fubars.
Conditional move is more of a problem with a mips-like cpu where
alu ops read two registers and write a third.
You don't want to do a conditional write because it messes up
the decision of whether to forward the alu result to the following
instruction.
So I think you might need to do 'cmov odd/even' and read the LSB
from a third copy (or third read port) of the registers indexed
by what would normally be the 'output' register number.
Then tweak the register numbers early in the pipeline so that the
result goes to one of the 'input' registers rather than the normal
'output' one.
Not really that hard - could add to the cpu I did in 1/2 a day :-)
David
Powered by blists - more mailing lists