configure.host: Enable interpreter for mips64.
* configure.host: Enable interpreter for mips64. Enable hash synchronization for all mips*-*-linux* targets. * sysdep/mips/locks.h (compare_and_swap, compare_and_swap_release) Use __sync_bool_compare_and_swap instead of in-line asm. (release_set, read_barrier, write_barrier): Use __sync_synchronize instead of in-line asm. From-SVN: r128438
This commit is contained in:
parent
b9baeecdcc
commit
22083efc54
3 changed files with 19 additions and 55 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2007-09-12 David Daney <ddaney@avtrex.com>
|
||||||
|
|
||||||
|
* configure.host: Enable interpreter for mips64. Enable hash
|
||||||
|
synchronization for all mips*-*-linux* targets.
|
||||||
|
* sysdep/mips/locks.h (compare_and_swap, compare_and_swap_release) Use
|
||||||
|
__sync_bool_compare_and_swap instead of in-line asm.
|
||||||
|
(release_set, read_barrier, write_barrier): Use __sync_synchronize
|
||||||
|
instead of in-line asm.
|
||||||
|
|
||||||
2007-09-09 Andreas Tobler <a.tobler@schweiz.org>
|
2007-09-09 Andreas Tobler <a.tobler@schweiz.org>
|
||||||
|
|
||||||
PR libgcj/33326
|
PR libgcj/33326
|
||||||
|
|
|
@ -98,7 +98,7 @@ case "${host}" in
|
||||||
enable_java_net_default=no
|
enable_java_net_default=no
|
||||||
enable_getenv_properties_default=no
|
enable_getenv_properties_default=no
|
||||||
;;
|
;;
|
||||||
mipsel-*|mips-*)
|
mips*-*)
|
||||||
libgcj_interpreter=yes
|
libgcj_interpreter=yes
|
||||||
;;
|
;;
|
||||||
i686-*|i586-*|i486-*|i386-*)
|
i686-*|i586-*|i486-*|i386-*)
|
||||||
|
@ -283,11 +283,7 @@ EOF
|
||||||
sysdeps_dir=mips
|
sysdeps_dir=mips
|
||||||
can_unwind_signal=yes
|
can_unwind_signal=yes
|
||||||
DIVIDESPEC=-fno-use-divide-subroutine
|
DIVIDESPEC=-fno-use-divide-subroutine
|
||||||
case "${host}" in
|
enable_hash_synchronization_default=yes
|
||||||
mipsel*-linux* | mipsisa32el*-linux*)
|
|
||||||
enable_hash_synchronization_default=yes
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
powerpc*-*-darwin*)
|
powerpc*-*-darwin*)
|
||||||
enable_hash_synchronization_default=yes
|
enable_hash_synchronization_default=yes
|
||||||
|
|
|
@ -22,29 +22,9 @@ typedef unsigned obj_addr_t __attribute__((__mode__(__pointer__)));
|
||||||
inline static bool
|
inline static bool
|
||||||
compare_and_swap(volatile obj_addr_t *addr,
|
compare_and_swap(volatile obj_addr_t *addr,
|
||||||
obj_addr_t old,
|
obj_addr_t old,
|
||||||
obj_addr_t new_val)
|
obj_addr_t new_val)
|
||||||
{
|
{
|
||||||
long result;
|
return __sync_bool_compare_and_swap(addr, old, new_val);
|
||||||
__asm__ __volatile__(".set\tpush\n\t"
|
|
||||||
".set\tnoreorder\n\t"
|
|
||||||
".set\tnomacro\n\t"
|
|
||||||
"1:\n\t"
|
|
||||||
#if _MIPS_SIM == _ABIO32
|
|
||||||
".set\tmips2\n\t"
|
|
||||||
#endif
|
|
||||||
"ll\t%[result],0(%[addr])\n\t"
|
|
||||||
"bne\t%[result],%[old],2f\n\t"
|
|
||||||
"move\t%[result],$0\n\t" // delay slot
|
|
||||||
"move\t%[result],%[new_val]\n\t"
|
|
||||||
"sc\t%[result],0(%[addr])\n\t"
|
|
||||||
"beq\t%[result],$0,1b\n\t"
|
|
||||||
"nop\n\t" // delay slot
|
|
||||||
"2:\n\t"
|
|
||||||
".set\tpop"
|
|
||||||
: [result] "=&r" (result)
|
|
||||||
: [addr] "r" (addr), [new_val] "r" (new_val), [old] "r"(old)
|
|
||||||
: "memory");
|
|
||||||
return (bool) result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set *addr to new_val with release semantics, i.e. making sure
|
// Set *addr to new_val with release semantics, i.e. making sure
|
||||||
|
@ -53,12 +33,7 @@ compare_and_swap(volatile obj_addr_t *addr,
|
||||||
inline static void
|
inline static void
|
||||||
release_set(volatile obj_addr_t *addr, obj_addr_t new_val)
|
release_set(volatile obj_addr_t *addr, obj_addr_t new_val)
|
||||||
{
|
{
|
||||||
__asm__ __volatile__(".set\tpush\n\t"
|
__sync_synchronize();
|
||||||
#if _MIPS_SIM == _ABIO32
|
|
||||||
".set\tmips2\n\t"
|
|
||||||
#endif
|
|
||||||
"sync\n\t"
|
|
||||||
".set\tpop" : : : "memory");
|
|
||||||
*(addr) = new_val;
|
*(addr) = new_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,16 +42,10 @@ release_set(volatile obj_addr_t *addr, obj_addr_t new_val)
|
||||||
// implementation can be the same.
|
// implementation can be the same.
|
||||||
inline static bool
|
inline static bool
|
||||||
compare_and_swap_release(volatile obj_addr_t *addr,
|
compare_and_swap_release(volatile obj_addr_t *addr,
|
||||||
obj_addr_t old,
|
obj_addr_t old,
|
||||||
obj_addr_t new_val)
|
obj_addr_t new_val)
|
||||||
{
|
{
|
||||||
__asm__ __volatile__(".set\tpush\n\t"
|
return __sync_bool_compare_and_swap(addr, old, new_val);
|
||||||
#if _MIPS_SIM == _ABIO32
|
|
||||||
".set\tmips2\n\t"
|
|
||||||
#endif
|
|
||||||
"sync\n\t"
|
|
||||||
".set\tpop" : : : "memory");
|
|
||||||
return compare_and_swap(addr, old, new_val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that subsequent instructions do not execute on stale
|
// Ensure that subsequent instructions do not execute on stale
|
||||||
|
@ -85,12 +54,7 @@ compare_and_swap_release(volatile obj_addr_t *addr,
|
||||||
inline static void
|
inline static void
|
||||||
read_barrier()
|
read_barrier()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__(".set\tpush\n\t"
|
__sync_synchronize();
|
||||||
#if _MIPS_SIM == _ABIO32
|
|
||||||
".set\tmips2\n\t"
|
|
||||||
#endif
|
|
||||||
"sync\n\t"
|
|
||||||
".set\tpop" : : : "memory");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that prior stores to memory are completed with respect to other
|
// Ensure that prior stores to memory are completed with respect to other
|
||||||
|
@ -98,12 +62,7 @@ read_barrier()
|
||||||
inline static void
|
inline static void
|
||||||
write_barrier()
|
write_barrier()
|
||||||
{
|
{
|
||||||
__asm__ __volatile__(".set\tpush\n\t"
|
__sync_synchronize();
|
||||||
#if _MIPS_SIM == _ABIO32
|
|
||||||
".set\tmips2\n\t"
|
|
||||||
#endif
|
|
||||||
"sync\n\t"
|
|
||||||
".set\tpop" : : : "memory");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __SYSDEP_LOCKS_H__
|
#endif // __SYSDEP_LOCKS_H__
|
||||||
|
|
Loading…
Add table
Reference in a new issue