lkml.org 
[lkml]   [2019]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] powerpc: slightly improve cache helpers
From
Date


Le 07/05/2019 à 17:10, Segher Boessenkool a écrit :
> Hi Christophe,
>
> On Tue, May 07, 2019 at 01:31:39PM +0000, Christophe Leroy wrote:
>> Cache instructions (dcbz, dcbi, dcbf and dcbst) take two registers
>> that are summed to obtain the target address. Using '%y0' argument
>> gives GCC the opportunity to use both registers instead of only one
>> with the second being forced to 0.
>
> That's not quite right. Sorry if I didn't explain it properly.
>
> "m" allows all memory. But this instruction only allows reg,reg and
> 0,reg addressing. For that you need to use constraint "Z".

But gcc help
(https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html#Machine-Constraints)
says it is better to use 'm':

Z

Memory operand that is an indexed or indirect from a register (it
is usually better to use ‘m’ or ‘es’ in asm statements)

That's the reason why I used 'm', I thought it was equivalent.

Christophe

>
> The output modifier "%y0" just makes [reg] (i.e. simple indirect addressing)
> print as "0,reg" instead of "0(reg)" as it would by default (for just "%0").
>
>
> Segher
>

\
 
 \ /
  Last update: 2019-05-07 18:55    [W:0.116 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site