PERFORCE change 30831 for review
Juli Mallett
jmallett at FreeBSD.org
Thu May 8 21:46:29 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=30831
Change 30831 by jmallett at jmallett_dalek on 2003/05/08 21:46:20
Properly refer to input and output arguments, as to make
these work. This fixes atomic_cmpset_ptr most notably for
witness such that it gets past that point now.
Inspired by Alpha & PowerPC.
Affected files ...
.. //depot/projects/mips/sys/mips/include/atomic.h#14 edit
Differences ...
==== //depot/projects/mips/sys/mips/include/atomic.h#14 (text+ko) ====
@@ -103,12 +103,12 @@
\
__asm __volatile ( \
"1:\n\t" \
- "ll %[temp], (%[p])\n\t" \
+ "ll %[temp], %[p]\n\t" \
asmop "\n\t" \
- "sc %[temp], (%[p])\n\t" \
+ "sc %[temp], %[p]\n\t" \
"beqz %[temp], 1b\n\t" \
- : [val] "=r"(val) \
- : [temp] "r"(temp), [p] "r"(p) \
+ : [val] "=&r"(val), [p] "+m"(*p) \
+ : [temp] "r"(temp) \
: "memory" \
); \
}
@@ -139,15 +139,15 @@
__asm __volatile (
"1:\n\t"
"move %[res], $0\n\t"
- "ll %[temp], (%[p])\n\t"
+ "ll %[temp], %[p]\n\t"
"bne %[temp], %[old], 2f\n\t"
"move %[temp], %[val]\n\t"
"li %[res], 1\n\t"
- "sc %[temp], (%[p])\n\t"
+ "sc %[temp], %[p]\n\t"
"beqz %[temp], 1b\n\t"
"2:\n\t"
- : [old] "=r"(old), [val] "=r"(val)
- : [res] "r"(res), [temp] "r"(temp), [p] "r"(p)
+ : [res] "=&r"(res), [p] "+m"(*p)
+ : [old] "r"(old), [val] "r"(val), [temp] "r"(temp)
: "memory"
);
@@ -164,13 +164,13 @@
__asm __volatile (
"1:\n\t"
- "ll %[temp], (%[p])\n\t"
+ "ll %[temp], %[p]\n\t"
"move %[res], %[temp]\n\t"
"move %[temp], $0\n\t"
- "sc %[temp], (%[p])\n\t"
+ "sc %[temp], %[p]\n\t"
"beqz %[temp], 1b\n\t"
- :
- : [temp] "r"(temp), [p] "r"(p), [res] "r"(res)
+ : [res] "=&r"(res), [p] "+m"(*p)
+ : [temp] "r"(temp)
: "memory"
);
@@ -191,12 +191,12 @@
\
__asm __volatile ( \
"1:\n\t" \
- "lld %[temp], (%[p])\n\t" \
+ "lld %[temp], %[p]\n\t" \
asmop "\n\t" \
- "scd %[temp], (%[p])\n\t" \
+ "scd %[temp], %[p]\n\t" \
"beqz %[temp], 1b\n\t" \
- : [val] "=r"(val) \
- : [temp] "r"(temp), [p] "r"(p) \
+ : [val] "=&r"(val), [p] "+m"(*p) \
+ : [temp] "r"(temp) \
: "memory" \
); \
}
@@ -227,15 +227,15 @@
__asm __volatile (
"1:\n\t"
"move %[res], $0\n\t"
- "lld %[temp], (%[p])\n\t"
+ "lld %[temp], %[p]\n\t"
"bne %[temp], %[old], 2f\n\t"
"move %[temp], %[val]\n\t"
"li %[res], 1\n\t"
- "scd %[temp], (%[p])\n\t"
+ "scd %[temp], %[p]\n\t"
"beqz %[temp], 1b\n\t"
"2:\n\t"
- : [old] "=r"(old), [val] "=r"(val)
- : [res] "r"(res), [temp] "r"(temp), [p] "r"(p)
+ : [res] "=&r"(res), [p] "+m"(*p)
+ : [old] "r"(old), [val] "r"(val), [temp] "r"(temp)
: "memory"
);
@@ -252,13 +252,13 @@
__asm __volatile (
"1:\n\t"
- "lld %[temp], (%[p])\n\t"
+ "lld %[temp], %[p]\n\t"
"move %[res], %[temp]\n\t"
"move %[temp], $0\n\t"
- "scd %[temp], (%[p])\n\t"
+ "scd %[temp], %[p]\n\t"
"beqz %[temp], 1b\n\t"
- :
- : [temp] "r"(temp), [p] "r"(p), [res] "r"(res)
+ : [res] "=&r"(res), [p] "+m"(*p)
+ : [temp] "r"(temp)
: "memory"
);
More information about the p4-projects
mailing list