<html><body>
<p><font size="2" face="sans-serif">Hi all,</font><br>
<br>
<font size="2" face="sans-serif">Attached a patch for PPC64 support. Please let me know about any comments.</font><br>
<br>
<font size="2" face="sans-serif">Thanks</font><br>
<br>
<font size="2" face="sans-serif">-- Carlo</font><br>
<br>
<br>
<br>
<tt><font size="2">diff --git a/runtime/Makefile.bgq b/runtime/Makefile.bgq</font></tt><br>
<tt><font size="2">new file mode 100644</font></tt><br>
<tt><font size="2">index 0000000..d9aa914</font></tt><br>
<tt><font size="2">--- /dev/null</font></tt><br>
<tt><font size="2">+++ b/runtime/Makefile.bgq</font></tt><br>
<tt><font size="2">@@ -0,0 +1,76 @@</font></tt><br>
<tt><font size="2">+date := $(shell date '+%Y%m%d')</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+FEATURE_FLAGS = -DOMP_40_ENABLED=1 -DOMP_30_ENABLED=1 -DOMP_VERSION=201107 -DKMP_VERSION_MAJOR=5 \</font></tt><br>
<tt><font size="2">+ -DCACHE_LINE=64 -DKMP_ADJUST_BLOCKTIME=1 -DBUILD_I8 -DKMP_USE_ADAPTIVE_LOCKS=0 \</font></tt><br>
<tt><font size="2">+ -DKMP_DEBUG_ADAPTIVE_LOCKS=0 -DINTEL_NO_ITTNOTIFY_API -DKMP_VERSION_MINOR=0 -DKMP_VERSION_BUILD=0 \</font></tt><br>
<tt><font size="2">+ -DKMP_LIBRARY_FILE=\"libiomp5.so\" -D_KMP_BUILD_TIME="\"$(date)\"" -DKMP_GOMP_COMPAT</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+CPPFLAGS = ${FEATURE_FLAGS} -D__float128='long double'</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+CC = powerpc64-bgq-linux-gcc</font></tt><br>
<tt><font size="2">+CXX = powerpc64-bgq-linux-g++</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+all: build/libiomp5.a build/libiomp5.so</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+build/.dir:</font></tt><br>
<tt><font size="2">+ mkdir -p build</font></tt><br>
<tt><font size="2">+ touch build/.dir</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+build/omp.h:</font></tt><br>
<tt><font size="2">+ perl tools/expand-vars.pl --strict $$(echo $(FEATURE_FLAGS) | sed 's/-D/-D /g') \</font></tt><br>
<tt><font size="2">+ -D KMP_BUILD_DATE=$(date) -D Revision=Revision -D Date=Date \</font></tt><br>
<tt><font size="2">+ src/include/40/omp.h.var build/omp.h</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+build/%.o: src/%.cpp build/kmp_i18n_id.inc build/kmp_i18n_default.inc build/omp.h</font></tt><br>
<tt><font size="2">+ ${CXX} -c ${CPPFLAGS} -g -O3 -Isrc -Ibuild -o $@ $<</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+build/%.o: src/%.c build/kmp_i18n_id.inc build/kmp_i18n_default.inc build/omp.h</font></tt><br>
<tt><font size="2">+ ${CC} -x c++ -c ${CPPFLAGS} -g -O3 -Isrc -Ibuild -o $@ $<</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+OBJS = build/kmp_alloc.o \</font></tt><br>
<tt><font size="2">+ build/kmp_atomic.o \</font></tt><br>
<tt><font size="2">+ build/kmp_cancel.o \</font></tt><br>
<tt><font size="2">+ build/kmp_csupport.o \</font></tt><br>
<tt><font size="2">+ build/kmp_dispatch.o \</font></tt><br>
<tt><font size="2">+ build/kmp_debug.o \</font></tt><br>
<tt><font size="2">+ build/kmp_environment.o \</font></tt><br>
<tt><font size="2">+ build/kmp_error.o \</font></tt><br>
<tt><font size="2">+ build/kmp_ftn_cdecl.o \</font></tt><br>
<tt><font size="2">+ build/kmp_ftn_extra.o \</font></tt><br>
<tt><font size="2">+ build/kmp_ftn_stdcall.o \</font></tt><br>
<tt><font size="2">+ build/kmp_global.o \</font></tt><br>
<tt><font size="2">+ build/kmp_i18n.o \</font></tt><br>
<tt><font size="2">+ build/kmp_io.o \</font></tt><br>
<tt><font size="2">+ build/kmp_itt.o \</font></tt><br>
<tt><font size="2">+ build/kmp_runtime.o \</font></tt><br>
<tt><font size="2">+ build/kmp_settings.o \</font></tt><br>
<tt><font size="2">+ build/kmp_sched.o \</font></tt><br>
<tt><font size="2">+ build/kmp_str.o \</font></tt><br>
<tt><font size="2">+ build/kmp_tasking.o \</font></tt><br>
<tt><font size="2">+ build/kmp_taskq.o \</font></tt><br>
<tt><font size="2">+ build/kmp_taskdeps.o \</font></tt><br>
<tt><font size="2">+ build/kmp_threadprivate.o \</font></tt><br>
<tt><font size="2">+ build/kmp_utility.o \</font></tt><br>
<tt><font size="2">+ build/kmp_version.o \</font></tt><br>
<tt><font size="2">+ build/kmp_lock.o \</font></tt><br>
<tt><font size="2">+ build/z_Linux_util.o</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+BGSYS_FLOOR=$(shell readlink /bgsys/drivers/ppcfloor)</font></tt><br>
<tt><font size="2">+build/libiomp5.so: $(OBJS)</font></tt><br>
<tt><font size="2">+ ${CXX} -Wl,--build-id -Wl,-rpath -Wl,${BGSYS_FLOOR}/gnu-linux/powerpc64-bgq-linux/lib -shared -o $@.1.0 $^ -Wl,-soname,$(shell basename $@.1) -lpthread</font></tt><br>
<tt><font size="2">+ (cd $(shell dirname $@) && ln -sf $(shell basename $@.1.0) $(shell basename $@.1))</font></tt><br>
<tt><font size="2">+ (cd $(shell dirname $@) && ln -sf $(shell basename $@.1) $(shell basename $@))</font></tt><br>
<tt><font size="2">+# Note: We should not need the --build-id when we switch to clang (it should add it for us).</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+build/libiomp5.a: $(OBJS)</font></tt><br>
<tt><font size="2">+ ar cr $@ $^</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+build/kmp_i18n_id.inc: src/i18n/en_US.txt tools/message-converter.pl build/.dir</font></tt><br>
<tt><font size="2">+ perl tools/message-converter.pl --prefix=kmp_i18n --enum=$@ $<</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+build/kmp_i18n_default.inc: src/i18n/en_US.txt tools/message-converter.pl build/.dir</font></tt><br>
<tt><font size="2">+ perl tools/message-converter.pl --prefix=kmp_i18n --default=$@ $<</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+clean:</font></tt><br>
<tt><font size="2">+ rm -rf build</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">diff --git a/runtime/src/CMakeLists.txt b/runtime/src/CMakeLists.txt</font></tt><br>
<tt><font size="2">index dd29966..4814cb4 100644</font></tt><br>
<tt><font size="2">--- a/runtime/src/CMakeLists.txt</font></tt><br>
<tt><font size="2">+++ b/runtime/src/CMakeLists.txt</font></tt><br>
<tt><font size="2">@@ -12,6 +12,9 @@ include_directories(</font></tt><br>
<tt><font size="2"> ${CMAKE_CURRENT_BINARY_DIR}</font></tt><br>
<tt><font size="2"> )</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">+# detect architecture</font></tt><br>
<tt><font size="2">+EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCH )</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2"> if(WIN32)</font></tt><br>
<tt><font size="2"> set(OS_GEN "win")</font></tt><br>
<tt><font size="2"> elseif(APPLE)</font></tt><br>
<tt><font size="2">@@ -22,12 +25,14 @@ else()</font></tt><br>
<tt><font size="2"> message(FATAL_ERROR "Unsupported OS")</font></tt><br>
<tt><font size="2"> endif()</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">-if("${ARCH}" STREQUAL "")</font></tt><br>
<tt><font size="2">+if(NOT "${ARCH}" STREQUAL "ppc64")</font></tt><br>
<tt><font size="2"> set(ARCH "32e")</font></tt><br>
<tt><font size="2">+ set(ARCH_STR "Intel(R) 64")</font></tt><br>
<tt><font size="2">+else()</font></tt><br>
<tt><font size="2">+# arch already set above</font></tt><br>
<tt><font size="2">+ set(ARCH_STR "PPC64")</font></tt><br>
<tt><font size="2"> endif()</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">-set(ARCH_STR "Intel(R) 64")</font></tt><br>
<tt><font size="2">-</font></tt><br>
<tt><font size="2"> set(FEATURE_FLAGS "-D USE_ITT_BUILD")</font></tt><br>
<tt><font size="2"> set(FEATURE_FLAGS "${FEATURE_FLAGS} -D NDEBUG")</font></tt><br>
<tt><font size="2"> set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_ARCH_STR=\"\\\"${ARCH_STR}\\\"\"")</font></tt><br>
<tt><font size="2">@@ -50,8 +55,13 @@ set(FEATURE_FLAGS "${FEATURE_FLAGS} -D USE_LOAD_BALANCE")</font></tt><br>
<tt><font size="2"> set(FEATURE_FLAGS "${FEATURE_FLAGS} -D USE_CBLKDATA")</font></tt><br>
<tt><font size="2"> set(FEATURE_FLAGS "${FEATURE_FLAGS} -D GUIDEDLL_EXPORTS")</font></tt><br>
<tt><font size="2"> set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_GOMP_COMPAT")</font></tt><br>
<tt><font size="2">-set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_USE_ADAPTIVE_LOCKS=1")</font></tt><br>
<tt><font size="2">-set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_DEBUG_ADAPTIVE_LOCKS=0")</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+#adaptive locks use x86 assembly - disable for ppc64</font></tt><br>
<tt><font size="2">+if(NOT "${ARCH}" STREQUAL "ppc64")</font></tt><br>
<tt><font size="2">+ set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_USE_ADAPTIVE_LOCKS=1")</font></tt><br>
<tt><font size="2">+ set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_DEBUG_ADAPTIVE_LOCKS=0")</font></tt><br>
<tt><font size="2">+endif()</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2"> set(FEATURE_FLAGS "${FEATURE_FLAGS} -D OMP_50_ENABLED=0")</font></tt><br>
<tt><font size="2"> set(FEATURE_FLAGS "${FEATURE_FLAGS} -D OMP_41_ENABLED=0")</font></tt><br>
<tt><font size="2"> set(FEATURE_FLAGS "${FEATURE_FLAGS} -D OMP_40_ENABLED=1")</font></tt><br>
<tt><font size="2">@@ -122,16 +132,35 @@ add_custom_command(</font></tt><br>
<tt><font size="2"> OUTPUT omp.h</font></tt><br>
<tt><font size="2"> COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/../tools/expand-vars.pl --strict -D Revision=\"\\$$Revision\" -D Date=\"\\$$Date\" -D KMP_TYPE=\"Performance\" -D KMP_ARCH=\"\\\"${ARCH_STR}\\\"\" -D KMP_VERSION_MAJOR=${VERSION} -D KMP_VERSION_MINOR=0 -D KMP_VERSION_BUILD=00000000 -D KMP_BUILD_DATE=\"${BUILD_TIME} UTC\" -D KMP_TARGET_COMPILER=12 -D KMP_DIAG=0 -D KMP_DEBUG_INFO=0 -D OMP_VERSION=${OMP_VERSION} ${CMAKE_CURRENT_SOURCE_DIR}/include/${OMP_VERSION_NUM}/omp.h.var omp.h</font></tt><br>
<tt><font size="2"> )</font></tt><br>
<tt><font size="2">-add_custom_command(</font></tt><br>
<tt><font size="2">- OUTPUT z_Linux_asm.o</font></tt><br>
<tt><font size="2">- COMMAND ${CMAKE_CXX_COMPILER} -c -o z_Linux_asm.o -D KMP_ASM_INTRINS -D KMP_GOMP_COMPAT -D KMP_ARCH_X86_64 -x assembler-with-cpp ${CMAKE_CURRENT_SOURCE_DIR}/${ASM_SOURCES}</font></tt><br>
<tt><font size="2">-)</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+if(NOT "${ARCH}" STREQUAL "ppc64")</font></tt><br>
<tt><font size="2">+ add_custom_command(</font></tt><br>
<tt><font size="2">+ OUTPUT z_Linux_asm.o</font></tt><br>
<tt><font size="2">+ COMMAND ${CMAKE_CXX_COMPILER} -c -o z_Linux_asm.o -D KMP_ASM_INTRINS -D KMP_GOMP_COMPAT -D KMP_ARCH_X86_64 -x assembler-with-cpp ${CMAKE_CURRENT_SOURCE_DIR}/${ASM_SOURCES}</font></tt><br>
<tt><font size="2">+ )</font></tt><br>
<tt><font size="2">+else()</font></tt><br>
<tt><font size="2">+ add_custom_command(</font></tt><br>
<tt><font size="2">+ OUTPUT z_Linux_asm.o</font></tt><br>
<tt><font size="2">+ COMMAND ${CMAKE_CXX_COMPILER} -c -o z_Linux_asm.o -D KMP_ASM_INTRINS -D KMP_GOMP_COMPAT -D KMP_ARCH_PPC64 -x assembler-with-cpp ${CMAKE_CURRENT_SOURCE_DIR}/${ASM_SOURCES}</font></tt><br>
<tt><font size="2">+ )</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+endif()</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> add_custom_target(gen_kmp_i18n DEPENDS kmp_i18n_id.inc kmp_i18n_default.inc omp.h z_Linux_asm.o)</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> if(NOT APPLE)</font></tt><br>
<tt><font size="2">- set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports_so.txt")</font></tt><br>
<tt><font size="2">+ set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports_so.txt -ldl")</font></tt><br>
<tt><font size="2"> endif()</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> add_library(iomp5 SHARED ${SOURCES} z_Linux_asm.o)</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+# This is a workaround to a known ppc64 issue about libpthread. For more</font></tt><br>
<tt><font size="2">+# information see</font></tt><br>
<tt><font size="2">+# </font></tt><tt><font size="2"><a href="http://ryanarn.blogspot.com/2011/07/curious-case-of-pthreadatfork-on.html">http://ryanarn.blogspot.com/2011/07/curious-case-of-pthreadatfork-on.html</a></font></tt><br>
<tt><font size="2">+if("${ARCH}" STREQUAL "ppc64")</font></tt><br>
<tt><font size="2">+ find_library(PTHREAD NAMES pthread)</font></tt><br>
<tt><font size="2">+ target_link_libraries(iomp5 ${PTHREAD})</font></tt><br>
<tt><font size="2">+endif()</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2"> add_dependencies(iomp5 gen_kmp_i18n)</font></tt><br>
<tt><font size="2">diff --git a/runtime/src/kmp.h b/runtime/src/kmp.h</font></tt><br>
<tt><font size="2">index a8c600b..f5dd10f 100644</font></tt><br>
<tt><font size="2">--- a/runtime/src/kmp.h</font></tt><br>
<tt><font size="2">+++ b/runtime/src/kmp.h</font></tt><br>
<tt><font size="2">@@ -459,9 +459,9 @@ typedef int PACKED_REDUCTION_METHOD_T;</font></tt><br>
<tt><font size="2"> /*</font></tt><br>
<tt><font size="2"> * Only Linux* OS and Windows* OS support thread affinity.</font></tt><br>
<tt><font size="2"> */</font></tt><br>
<tt><font size="2">-#if KMP_OS_LINUX || KMP_OS_WINDOWS</font></tt><br>
<tt><font size="2">+#if (KMP_OS_LINUX || KMP_OS_WINDOWS) && !KMP_OS_CNK && !KMP_ARCH_PPC64</font></tt><br>
<tt><font size="2"> # define KMP_AFFINITY_SUPPORTED 1</font></tt><br>
<tt><font size="2">-#elif KMP_OS_DARWIN || KMP_OS_FREEBSD</font></tt><br>
<tt><font size="2">+#elif KMP_OS_DARWIN || KMP_OS_FREEBSD || KMP_OS_CNK || KMP_ARCH_PPC64</font></tt><br>
<tt><font size="2"> // affinity not supported</font></tt><br>
<tt><font size="2"> # define KMP_AFFINITY_SUPPORTED 0</font></tt><br>
<tt><font size="2"> #else</font></tt><br>
<tt><font size="2">@@ -476,7 +476,7 @@ extern size_t __kmp_affin_mask_size;</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> # if KMP_OS_LINUX</font></tt><br>
<tt><font size="2"> //</font></tt><br>
<tt><font size="2">-// On Linux* OS, the mask isactually a vector of length __kmp_affin_mask_size</font></tt><br>
<tt><font size="2">+// On Linux* OS, the mask is actually a vector of length __kmp_affin_mask_size</font></tt><br>
<tt><font size="2"> // (in bytes). It should be allocated on a word boundary.</font></tt><br>
<tt><font size="2"> //</font></tt><br>
<tt><font size="2"> // WARNING!!! We have made the base type of the affinity mask unsigned char,</font></tt><br>
<tt><font size="2">@@ -946,6 +946,9 @@ extern unsigned int __kmp_place_core_offset;</font></tt><br>
<tt><font size="2"> #if KMP_OS_WINDOWS</font></tt><br>
<tt><font size="2"> # define KMP_INIT_WAIT 64U /* initial number of spin-tests */</font></tt><br>
<tt><font size="2"> # define KMP_NEXT_WAIT 32U /* susequent number of spin-tests */</font></tt><br>
<tt><font size="2">+#elif KMP_OS_CNK</font></tt><br>
<tt><font size="2">+# define KMP_INIT_WAIT 16U /* initial number of spin-tests */</font></tt><br>
<tt><font size="2">+# define KMP_NEXT_WAIT 8U /* susequent number of spin-tests */</font></tt><br>
<tt><font size="2"> #elif KMP_OS_LINUX</font></tt><br>
<tt><font size="2"> # define KMP_INIT_WAIT 1024U /* initial number of spin-tests */</font></tt><br>
<tt><font size="2"> # define KMP_NEXT_WAIT 512U /* susequent number of spin-tests */</font></tt><br>
<tt><font size="2">@@ -971,6 +974,11 @@ extern void __kmp_x86_cpuid( int mode, int mode2, struct kmp_cpuid *p );</font></tt><br>
<tt><font size="2"> extern void __kmp_x86_pause( void );</font></tt><br>
<tt><font size="2"> # endif</font></tt><br>
<tt><font size="2"> # define KMP_CPU_PAUSE() __kmp_x86_pause()</font></tt><br>
<tt><font size="2">+#elif KMP_ARCH_PPC64</font></tt><br>
<tt><font size="2">+# define KMP_PPC64_PRI_LOW() __asm__ volatile ("or 1, 1, 1")</font></tt><br>
<tt><font size="2">+# define KMP_PPC64_PRI_MED() __asm__ volatile ("or 2, 2, 2")</font></tt><br>
<tt><font size="2">+# define KMP_PPC64_PRI_LOC_MB() __asm__ volatile ("" : : : "memory")</font></tt><br>
<tt><font size="2">+# define KMP_CPU_PAUSE() do { KMP_PPC64_PRI_LOW(); KMP_PPC64_PRI_MED(); KMP_PPC64_PRI_LOC_MB(); } while (0)</font></tt><br>
<tt><font size="2"> #else</font></tt><br>
<tt><font size="2"> # define KMP_CPU_PAUSE() /* nothing to do */</font></tt><br>
<tt><font size="2"> #endif</font></tt><br>
<tt><font size="2">diff --git a/runtime/src/kmp_csupport.c b/runtime/src/kmp_csupport.c</font></tt><br>
<tt><font size="2">index 18b6c35..0b7d3ed 100644</font></tt><br>
<tt><font size="2">--- a/runtime/src/kmp_csupport.c</font></tt><br>
<tt><font size="2">+++ b/runtime/src/kmp_csupport.c</font></tt><br>
<tt><font size="2">@@ -837,6 +837,19 @@ __kmpc_flush(ident_t *loc, ...)</font></tt><br>
<tt><font size="2"> #endif // KMP_MIC</font></tt><br>
<tt><font size="2"> #elif KMP_ARCH_ARM</font></tt><br>
<tt><font size="2"> // Nothing yet</font></tt><br>
<tt><font size="2">+ #elif KMP_ARCH_PPC64</font></tt><br>
<tt><font size="2">+ // Nothing needed here (we have a real MB above).</font></tt><br>
<tt><font size="2">+ #if KMP_OS_CNK</font></tt><br>
<tt><font size="2">+ // The flushing thread needs to yield here; this prevents a</font></tt><br>
<tt><font size="2">+ // busy-waiting thread from saturating the pipeline. flush is</font></tt><br>
<tt><font size="2">+ // often used in loops like this:</font></tt><br>
<tt><font size="2">+ // while (!flag) {</font></tt><br>
<tt><font size="2">+ // #pragma omp flush(flag)</font></tt><br>
<tt><font size="2">+ // }</font></tt><br>
<tt><font size="2">+ // and adding the yield here is good for at least a 10x speedup</font></tt><br>
<tt><font size="2">+ // when running >2 threads per core (on the NAS LU benchmark).</font></tt><br>
<tt><font size="2">+ __kmp_yield(TRUE);</font></tt><br>
<tt><font size="2">+ #endif</font></tt><br>
<tt><font size="2"> #else</font></tt><br>
<tt><font size="2"> #error Unknown or unsupported architecture</font></tt><br>
<tt><font size="2"> #endif</font></tt><br>
<tt><font size="2">diff --git a/runtime/src/kmp_ftn_os.h b/runtime/src/kmp_ftn_os.h</font></tt><br>
<tt><font size="2">index f241751..d78d846 100644</font></tt><br>
<tt><font size="2">--- a/runtime/src/kmp_ftn_os.h</font></tt><br>
<tt><font size="2">+++ b/runtime/src/kmp_ftn_os.h</font></tt><br>
<tt><font size="2">@@ -478,7 +478,7 @@</font></tt><br>
<tt><font size="2"> //#define KMP_API_NAME_GOMP_TARGET_UPDATE GOMP_target_update</font></tt><br>
<tt><font size="2"> #define KMP_API_NAME_GOMP_TEAMS GOMP_teams</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">-#if KMP_OS_LINUX</font></tt><br>
<tt><font size="2">+#if KMP_OS_LINUX && !KMP_OS_CNK && !KMP_ARCH_PPC64</font></tt><br>
<tt><font size="2"> #define xstr(x) str(x) </font></tt><br>
<tt><font size="2"> #define str(x) #x</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">diff --git a/runtime/src/kmp_global.c b/runtime/src/kmp_global.c</font></tt><br>
<tt><font size="2">index aa1f8e3..d3c3195 100644</font></tt><br>
<tt><font size="2">--- a/runtime/src/kmp_global.c</font></tt><br>
<tt><font size="2">+++ b/runtime/src/kmp_global.c</font></tt><br>
<tt><font size="2">@@ -321,7 +321,11 @@ int __kmp_env_consistency_check = FALSE; /* KMP_CONSISTENCY_CHECK speci</font></tt><br>
<tt><font size="2"> kmp_uint32 __kmp_yield_init = KMP_INIT_WAIT;</font></tt><br>
<tt><font size="2"> kmp_uint32 __kmp_yield_next = KMP_NEXT_WAIT;</font></tt><br>
<tt><font size="2"> kmp_uint32 __kmp_yielding_on = 1;</font></tt><br>
<tt><font size="2">+#if KMP_OS_CNK</font></tt><br>
<tt><font size="2">+kmp_uint32 __kmp_yield_cycle = 0;</font></tt><br>
<tt><font size="2">+#else</font></tt><br>
<tt><font size="2"> kmp_uint32 __kmp_yield_cycle = 1; /* Yield-cycle is on by default */</font></tt><br>
<tt><font size="2">+#endif</font></tt><br>
<tt><font size="2"> kmp_int32 __kmp_yield_on_count = 10; /* By default, yielding is on for 10 monitor periods. */</font></tt><br>
<tt><font size="2"> kmp_int32 __kmp_yield_off_count = 1; /* By default, yielding is off for 1 monitor periods. */</font></tt><br>
<tt><font size="2"> /* ----------------------------------------------------- */</font></tt><br>
<tt><font size="2">diff --git a/runtime/src/kmp_gsupport.c b/runtime/src/kmp_gsupport.c</font></tt><br>
<tt><font size="2">index 9d8e553..aa52024 100644</font></tt><br>
<tt><font size="2">--- a/runtime/src/kmp_gsupport.c</font></tt><br>
<tt><font size="2">+++ b/runtime/src/kmp_gsupport.c</font></tt><br>
<tt><font size="2">@@ -15,7 +15,7 @@</font></tt><br>
<tt><font size="2"> //===----------------------------------------------------------------------===//</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">-#if defined(__x86_64)</font></tt><br>
<tt><font size="2">+#if defined(__x86_64) || defined (__powerpc64__)</font></tt><br>
<tt><font size="2"> # define KMP_I8</font></tt><br>
<tt><font size="2"> #endif</font></tt><br>
<tt><font size="2"> #include "kmp.h"</font></tt><br>
<tt><font size="2">diff --git a/runtime/src/kmp_lock.h b/runtime/src/kmp_lock.h</font></tt><br>
<tt><font size="2">index 8009d18..c5ce838 100644</font></tt><br>
<tt><font size="2">--- a/runtime/src/kmp_lock.h</font></tt><br>
<tt><font size="2">+++ b/runtime/src/kmp_lock.h</font></tt><br>
<tt><font size="2">@@ -518,7 +518,7 @@ __kmp_destroy_bootstrap_lock( kmp_bootstrap_lock_t *lck )</font></tt><br>
<tt><font size="2"> // Internal RTL locks are also implemented as ticket locks, for now.</font></tt><br>
<tt><font size="2"> //</font></tt><br>
<tt><font size="2"> // FIXME - We should go through and figure out which lock kind works best for</font></tt><br>
<tt><font size="2">-// each internal lock, and use the type deeclaration and function calls for</font></tt><br>
<tt><font size="2">+// each internal lock, and use the type declaration and function calls for</font></tt><br>
<tt><font size="2"> // that explicit lock kind (and get rid of this section).</font></tt><br>
<tt><font size="2"> //</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">diff --git a/runtime/src/kmp_os.h b/runtime/src/kmp_os.h</font></tt><br>
<tt><font size="2">index bb5e72f..db1981e 100644</font></tt><br>
<tt><font size="2">--- a/runtime/src/kmp_os.h</font></tt><br>
<tt><font size="2">+++ b/runtime/src/kmp_os.h</font></tt><br>
<tt><font size="2">@@ -66,10 +66,12 @@</font></tt><br>
<tt><font size="2"> #define KMP_OS_FREEBSD 0</font></tt><br>
<tt><font size="2"> #define KMP_OS_DARWIN 0</font></tt><br>
<tt><font size="2"> #define KMP_OS_WINDOWS 0</font></tt><br>
<tt><font size="2">+#define KMP_OS_CNK 0</font></tt><br>
<tt><font size="2"> #define KMP_OS_UNIX 0 /* disjunction of KMP_OS_LINUX, KMP_OS_DARWIN etc. */</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> #define KMP_ARCH_X86 0</font></tt><br>
<tt><font size="2"> #define KMP_ARCH_X86_64 0</font></tt><br>
<tt><font size="2">+#define KMP_ARCH_PPC64 0</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> #ifdef _WIN32</font></tt><br>
<tt><font size="2"> # undef KMP_OS_WINDOWS</font></tt><br>
<tt><font size="2">@@ -91,6 +93,11 @@</font></tt><br>
<tt><font size="2"> # define KMP_OS_FREEBSD 1</font></tt><br>
<tt><font size="2"> #endif</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">+#if ( defined __bgq__ )</font></tt><br>
<tt><font size="2">+# undef KMP_OS_CNK</font></tt><br>
<tt><font size="2">+# define KMP_OS_CNK 1</font></tt><br>
<tt><font size="2">+#endif</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2"> #if (1 != KMP_OS_LINUX + KMP_OS_FREEBSD + KMP_OS_DARWIN + KMP_OS_WINDOWS)</font></tt><br>
<tt><font size="2"> # error Unknown OS</font></tt><br>
<tt><font size="2"> #endif</font></tt><br>
<tt><font size="2">@@ -117,6 +124,9 @@</font></tt><br>
<tt><font size="2"> # elif defined __i386</font></tt><br>
<tt><font size="2"> # undef KMP_ARCH_X86</font></tt><br>
<tt><font size="2"> # define KMP_ARCH_X86 1</font></tt><br>
<tt><font size="2">+# elif defined __powerpc64__</font></tt><br>
<tt><font size="2">+# undef KMP_ARCH_PPC64</font></tt><br>
<tt><font size="2">+# define KMP_ARCH_PPC64 1</font></tt><br>
<tt><font size="2"> # endif</font></tt><br>
<tt><font size="2"> #endif</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">@@ -156,7 +166,7 @@</font></tt><br>
<tt><font size="2"> # define KMP_ARCH_ARM 1</font></tt><br>
<tt><font size="2"> #endif</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">-#if (1 != KMP_ARCH_X86 + KMP_ARCH_X86_64 + KMP_ARCH_ARM)</font></tt><br>
<tt><font size="2">+#if (1 != KMP_ARCH_X86 + KMP_ARCH_X86_64 + KMP_ARCH_ARM + KMP_ARCH_PPC64)</font></tt><br>
<tt><font size="2"> # error Unknown or unsupported architecture</font></tt><br>
<tt><font size="2"> #endif</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">@@ -232,7 +242,7 @@</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> #if KMP_ARCH_X86 || KMP_ARCH_ARM</font></tt><br>
<tt><font size="2"> # define KMP_SIZE_T_SPEC KMP_UINT32_SPEC</font></tt><br>
<tt><font size="2">-#elif KMP_ARCH_X86_64</font></tt><br>
<tt><font size="2">+#elif KMP_ARCH_X86_64 || KMP_ARCH_PPC64</font></tt><br>
<tt><font size="2"> # define KMP_SIZE_T_SPEC KMP_UINT64_SPEC</font></tt><br>
<tt><font size="2"> #else</font></tt><br>
<tt><font size="2"> # error "Can't determine size_t printf format specifier."</font></tt><br>
<tt><font size="2">@@ -657,6 +667,10 @@ extern kmp_real64 __kmp_test_then_add_real64 ( volatile kmp_real64 *p, kmp_real6</font></tt><br>
<tt><font size="2"> # endif</font></tt><br>
<tt><font size="2"> #endif /* KMP_OS_WINDOWS */</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">+#if KMP_ARCH_PPC64</font></tt><br>
<tt><font size="2">+# define KMP_MB() __sync_synchronize()</font></tt><br>
<tt><font size="2">+#endif</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2"> #ifndef KMP_MB</font></tt><br>
<tt><font size="2"> # define KMP_MB() /* nothing to do */</font></tt><br>
<tt><font size="2"> #endif</font></tt><br>
<tt><font size="2">@@ -763,7 +777,7 @@ typedef void (*microtask_t)( int *gtid, int *npr, ... );</font></tt><br>
<tt><font size="2"> #endif /* KMP_I8 */</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> /* Workaround for Intel(R) 64 code gen bug when taking address of static array (Intel(R) 64 Tracker #138) */</font></tt><br>
<tt><font size="2">-#if KMP_ARCH_X86_64 && KMP_OS_LINUX</font></tt><br>
<tt><font size="2">+#if (KMP_ARCH_X86_64 || KMP_ARCH_PPC64) && KMP_OS_LINUX</font></tt><br>
<tt><font size="2"> # define STATIC_EFI2_WORKAROUND</font></tt><br>
<tt><font size="2"> #else</font></tt><br>
<tt><font size="2"> # define STATIC_EFI2_WORKAROUND static</font></tt><br>
<tt><font size="2">diff --git a/runtime/src/kmp_runtime.c b/runtime/src/kmp_runtime.c</font></tt><br>
<tt><font size="2">index fea41d0..d243700 100644</font></tt><br>
<tt><font size="2">--- a/runtime/src/kmp_runtime.c</font></tt><br>
<tt><font size="2">+++ b/runtime/src/kmp_runtime.c</font></tt><br>
<tt><font size="2">@@ -8450,7 +8450,7 @@ __kmp_determine_reduction_method( ident_t *loc, kmp_int32 global_tid,</font></tt><br>
<tt><font size="2"> int atomic_available = FAST_REDUCTION_ATOMIC_METHOD_GENERATED;</font></tt><br>
<tt><font size="2"> int tree_available = FAST_REDUCTION_TREE_METHOD_GENERATED;</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">- #if KMP_ARCH_X86_64</font></tt><br>
<tt><font size="2">+ #if KMP_ARCH_X86_64 || KMP_ARCH_PPC64</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> #if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN</font></tt><br>
<tt><font size="2"> #if KMP_MIC</font></tt><br>
<tt><font size="2">diff --git a/runtime/src/kmp_settings.c b/runtime/src/kmp_settings.c</font></tt><br>
<tt><font size="2">index 54745cb..b85678e 100644</font></tt><br>
<tt><font size="2">--- a/runtime/src/kmp_settings.c</font></tt><br>
<tt><font size="2">+++ b/runtime/src/kmp_settings.c</font></tt><br>
<tt><font size="2">@@ -536,6 +536,7 @@ __kmp_stg_parse_file(</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> static char * par_range_to_print = NULL;</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">+#ifdef KMP_DEBUG</font></tt><br>
<tt><font size="2"> static void</font></tt><br>
<tt><font size="2"> __kmp_stg_parse_par_range(</font></tt><br>
<tt><font size="2"> char const * name,</font></tt><br>
<tt><font size="2">@@ -614,7 +615,7 @@ __kmp_stg_parse_par_range(</font></tt><br>
<tt><font size="2"> break;</font></tt><br>
<tt><font size="2"> }</font></tt><br>
<tt><font size="2"> } // __kmp_stg_parse_par_range</font></tt><br>
<tt><font size="2">-</font></tt><br>
<tt><font size="2">+#endif</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> int</font></tt><br>
<tt><font size="2"> __kmp_initial_threads_capacity( int req_nproc )</font></tt><br>
<tt><font size="2">diff --git a/runtime/src/kmp_version.c b/runtime/src/kmp_version.c</font></tt><br>
<tt><font size="2">index f64d052..5dc82d1 100644</font></tt><br>
<tt><font size="2">--- a/runtime/src/kmp_version.c</font></tt><br>
<tt><font size="2">+++ b/runtime/src/kmp_version.c</font></tt><br>
<tt><font size="2">@@ -20,7 +20,7 @@</font></tt><br>
<tt><font size="2"> #include "kmp_version.h"</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> // Replace with snapshot date YYYYMMDD for promotion build.</font></tt><br>
<tt><font size="2">-#define KMP_VERSION_BUILD 00000000</font></tt><br>
<tt><font size="2">+//#define KMP_VERSION_BUILD 00000000</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> // Helper macros to convert value of macro to string literal.</font></tt><br>
<tt><font size="2"> #define _stringer( x ) #x</font></tt><br>
<tt><font size="2">diff --git a/runtime/src/makefile.mk b/runtime/src/makefile.mk</font></tt><br>
<tt><font size="2">index 9be8799..84d6ac2 100644</font></tt><br>
<tt><font size="2">--- a/runtime/src/makefile.mk</font></tt><br>
<tt><font size="2">+++ b/runtime/src/makefile.mk</font></tt><br>
<tt><font size="2">@@ -310,6 +310,9 @@ endif</font></tt><br>
<tt><font size="2"> ifeq "$(CPLUSPLUS)" "on"</font></tt><br>
<tt><font size="2"> ifeq "$(os)" "win"</font></tt><br>
<tt><font size="2"> c-flags += -TP</font></tt><br>
<tt><font size="2">+ else ifeq "$(arch)" "ppc64"</font></tt><br>
<tt><font size="2">+ # c++0x on ppc64 linux removes definition of preproc. macros, needed in .hs</font></tt><br>
<tt><font size="2">+ c-flags += -x c++ -std=gnu++0x</font></tt><br>
<tt><font size="2"> else</font></tt><br>
<tt><font size="2"> ifneq "$(filter gcc clang,$(c))" ""</font></tt><br>
<tt><font size="2"> c-flags += -x c++ -std=c++0x</font></tt><br>
<tt><font size="2">@@ -370,7 +373,7 @@ ifeq "$(os)" "lin"</font></tt><br>
<tt><font size="2"> ld-flags-extra += -lirc_pic</font></tt><br>
<tt><font size="2"> endif</font></tt><br>
<tt><font size="2"> endif</font></tt><br>
<tt><font size="2">- ifeq "$(filter 32 32e 64,$(arch))" ""</font></tt><br>
<tt><font size="2">+ ifeq "$(filter 32 32e 64 ppc64,$(arch))" ""</font></tt><br>
<tt><font size="2"> ld-flags-extra += $(shell pkg-config --libs libffi)</font></tt><br>
<tt><font size="2"> endif</font></tt><br>
<tt><font size="2"> else</font></tt><br>
<tt><font size="2">@@ -581,9 +584,12 @@ ifneq "$(os)" "win"</font></tt><br>
<tt><font size="2"> ifeq "$(arch)" "arm"</font></tt><br>
<tt><font size="2"> z_Linux_asm$(obj) : \</font></tt><br>
<tt><font size="2"> cpp-flags += -D KMP_ARCH_ARM</font></tt><br>
<tt><font size="2">- else</font></tt><br>
<tt><font size="2">+ else ifeq "$(arch)" "ppc64"</font></tt><br>
<tt><font size="2">+ z_Linux_asm$(obj) : \</font></tt><br>
<tt><font size="2">+ cpp-flags += -D KMP_ARCH_PPC64</font></tt><br>
<tt><font size="2">+ else</font></tt><br>
<tt><font size="2"> z_Linux_asm$(obj) : \</font></tt><br>
<tt><font size="2">- cpp-flags += -D KMP_ARCH_X86$(if $(filter 32e,$(arch)),_64)</font></tt><br>
<tt><font size="2">+ cpp-flags += -D KMP_ARCH_X86$(if $(filter 32e,$(arch)),_64) </font></tt><br>
<tt><font size="2"> endif</font></tt><br>
<tt><font size="2"> endif</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">@@ -729,7 +735,9 @@ endif</font></tt><br>
<tt><font size="2"> else # 5</font></tt><br>
<tt><font size="2"> lib_c_items += kmp_gsupport</font></tt><br>
<tt><font size="2"> endif</font></tt><br>
<tt><font size="2">+# ifneq "$(arch)" "ppc64"</font></tt><br>
<tt><font size="2"> lib_asm_items += z_Linux_asm</font></tt><br>
<tt><font size="2">+# endif</font></tt><br>
<tt><font size="2"> endif</font></tt><br>
<tt><font size="2"> endif</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">@@ -1391,9 +1399,13 @@ ifneq "$(filter %-dyna win-%,$(os)-$(LINK_TYPE))" ""</font></tt><br>
<tt><font size="2"> td_exp += libc.so.6</font></tt><br>
<tt><font size="2"> td_exp += ld-linux-armhf.so.3</font></tt><br>
<tt><font size="2"> endif</font></tt><br>
<tt><font size="2">+ ifeq "$(arch)" "ppc64"</font></tt><br>
<tt><font size="2">+ td_exp += libc.so.6</font></tt><br>
<tt><font size="2">+ td_exp += ld64.so.1</font></tt><br>
<tt><font size="2">+ endif</font></tt><br>
<tt><font size="2"> td_exp += libdl.so.2</font></tt><br>
<tt><font size="2"> td_exp += libgcc_s.so.1</font></tt><br>
<tt><font size="2">- ifeq "$(filter 32 32e 64,$(arch))" ""</font></tt><br>
<tt><font size="2">+ ifeq "$(filter 32 32e 64 ppc64,$(arch))" ""</font></tt><br>
<tt><font size="2"> td_exp += libffi.so.6</font></tt><br>
<tt><font size="2"> td_exp += libffi.so.5</font></tt><br>
<tt><font size="2"> endif</font></tt><br>
<tt><font size="2">diff --git a/runtime/src/thirdparty/ittnotify/ittnotify_config.h b/runtime/src/thirdparty/ittnotify/ittnotify_config.h</font></tt><br>
<tt><font size="2">index 40c8614..9e7b36b 100644</font></tt><br>
<tt><font size="2">--- a/runtime/src/thirdparty/ittnotify/ittnotify_config.h</font></tt><br>
<tt><font size="2">+++ b/runtime/src/thirdparty/ittnotify/ittnotify_config.h</font></tt><br>
<tt><font size="2">@@ -132,6 +132,11 @@</font></tt><br>
<tt><font size="2"> # define ITT_ARCH_ARM 4</font></tt><br>
<tt><font size="2"> #endif /* ITT_ARCH_ARM */</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">+#ifndef ITT_ARCH_PPC64</font></tt><br>
<tt><font size="2">+# define ITT_ARCH_PPC64 5</font></tt><br>
<tt><font size="2">+#endif /* ITT_ARCH_PPC64 */</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2"> #ifndef ITT_ARCH</font></tt><br>
<tt><font size="2"> # if defined _M_IX86 || defined __i386__</font></tt><br>
<tt><font size="2"> # define ITT_ARCH ITT_ARCH_IA32</font></tt><br>
<tt><font size="2">@@ -141,6 +146,8 @@</font></tt><br>
<tt><font size="2"> # define ITT_ARCH ITT_ARCH_IA64</font></tt><br>
<tt><font size="2"> # elif defined _M_ARM || __arm__</font></tt><br>
<tt><font size="2"> # define ITT_ARCH ITT_ARCH_ARM</font></tt><br>
<tt><font size="2">+# elif defined __powerpc64__</font></tt><br>
<tt><font size="2">+# define ITT_ARCH ITT_ARCH_PPC64</font></tt><br>
<tt><font size="2"> # endif</font></tt><br>
<tt><font size="2"> #endif</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">@@ -274,7 +281,7 @@ ITT_INLINE long __TBB_machine_fetchadd4(volatile void* ptr, long addend)</font></tt><br>
<tt><font size="2"> : "memory");</font></tt><br>
<tt><font size="2"> return result;</font></tt><br>
<tt><font size="2"> }</font></tt><br>
<tt><font size="2">-#elif ITT_ARCH==ITT_ARCH_ARM</font></tt><br>
<tt><font size="2">+#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_PPC64</font></tt><br>
<tt><font size="2"> #define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)</font></tt><br>
<tt><font size="2"> #endif /* ITT_ARCH==ITT_ARCH_IA64 */</font></tt><br>
<tt><font size="2"> #ifndef ITT_SIMPLE_INIT</font></tt><br>
<tt><font size="2">diff --git a/runtime/src/z_Linux_asm.s b/runtime/src/z_Linux_asm.s</font></tt><br>
<tt><font size="2">index 1f1ba1b..64c8052 100644</font></tt><br>
<tt><font size="2">--- a/runtime/src/z_Linux_asm.s</font></tt><br>
<tt><font size="2">+++ b/runtime/src/z_Linux_asm.s</font></tt><br>
<tt><font size="2">@@ -138,7 +138,7 @@ __kmp_unnamed_critical_addr:</font></tt><br>
<tt><font size="2"> #endif /* KMP_GOMP_COMPAT */</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">-#if KMP_ARCH_X86</font></tt><br>
<tt><font size="2">+#if KMP_ARCH_X86 && !KMP_ARCH_PPC64</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> // -----------------------------------------------------------------------</font></tt><br>
<tt><font size="2"> // microtasking routines specifically written for IA-32 architecture</font></tt><br>
<tt><font size="2">@@ -1585,6 +1585,16 @@ __kmp_unnamed_critical_addr:</font></tt><br>
<tt><font size="2"> .size __kmp_unnamed_critical_addr,4</font></tt><br>
<tt><font size="2"> #endif /* KMP_ARCH_ARM */</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">+#if KMP_ARCH_PPC64</font></tt><br>
<tt><font size="2">+ .data</font></tt><br>
<tt><font size="2">+ .comm .gomp_critical_user_,32,8</font></tt><br>
<tt><font size="2">+ .data</font></tt><br>
<tt><font size="2">+ .align 8</font></tt><br>
<tt><font size="2">+ .global __kmp_unnamed_critical_ad
dr</font></tt><br>
<tt><font size="2">+__kmp_unnamed_critical_addr:</font></tt><br>
<tt><font size="2">+ .8byte .gomp_critical_user_</font></tt><br>
<tt><font size="2">+ .size __kmp_unnamed_critical_addr,8</font></tt><br>
<tt><font size="2">+#endif /* KMP_ARCH_PPC64 */</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> #if defined(__linux__)</font></tt><br>
<tt><font size="2"> .section .note.GNU-stack,"",@progbits</font></tt><br>
<tt><font size="2">diff --git a/runtime/src/z_Linux_util.c b/runtime/src/z_Linux_util.c</font></tt><br>
<tt><font size="2">index 7633f99..348f5d8 100644</font></tt><br>
<tt><font size="2">--- a/runtime/src/z_Linux_util.c</font></tt><br>
<tt><font size="2">+++ b/runtime/src/z_Linux_util.c</font></tt><br>
<tt><font size="2">@@ -32,7 +32,7 @@</font></tt><br>
<tt><font size="2"> #include <sys/resource.h></font></tt><br>
<tt><font size="2"> #include <sys/syscall.h></font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">-#if KMP_OS_LINUX</font></tt><br>
<tt><font size="2">+#if KMP_OS_LINUX && !KMP_OS_CNK</font></tt><br>
<tt><font size="2"> # include <sys/sysinfo.h></font></tt><br>
<tt><font size="2"> # if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM)</font></tt><br>
<tt><font size="2"> // We should really include <futex.h>, but that causes compatibility problems on different</font></tt><br>
<tt><font size="2">@@ -61,7 +61,7 @@</font></tt><br>
<tt><font size="2"> #include <fcntl.h></font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> // For non-x86 architecture</font></tt><br>
<tt><font size="2">-#if KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64)</font></tt><br>
<tt><font size="2">+#if KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_PPC64)</font></tt><br>
<tt><font size="2"> # include <stdbool.h></font></tt><br>
<tt><font size="2"> # include <ffi.h></font></tt><br>
<tt><font size="2"> #endif</font></tt><br>
<tt><font size="2">@@ -110,7 +110,7 @@ __kmp_print_cond( char *buffer, kmp_cond_align_t *cond )</font></tt><br>
<tt><font size="2"> /* ------------------------------------------------------------------------ */</font></tt><br>
<tt><font size="2"> /* ------------------------------------------------------------------------ */</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">-#if KMP_OS_LINUX && KMP_AFFINITY_SUPPORTED</font></tt><br>
<tt><font size="2">+#if ( KMP_OS_LINUX && KMP_AFFINITY_SUPPORTED)</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> /*</font></tt><br>
<tt><font size="2"> * Affinity support</font></tt><br>
<tt><font size="2">@@ -147,6 +147,19 @@ __kmp_print_cond( char *buffer, kmp_cond_align_t *cond )</font></tt><br>
<tt><font size="2"> # error Wrong code for getaffinity system call.</font></tt><br>
<tt><font size="2"> # endif /* __NR_sched_getaffinity */</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">+# elif KMP_ARCH_PPC64</font></tt><br>
<tt><font size="2">+# ifndef __NR_sched_setaffinity</font></tt><br>
<tt><font size="2">+# define __NR_sched_setaffinity 222</font></tt><br>
<tt><font size="2">+# elif __NR_sched_setaffinity != 222</font></tt><br>
<tt><font size="2">+# error Wrong code for setaffinity system call.</font></tt><br>
<tt><font size="2">+# endif /* __NR_sched_setaffinity */</font></tt><br>
<tt><font size="2">+# ifndef __NR_sched_getaffinity</font></tt><br>
<tt><font size="2">+# define __NR_sched_getaffinity 223</font></tt><br>
<tt><font size="2">+# elif __NR_sched_getaffinity != 223</font></tt><br>
<tt><font size="2">+# error Wrong code for getaffinity system call.</font></tt><br>
<tt><font size="2">+# endif /* __NR_sched_getaffinity */</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2"> # else</font></tt><br>
<tt><font size="2"> # error Unknown or unsupported architecture</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">@@ -445,7 +458,7 @@ __kmp_change_thread_affinity_mask( int gtid, kmp_affin_mask_t *new_mask,</font></tt><br>
<tt><font size="2"> /* ------------------------------------------------------------------------ */</font></tt><br>
<tt><font size="2"> /* ------------------------------------------------------------------------ */</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">-#if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM)</font></tt><br>
<tt><font size="2">+#if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM) && !KMP_OS_CNK</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> int</font></tt><br>
<tt><font size="2"> __kmp_futex_determine_capable()</font></tt><br>
<tt><font size="2">@@ -462,7 +475,7 @@ __kmp_futex_determine_capable()</font></tt><br>
<tt><font size="2"> return retval;</font></tt><br>
<tt><font size="2"> }</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">-#endif // KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM)</font></tt><br>
<tt><font size="2">+#endif // KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM) && !KMP_OS_CNK</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> /* ------------------------------------------------------------------------ */</font></tt><br>
<tt><font size="2"> /* ------------------------------------------------------------------------ */</font></tt><br>
<tt><font size="2">@@ -481,7 +494,7 @@ __kmp_test_then_or32( volatile kmp_int32 *p, kmp_int32 d )</font></tt><br>
<tt><font size="2"> old_value = TCR_4( *p );</font></tt><br>
<tt><font size="2"> new_value = old_value | d;</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">- while ( ! __kmp_compare_and_store32 ( p, old_value, new_value ) )</font></tt><br>
<tt><font size="2">+ while ( ! KMP_COMPARE_AND_STORE_REL32 ( p, old_value, new_value ) )</font></tt><br>
<tt><font size="2"> {</font></tt><br>
<tt><font size="2"> KMP_CPU_PAUSE();</font></tt><br>
<tt><font size="2"> old_value = TCR_4( *p );</font></tt><br>
<tt><font size="2">@@ -498,7 +511,7 @@ __kmp_test_then_and32( volatile kmp_int32 *p, kmp_int32 d )</font></tt><br>
<tt><font size="2"> old_value = TCR_4( *p );</font></tt><br>
<tt><font size="2"> new_value = old_value & d;</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">- while ( ! __kmp_compare_and_store32 ( p, old_value, new_value ) )</font></tt><br>
<tt><font size="2">+ while ( ! KMP_COMPARE_AND_STORE_REL32 ( p, old_value, new_value ) )</font></tt><br>
<tt><font size="2"> {</font></tt><br>
<tt><font size="2"> KMP_CPU_PAUSE();</font></tt><br>
<tt><font size="2"> old_value = TCR_4( *p );</font></tt><br>
<tt><font size="2">@@ -507,7 +520,7 @@ __kmp_test_then_and32( volatile kmp_int32 *p, kmp_int32 d )</font></tt><br>
<tt><font size="2"> return old_value;</font></tt><br>
<tt><font size="2"> }</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">-# if KMP_ARCH_X86</font></tt><br>
<tt><font size="2">+# if KMP_ARCH_X86 || KMP_ARCH_PPC64</font></tt><br>
<tt><font size="2"> kmp_int64</font></tt><br>
<tt><font size="2"> __kmp_test_then_add64( volatile kmp_int64 *p, kmp_int64 d )</font></tt><br>
<tt><font size="2"> {</font></tt><br>
<tt><font size="2">@@ -516,7 +529,7 @@ __kmp_test_then_add64( volatile kmp_int64 *p, kmp_int64 d )</font></tt><br>
<tt><font size="2"> old_value = TCR_8( *p );</font></tt><br>
<tt><font size="2"> new_value = old_value + d;</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">- while ( ! __kmp_compare_and_store64 ( p, old_value, new_value ) )</font></tt><br>
<tt><font size="2">+ while ( ! KMP_COMPARE_AND_STORE_REL64 ( p, old_value, new_value ) )</font></tt><br>
<tt><font size="2"> {</font></tt><br>
<tt><font size="2"> KMP_CPU_PAUSE();</font></tt><br>
<tt><font size="2"> old_value = TCR_8( *p );</font></tt><br>
<tt><font size="2">@@ -533,7 +546,7 @@ __kmp_test_then_or64( volatile kmp_int64 *p, kmp_int64 d )</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> old_value = TCR_8( *p );</font></tt><br>
<tt><font size="2"> new_value = old_value | d;</font></tt><br>
<tt><font size="2">- while ( ! __kmp_compare_and_store64 ( p, old_value, new_value ) )</font></tt><br>
<tt><font size="2">+ while ( ! KMP_COMPARE_AND_STORE_REL64 ( p, old_value, new_value ) )</font></tt><br>
<tt><font size="2"> {</font></tt><br>
<tt><font size="2"> KMP_CPU_PAUSE();</font></tt><br>
<tt><font size="2"> old_value = TCR_8( *p );</font></tt><br>
<tt><font size="2">@@ -549,7 +562,7 @@ __kmp_test_then_and64( volatile kmp_int64 *p, kmp_int64 d )</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> old_value = TCR_8( *p );</font></tt><br>
<tt><font size="2"> new_value = old_value & d;</font></tt><br>
<tt><font size="2">- while ( ! __kmp_compare_and_store64 ( p, old_value, new_value ) )</font></tt><br>
<tt><font size="2">+ while ( ! KMP_COMPARE_AND_STORE_REL64 ( p, old_value, new_value ) )</font></tt><br>
<tt><font size="2"> {</font></tt><br>
<tt><font size="2"> KMP_CPU_PAUSE();</font></tt><br>
<tt><font size="2"> old_value = TCR_8( *p );</font></tt><br>
<tt><font size="2">@@ -2527,7 +2540,7 @@ __kmp_get_load_balance( int max )</font></tt><br>
<tt><font size="2"> #endif // USE_LOAD_BALANCE</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">-#if KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64)</font></tt><br>
<tt><font size="2">+#if KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_PPC64)</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> int __kmp_invoke_microtask( microtask_t pkfn, int gtid, int tid, int argc,</font></tt><br>
<tt><font size="2"> void *p_argv[] )</font></tt><br>
<tt><font size="2">@@ -2561,7 +2574,89 @@ int __kmp_invoke_microtask( microtask_t pkfn, int gtid, int tid, int argc,</font></tt><br>
<tt><font size="2"> return 1;</font></tt><br>
<tt><font size="2"> }</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">-#endif // KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64)</font></tt><br>
<tt><font size="2">+#endif // KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_PPC64)</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+#if KMP_ARCH_PPC64</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+// we really only need the case with 1 argument, because CLANG always build</font></tt><br>
<tt><font size="2">+// a struct of pointers to shared variables referenced in the outlined function</font></tt><br>
<tt><font size="2">+int</font></tt><br>
<tt><font size="2">+__kmp_invoke_microtask( microtask_t pkfn,</font></tt><br>
<tt><font size="2">+ int gtid, int tid,</font></tt><br>
<tt><font size="2">+ int argc, void *p_argv[] ) {</font></tt><br>
<tt><font size="2">+ switch (argc) {</font></tt><br>
<tt><font size="2">+ default:</font></tt><br>
<tt><font size="2">+ fprintf(stderr, "Too many args to microtask: %d!\n", argc);</font></tt><br>
<tt><font size="2">+ fflush(stderr);</font></tt><br>
<tt><font size="2">+ exit(-1);</font></tt><br>
<tt><font size="2">+ case 0:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ case 1:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid, p_argv[0]);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ case 2:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid, p_argv[0], p_argv[1]);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ case 3:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2]);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ case 4:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3]);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ case 5:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4]);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ case 6:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],</font></tt><br>
<tt><font size="2">+ p_argv[5]);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ case 7:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],</font></tt><br>
<tt><font size="2">+ p_argv[5], p_argv[6]);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ case 8:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],</font></tt><br>
<tt><font size="2">+ p_argv[5], p_argv[6], p_argv[7]);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ case 9:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],</font></tt><br>
<tt><font size="2">+ p_argv[5], p_argv[6], p_argv[7], p_argv[8]);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ case 10:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],</font></tt><br>
<tt><font size="2">+ p_argv[5], p_argv[6], p_argv[7], p_argv[8], p_argv[9]);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ case 11:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],</font></tt><br>
<tt><font size="2">+ p_argv[5], p_argv[6], p_argv[7], p_argv[8], p_argv[9], p_argv[10]);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ case 12:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],</font></tt><br>
<tt><font size="2">+ p_argv[5], p_argv[6], p_argv[7], p_argv[8], p_argv[9], p_argv[10],</font></tt><br>
<tt><font size="2">+ p_argv[11]);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ case 13:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],</font></tt><br>
<tt><font size="2">+ p_argv[5], p_argv[6], p_argv[7], p_argv[8], p_argv[9], p_argv[10],</font></tt><br>
<tt><font size="2">+ p_argv[11], p_argv[12]);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ case 14:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],</font></tt><br>
<tt><font size="2">+ p_argv[5], p_argv[6], p_argv[7], p_argv[8], p_argv[9], p_argv[10],</font></tt><br>
<tt><font size="2">+ p_argv[11], p_argv[12], p_argv[13]);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ case 15:</font></tt><br>
<tt><font size="2">+ (*pkfn)(>id, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],</font></tt><br>
<tt><font size="2">+ p_argv[5], p_argv[6], p_argv[7], p_argv[8], p_argv[9], p_argv[10],</font></tt><br>
<tt><font size="2">+ p_argv[11], p_argv[12], p_argv[13], p_argv[14]);</font></tt><br>
<tt><font size="2">+ break;</font></tt><br>
<tt><font size="2">+ }</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+ return 1;</font></tt><br>
<tt><font size="2">+}</font></tt><br>
<tt><font size="2">+</font></tt><br>
<tt><font size="2">+#endif</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> // end of file //</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">diff --git a/runtime/tools/lib/Platform.pm b/runtime/tools/lib/Platform.pm</font></tt><br>
<tt><font size="2">index 5b399f7..763f3cb 100644</font></tt><br>
<tt><font size="2">--- a/runtime/tools/lib/Platform.pm</font></tt><br>
<tt><font size="2">+++ b/runtime/tools/lib/Platform.pm</font></tt><br>
<tt><font size="2">@@ -50,6 +50,8 @@ sub canon_arch($) {</font></tt><br>
<tt><font size="2"> $arch = "32e";</font></tt><br>
<tt><font size="2"> } elsif ( $arch =~ m{\Aarm(?:v7\D*)?\z} ) {</font></tt><br>
<tt><font size="2"> $arch = "arm";</font></tt><br>
<tt><font size="2">+ } elsif ( $arch =~ m{\Appc64} ) {</font></tt><br>
<tt><font size="2">+ $arch = "ppc64";</font></tt><br>
<tt><font size="2"> } else {</font></tt><br>
<tt><font size="2"> $arch = undef;</font></tt><br>
<tt><font size="2"> }; # if</font></tt><br>
<tt><font size="2">@@ -62,6 +64,7 @@ sub canon_arch($) {</font></tt><br>
<tt><font size="2"> "32" => "IA-32 architecture",</font></tt><br>
<tt><font size="2"> "32e" => "Intel(R) 64",</font></tt><br>
<tt><font size="2"> "arm" => "ARM",</font></tt><br>
<tt><font size="2">+ "ppc64" => "PPC64",</font></tt><br>
<tt><font size="2"> );</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> sub legal_arch($) {</font></tt><br>
<tt><font size="2">@@ -159,6 +162,8 @@ sub target_options() {</font></tt><br>
<tt><font size="2"> $_host_arch = "32e";</font></tt><br>
<tt><font size="2"> } elsif ( $hardware_platform eq "arm" ) {</font></tt><br>
<tt><font size="2"> $_host_arch = "arm";</font></tt><br>
<tt><font size="2">+ } elsif ( $hardware_platform eq "ppc64" ) {</font></tt><br>
<tt><font size="2">+ $_host_arch = "ppc64";</font></tt><br>
<tt><font size="2"> } else {</font></tt><br>
<tt><font size="2"> die "Unsupported host hardware platform: \"$hardware_platform\"; stopped";</font></tt><br>
<tt><font size="2"> }; # if</font></tt><br>
<tt><font size="2">diff --git a/runtime/tools/lib/Uname.pm b/runtime/tools/lib/Uname.pm</font></tt><br>
<tt><font size="2">index e212501..52518b4 100644</font></tt><br>
<tt><font size="2">--- a/runtime/tools/lib/Uname.pm</font></tt><br>
<tt><font size="2">+++ b/runtime/tools/lib/Uname.pm</font></tt><br>
<tt><font size="2">@@ -147,6 +147,8 @@ if ( 0 ) {</font></tt><br>
<tt><font size="2"> $values{ hardware_platform } = "x86_64";</font></tt><br>
<tt><font size="2"> } elsif ( $values{ machine } =~ m{\Aarmv7\D*\z} ) {</font></tt><br>
<tt><font size="2"> $values{ hardware_platform } = "arm";</font></tt><br>
<tt><font size="2">+ } elsif ( $values{ machine } =~ m{\Appc64\z} ) {</font></tt><br>
<tt><font size="2">+ $values{ hardware_platform } = "ppc64";</font></tt><br>
<tt><font size="2"> } else {</font></tt><br>
<tt><font size="2"> die "Unsupported machine (\"$values{ machine }\") returned by POSIX::uname(); stopped";</font></tt><br>
<tt><font size="2"> }; # if</font></tt><br>
<tt><font size="2">diff --git a/runtime/tools/src/common-defs.mk b/runtime/tools/src/common-defs.mk</font></tt><br>
<tt><font size="2">index ebd1922..7eb64b0 100644</font></tt><br>
<tt><font size="2">--- a/runtime/tools/src/common-defs.mk</font></tt><br>
<tt><font size="2">+++ b/runtime/tools/src/common-defs.mk</font></tt><br>
<tt><font size="2">@@ -45,7 +45,7 @@ endif</font></tt><br>
<tt><font size="2"> # Description:</font></tt><br>
<tt><font size="2"> # The function return printable name of specified architecture, IA-32 architecture or Intel(R) 64.</font></tt><br>
<tt><font size="2"> #</font></tt><br>
<tt><font size="2">-legal_arch = $(if $(filter 32,$(1)),IA-32,$(if $(filter 32e,$(1)),Intel(R) 64,$(if $(filter l1,$(1)),L1OM,$(if $(filter arm,$(1)),ARM,$(error Bad architecture specified: $(1))))))</font></tt><br>
<tt><font size="2">+legal_arch = $(if $(filter 32,$(1)),IA-32,$(if $(filter 32e,$(1)),Intel(R) 64,$(if $(filter l1,$(1)),L1OM,$(if $(filter arm,$(1)),ARM,$(if $(filter ppc64,$(1)),PPC64,$(error Bad architecture specified: $(1)))))))</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> # Synopsis:</font></tt><br>
<tt><font size="2"> # var_name = $(call check_variable,var,list)</font></tt><br>
<tt><font size="2">@@ -128,9 +128,9 @@ endif</font></tt><br>
<tt><font size="2"> # --------------------------------------------------------------------------------------------------</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2"> os := $(call check_variable,os,lin lrb mac win)</font></tt><br>
<tt><font size="2">-arch := $(call check_variable,arch,32 32e 64 arm)</font></tt><br>
<tt><font size="2">+arch := $(call check_variable,arch,32 32e 64 arm ppc64)</font></tt><br>
<tt><font size="2"> platform := $(os)_$(arch)</font></tt><br>
<tt><font size="2">-platform := $(call check_variable,platform,lin_32 lin_32e lin_64 lin_arm lrb_32e mac_32 mac_32e win_32 win_32e win_64)</font></tt><br>
<tt><font size="2">+platform := $(call check_variable,platform,lin_32 lin_32e lin_64 lin_arm lrb_32e mac_32 mac_32e win_32 win_32e win_64 lin_ppc64)</font></tt><br>
<tt><font size="2"> # oa-opts means "os and arch options". They are passed to almost all perl scripts.</font></tt><br>
<tt><font size="2"> oa-opts := --os=$(os) --arch=$(arch)</font></tt><br>
<tt><font size="2"> </font></tt><br>
<tt><font size="2">diff --git a/runtime/tools/src/common-tools.mk b/runtime/tools/src/common-tools.mk</font></tt><br>
<tt><font size="2">index a9c9fbc..8c86791 100644</font></tt><br>
<tt><font size="2">--- a/runtime/tools/src/common-tools.mk</font></tt><br>
<tt><font size="2">+++ b/runtime/tools/src/common-tools.mk</font></tt><br>
<tt><font size="2">@@ -34,7 +34,7 @@</font></tt><br>
<tt><font size="2"> # "No rule to build .\kmp_i18n.inc". Using "./" solves the problem.</font></tt><br>
<tt><font size="2"> cpp-flags += -I ./</font></tt><br>
<tt><font size="2"> # For non-x86 architecture</font></tt><br>
<tt><font size="2">-ifeq "$(filter 32 32e 64,$(arch))" ""</font></tt><br>
<tt><font size="2">+ifeq "$(filter 32 32e 64 ppc64,$(arch))" ""</font></tt><br>
<tt><font size="2"> cpp-flags += $(shell pkg-config --cflags libffi)</font></tt><br>
<tt><font size="2"> endif</font></tt><br>
<tt><font size="2"> # Add all VPATH directories to path for searching include files.</font></tt><br>
</body></html>