atomicity.h (__atomic_add): Remove "static inline" and attribute-unused.
* config/cpu/cris/atomicity.h (__atomic_add): Remove "static inline" and attribute-unused. Qualify parameter __mem with "volatile". (__exchange_and_add): Ditto. Add back memory clobber to asm. From-SVN: r79804
This commit is contained in:
parent
7090f4b3b1
commit
fea41ef911
|
@ -1,3 +1,10 @@
|
||||||
|
2004-03-22 Hans-Peter Nilsson <hp@axis.com>
|
||||||
|
|
||||||
|
* config/cpu/cris/atomicity.h (__atomic_add): Remove "static
|
||||||
|
inline" and attribute-unused. Qualify parameter __mem with
|
||||||
|
"volatile".
|
||||||
|
(__exchange_and_add): Ditto. Add back memory clobber to asm.
|
||||||
|
|
||||||
2004-03-20 Paolo Carlini <pcarlini@suse.de>
|
2004-03-20 Paolo Carlini <pcarlini@suse.de>
|
||||||
|
|
||||||
* testsuite/27_io/basic_istream/extractors_arithmetic/char/2.cc:
|
* testsuite/27_io/basic_istream/extractors_arithmetic/char/2.cc:
|
||||||
|
|
|
@ -31,9 +31,8 @@
|
||||||
|
|
||||||
namespace __gnu_cxx
|
namespace __gnu_cxx
|
||||||
{
|
{
|
||||||
static inline _Atomic_word
|
_Atomic_word
|
||||||
__attribute__ ((__unused__))
|
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
|
||||||
__exchange_and_add(_Atomic_word* __mem, int __val)
|
|
||||||
{
|
{
|
||||||
int __tmp;
|
int __tmp;
|
||||||
_Atomic_word __result;
|
_Atomic_word __result;
|
||||||
|
@ -49,9 +48,12 @@ namespace __gnu_cxx
|
||||||
" bwf 0b \n"
|
" bwf 0b \n"
|
||||||
" clearf \n"
|
" clearf \n"
|
||||||
: "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
|
: "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
|
||||||
: "r" (__mem), "g" (__val), "m" (*__mem));
|
: "r" (__mem), "g" (__val), "m" (*__mem)
|
||||||
|
/* The memory clobber must stay, regardless of
|
||||||
|
current uses of this function. */
|
||||||
|
: "memory");
|
||||||
#else
|
#else
|
||||||
__asm__ __volatile__ (" move $ccr,$r9 \n"
|
__asm__ __volatile__ (" move $ccr,$r9 \n"
|
||||||
" di \n"
|
" di \n"
|
||||||
" move.d %4,%2 \n"
|
" move.d %4,%2 \n"
|
||||||
" move.d [%3],%0 \n"
|
" move.d [%3],%0 \n"
|
||||||
|
@ -60,14 +62,16 @@ namespace __gnu_cxx
|
||||||
" move $r9,$ccr \n"
|
" move $r9,$ccr \n"
|
||||||
: "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
|
: "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
|
||||||
: "r" (__mem), "g" (__val), "m" (*__mem)
|
: "r" (__mem), "g" (__val), "m" (*__mem)
|
||||||
: "r9");
|
: "r9",
|
||||||
|
/* The memory clobber must stay, regardless of
|
||||||
|
current uses of this function. */
|
||||||
|
"memory");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return __result;
|
return __result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
__attribute__ ((__unused__))
|
__atomic_add(volatile _Atomic_word* __mem, int __val)
|
||||||
__atomic_add(_Atomic_word* __mem, int __val)
|
|
||||||
{ __exchange_and_add(__mem, __val); }
|
{ __exchange_and_add(__mem, __val); }
|
||||||
} // namespace __gnu_cxx
|
} // namespace __gnu_cxx
|
||||||
|
|
Loading…
Reference in New Issue