From 3f9915b32447d4797422c25aa335ae237e82881d Mon Sep 17 00:00:00 2001 From: "Balaji V. Iyer" Date: Wed, 13 Mar 2013 23:37:52 +0000 Subject: Made libcilkrts build for other archs. libcilkrts/ChangeLog.cilkplus +2013-03-13 Balaji V. Iyer + + * runtime/sysdep-unix.c (__cilkrts_stop_workers): Inserted inline + assembly inside a #if which is only invoked when compiled for i386. + Otherwise, output a warning. + * runtime/os-unix.c (__cilkrts_gettick): Replaced #error with #warning. + (__cilkrts_short_pause): Likewise. + (__cilkrts_xchg): Likewise. + ChangeLog.cilkplus +2013-03-13 Balaji V. Iyer + + * configure.ac (enable_libcilkrts): Made libcilkrts unconditional. + * configure (enable_libcilkrts): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/cilkplus@196642 138bc75d-0d04-0410-961f-82ee72b054a4 --- ChangeLog.cilkplus | 4 ++++ configure | 11 ----------- configure.ac | 11 ----------- libcilkrts/ChangeLog.cilkplus | 10 ++++++++++ libcilkrts/runtime/os-unix.c | 7 ++++--- libcilkrts/runtime/sysdep-unix.c | 4 ++++ 6 files changed, 22 insertions(+), 25 deletions(-) create mode 100644 ChangeLog.cilkplus diff --git a/ChangeLog.cilkplus b/ChangeLog.cilkplus new file mode 100644 index 00000000000..6addaeb7855 --- /dev/null +++ b/ChangeLog.cilkplus @@ -0,0 +1,4 @@ +2013-03-13 Balaji V. Iyer + + * configure.ac (enable_libcilkrts): Made libcilkrts unconditional. + * configure (enable_libcilkrts): Likewise. diff --git a/configure b/configure index fdc821f1d38..d683b3cda02 100755 --- a/configure +++ b/configure @@ -3159,17 +3159,6 @@ if test x$enable_libgomp = x ; then esac fi -# Disable libcilkrts on non x86 machines... for now. -if test x$enable_libcilkrts = x ; then - # Enable libcilkrts by default on x86 machines. - case "${target}" in - i[3456789]86-*-* | x86_64-*-*) - ;; - *) - noconfigdirs="$noconfigdirs target-libcilkrts" - esac -fi - # Disable libatomic on unsupported systems. if test -d ${srcdir}/libatomic; then if test x$enable_libatomic = x; then diff --git a/configure.ac b/configure.ac index 74e8b4abb97..1803ed3cedb 100644 --- a/configure.ac +++ b/configure.ac @@ -507,17 +507,6 @@ if test x$enable_libgomp = x ; then esac fi -# Disable libcilkrts on non x86 machines... for now. -if test x$enable_libcilkrts = x ; then - # Enable libcilkrts by default on x86 machines. - case "${target}" in - i[3456789]86-*-* | x86_64-*-*) - ;; - *) - noconfigdirs="$noconfigdirs target-libcilkrts" - esac -fi - # Disable libatomic on unsupported systems. if test -d ${srcdir}/libatomic; then if test x$enable_libatomic = x; then diff --git a/libcilkrts/ChangeLog.cilkplus b/libcilkrts/ChangeLog.cilkplus index c0cdc09eb9a..5b6898f1e81 100644 --- a/libcilkrts/ChangeLog.cilkplus +++ b/libcilkrts/ChangeLog.cilkplus @@ -1,3 +1,13 @@ +2013-03-13 Balaji V. Iyer + + * runtime/sysdep-unix.c (__cilkrts_stop_workers): Inserted inline + assembly inside a #if which is only invoked when compiled for i386. + Otherwise, output a warning. + * runtime/os-unix.c (__cilkrts_gettick): Replaced #error with #warning. + (__cilkrts_short_pause): Likewise. + (__cilkrts_xchg): Likewise. + + 2013-02-05 Balaji V. Iyer * Makefile.in (am_libcilkrts_la_OBJECTS): Removed symbol_test. diff --git a/libcilkrts/runtime/os-unix.c b/libcilkrts/runtime/os-unix.c index 417a4bf56bb..3fa50c88d89 100644 --- a/libcilkrts/runtime/os-unix.c +++ b/libcilkrts/runtime/os-unix.c @@ -344,7 +344,8 @@ COMMON_SYSDEP unsigned long long __cilkrts_getticks(void) __asm__ volatile("rdtsc" : "=a" (a), "=d" (d)); return ((unsigned long long)a) | (((unsigned long long)d) << 32); #else -# error "unimplemented cycle counter" +# warning "unimplemented cycle counter" + return 0; #endif } @@ -359,7 +360,7 @@ COMMON_SYSDEP void __cilkrts_short_pause(void) #elif defined __i386__ || defined __x86_64 __asm__("pause"); #else -# error __cilkrts_short_pause undefined +# warning __cilkrts_short_pause undefined #endif } @@ -369,7 +370,7 @@ COMMON_SYSDEP int __cilkrts_xchg(volatile int *ptr, int x) /* asm statement here works around icc bugs */ __asm__("xchgl %0,%a1" :"=r" (x) : "r" (ptr), "0" (x) :"memory"); #else -# error __cilkrts_xchg undefined + x = __sync_lock_test_and_set(ptr, x); #endif return x; } diff --git a/libcilkrts/runtime/sysdep-unix.c b/libcilkrts/runtime/sysdep-unix.c index cb021e44d5f..9b827502be5 100644 --- a/libcilkrts/runtime/sysdep-unix.c +++ b/libcilkrts/runtime/sysdep-unix.c @@ -309,11 +309,15 @@ void __cilkrts_stop_workers(global_state_t *g) * spawn. This should be called each time a frame is resumed. */ static inline void restore_fp_state (__cilkrts_stack_frame *sf) { +#if defined __i386__ || defined __x86_64 __asm__ ( "ldmxcsr %0\n\t" "fnclex\n\t" "fldcw %1" : : "m" (sf->mxcsr), "m" (sf->fpcsr)); +#else +# warning "unimplemented: code to restore the floating point state" +#endif } /* Resume user code after a spawn or sync, possibly on a different stack. -- cgit v1.2.3