Clang's inline assembler implementation inists that an explicit
constant is used for "n", whereas "i" allows a variable that ends up
being a constant after optimization, which is what we need here.

ok?


Index: arch/powerpc/include/atomic.h
===================================================================
RCS file: /cvs/src/sys/arch/powerpc/include/atomic.h,v
retrieving revision 1.11
diff -u -p -r1.11 atomic.h
--- arch/powerpc/include/atomic.h       12 May 2017 08:47:48 -0000      1.11
+++ arch/powerpc/include/atomic.h       11 Jul 2019 11:40:48 -0000
@@ -246,7 +246,7 @@ _atomic_addic_int_nv(volatile unsigned i
            "   stwcx.  %0, 0, %2       \n"
            "   bne-    1b              \n"
            : "=&r" (rv), "+m" (*p)
-           : "r" (p), "n" (v)
+           : "r" (p), "i" (v)
            : "cc", "xer");
 
        return (rv);
@@ -265,7 +265,7 @@ _atomic_addic_long_nv(volatile unsigned 
            "   stwcx.  %0, 0, %2       \n"
            "   bne-    1b              \n"
            : "=&r" (rv), "+m" (*p)
-           : "r" (p), "n" (v)
+           : "r" (p), "i" (v)
            : "cc", "xer");
 
        return (rv);

Reply via email to