aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBalaji V. Iyer <balaji.v.iyer@intel.com>2013-03-13 23:37:52 +0000
committerBalaji V. Iyer <balaji.v.iyer@intel.com>2013-03-13 23:37:52 +0000
commit3f9915b32447d4797422c25aa335ae237e82881d (patch)
tree26d9543fa8009533244919468ca405ce140214b7
parent8addbff280172ea549e85304c861e928e73af5fa (diff)
Made libcilkrts build for other archs.
libcilkrts/ChangeLog.cilkplus +2013-03-13 Balaji V. Iyer <balaji.v.iyer@intel.com> + + * 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 <balaji.v.iyer@intel.com> + + * 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
-rw-r--r--ChangeLog.cilkplus4
-rwxr-xr-xconfigure11
-rw-r--r--configure.ac11
-rw-r--r--libcilkrts/ChangeLog.cilkplus10
-rw-r--r--libcilkrts/runtime/os-unix.c7
-rw-r--r--libcilkrts/runtime/sysdep-unix.c4
6 files changed, 22 insertions, 25 deletions
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 <balaji.v.iyer@intel.com>
+
+ * 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 <balaji.v.iyer@intel.com>
+
+ * 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 <balaji.v.iyer@intel.com>
* 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.