lkml.org 
[lkml]   [2019]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/2] powerpc: cleanup hw_irq.h
From
Date


Le 27/08/2019 à 19:29, Segher Boessenkool a écrit :
> On Tue, Aug 27, 2019 at 10:48:24PM +1000, Nicholas Piggin wrote:
>> Christophe Leroy's on August 27, 2019 6:13 pm:
>>> +#define wrtee(val) asm volatile("wrtee %0" : : "r" (val) : "memory")
>>> +#define wrteei(val) asm volatile("wrteei %0" : : "i" (val) : "memory")
>>
>> Can you implement just one macro that uses __builtin_constant_p to
>> select between the imm and reg versions? I forgot if there's some
>> corner cases that prevent that working with inline asm i constraints.
>
> static inline void wrtee(long val)
> {
> asm volatile("wrtee%I0 %0" : : "n"(val) : "memory");
> }

Great, didn't know that possibility.

Can it be used with any insn, for instance with add/addi ?
Or with mr/li ?

>
> (This output modifier goes back to the dark ages, some 2.4 or something).

Hope Clang support it ...

Christophe

>
>
> Segher
>

\
 
 \ /
  Last update: 2019-08-27 19:37    [W:0.030 / U:0.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site