[Openmp-commits] [openmp] r215093 - Commit PowerPC64 support from Carlo Bertolli at IBM.

Jim Cownie james.h.cownie at intel.com
Thu Aug 7 03:12:55 PDT 2014


Author: jimcownie
Date: Thu Aug  7 05:12:54 2014
New Revision: 215093

URL: http://llvm.org/viewvc/llvm-project?rev=215093&view=rev
Log:
Commit PowerPC64 support from Carlo Bertolli at IBM.

Modified:
    openmp/trunk/CREDITS.txt
    openmp/trunk/runtime/Build_With_CMake.txt
    openmp/trunk/runtime/CMakeLists.txt
    openmp/trunk/runtime/cmake/Definitions.cmake
    openmp/trunk/runtime/cmake/HelperFunctions.cmake
    openmp/trunk/runtime/src/CMakeLists.txt
    openmp/trunk/runtime/src/kmp.h
    openmp/trunk/runtime/src/kmp_csupport.c
    openmp/trunk/runtime/src/kmp_ftn_os.h
    openmp/trunk/runtime/src/kmp_global.c
    openmp/trunk/runtime/src/kmp_gsupport.c
    openmp/trunk/runtime/src/kmp_lock.h
    openmp/trunk/runtime/src/kmp_os.h
    openmp/trunk/runtime/src/kmp_runtime.c
    openmp/trunk/runtime/src/kmp_settings.c
    openmp/trunk/runtime/src/makefile.mk
    openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_config.h
    openmp/trunk/runtime/src/z_Linux_asm.s
    openmp/trunk/runtime/src/z_Linux_util.c
    openmp/trunk/runtime/tools/lib/Platform.pm
    openmp/trunk/runtime/tools/lib/Uname.pm
    openmp/trunk/runtime/tools/src/common-defs.mk

Modified: openmp/trunk/CREDITS.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/CREDITS.txt?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/CREDITS.txt (original)
+++ openmp/trunk/CREDITS.txt Thu Aug  7 05:12:54 2014
@@ -8,6 +8,9 @@ beautification by scripts.  The fields a
 (W), PGP key ID and fingerprint (P), description (D), and snail-mail address
 (S).
 
+N: Carlo Bertolli
+D: IBM contributor to PowerPC support in CMake files and elsewhere.
+
 N: Sunita Chandrasekaran
 D: Contributor to testsuite from OpenUH
 

Modified: openmp/trunk/runtime/Build_With_CMake.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/Build_With_CMake.txt?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/Build_With_CMake.txt (original)
+++ openmp/trunk/runtime/Build_With_CMake.txt Thu Aug  7 05:12:54 2014
@@ -112,9 +112,10 @@ Build options
 ======================
 ==== Architecture ====
 ======================
--Darch=32|32e|arm
-* Architecture can be 32 (IA-32 architecture), 32e (Intel(R) 64 architecture)
-  or arm (ARM architecture).  This option, by default is chosen based on the
+-Darch=32|32e|arm|ppc64
+* Architecture can be 32 (IA-32 architecture), 32e (Intel(R) 64 architecture),
+  arm (ARM architecture), or ppc64 (PPC64 architecture).
+  This option, by default is chosen based on the
   CMake variable CMAKE_SIZEOF_VOID_P.  If it is 8, then Intel(R) 64 architecture
   is assumed.  If it is 4, then IA-32 architecture is assumed.  If you want to
   use a different architecture other than x86 based architecture, you must specify

Modified: openmp/trunk/runtime/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/CMakeLists.txt?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/CMakeLists.txt (original)
+++ openmp/trunk/runtime/CMakeLists.txt Thu Aug  7 05:12:54 2014
@@ -49,7 +49,7 @@ include(FindPerl) # Standard cmake modul
 
 # Build Configuration
 set(os_possible_values          lin mac win mic)
-set(arch_possible_values        32e 32 arm)
+set(arch_possible_values        32e 32 arm ppc64)
 set(build_type_possible_values  release debug relwithdebinfo)
 set(omp_version_possible_values 40 30)
 set(lib_type_possible_values    normal profile stubs)
@@ -71,10 +71,13 @@ else()
     set(os             lin         CACHE STRING "The operating system to build for (lin/mac/win/mic)")
 endif()
 
-if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
-    set(arch           32          CACHE STRING "The architecture to build for (32e/32/arm).  32e is Intel(R) 64 architecture, 32 is IA-32 architecture")
-else()
-    set(arch           32e         CACHE STRING "The architecture to build for (32e/32/arm).  32e is Intel(R) 64 architecture, 32 is IA-32 architecture")
+# set to default architecture if the user did not specify an architecture explicitly
+if(NOT arch)	
+	if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
+    	set(arch           32          CACHE STRING "The architecture to build for (32e/32/arm/ppc64).  32e is Intel(R) 64 architecture, 32 is IA-32 architecture")
+	else()
+    	set(arch           32e         CACHE STRING "The architecture to build for (32e/32/arm/ppc64).  32e is Intel(R) 64 architecture, 32 is IA-32 architecture")
+	endif()
 endif()
 
 set(lib_type       normal        CACHE STRING "Performance,Profiling,Stubs library (normal/profile/stubs)")
@@ -170,12 +173,15 @@ endif()
 set(IA32 FALSE)
 set(INTEL64 FALSE)
 set(ARM FALSE)
+set(PPC64 FALSE)
 if("${arch}" STREQUAL "32")      # IA-32 architecture
     set(IA32 TRUE)
 elseif("${arch}" STREQUAL "32e") # Intel(R) 64 architecture
     set(INTEL64 TRUE)
 elseif("${arch}" STREQUAL "arm") # ARM architecture
     set(ARM TRUE)
+elseif("${arch}" STREQUAL "ppc64") # PPC64 architecture
+    set(PPC64 TRUE)
 endif()
 
 # Set some flags based on build_type
@@ -635,6 +641,8 @@ elseif(${INTEL64})
     set_source_files_properties(${src_dir}/z_Linux_asm.s PROPERTIES COMPILE_DEFINITIONS "KMP_ARCH_X86_64")
 elseif(${IA32})
     set_source_files_properties(${src_dir}/z_Linux_asm.s PROPERTIES COMPILE_DEFINITIONS "KMP_ARCH_X86")
+elseif(${PPC64})
+	set_source_files_properties(${src_dir}/z_Linux_asm.s PROPERTIES COMPILE_DEFINITIONS "KMP_ARCH_PPC64")
 endif()
 
 if(${WINDOWS})

Modified: openmp/trunk/runtime/cmake/Definitions.cmake
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/cmake/Definitions.cmake?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/cmake/Definitions.cmake (original)
+++ openmp/trunk/runtime/cmake/Definitions.cmake Thu Aug  7 05:12:54 2014
@@ -23,7 +23,14 @@ function(append_cpp_flags input_cpp_flag
     append_definitions("-D BUILD_I8")
     append_definitions("-D KMP_LIBRARY_FILE=\\\\\"${lib_file}\\\\\"") # yes... you need 5 backslashes...
     append_definitions("-D KMP_VERSION_MAJOR=${version}")
-    append_definitions("-D CACHE_LINE=64")
+    
+    # customize to 128 bytes for ppc64
+    if(${PPC64})
+    	append_definitions("-D CACHE_LINE=128")
+    else()
+    	append_definitions("-D CACHE_LINE=64")
+    endif()
+    
     append_definitions("-D KMP_ADJUST_BLOCKTIME=1")
     append_definitions("-D BUILD_PARALLEL_ORDERED")
     append_definitions("-D KMP_ASM_INTRINS")

Modified: openmp/trunk/runtime/cmake/HelperFunctions.cmake
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/cmake/HelperFunctions.cmake?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/cmake/HelperFunctions.cmake (original)
+++ openmp/trunk/runtime/cmake/HelperFunctions.cmake Thu Aug  7 05:12:54 2014
@@ -67,6 +67,8 @@ function(set_legal_arch return_arch_stri
         set(${return_arch_string} "L1OM" PARENT_SCOPE)
     elseif(${ARM})
         set(${return_arch_string} "ARM" PARENT_SCOPE)
+	elseif(${PPC64})
+	    set(${return_arch_string} "PPC64" PARENT_SCOPE)
     else()
         warning_say("set_legal_arch(): Warning: Unknown architecture...")
     endif()

Modified: openmp/trunk/runtime/src/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/CMakeLists.txt?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/src/CMakeLists.txt (original)
+++ openmp/trunk/runtime/src/CMakeLists.txt Thu Aug  7 05:12:54 2014
@@ -22,11 +22,17 @@ else()
   message(FATAL_ERROR "Unsupported OS")
 endif()
 
-if("${ARCH}" STREQUAL "")
+if(arch)	
+	set(ARCH ${arch}) #acquire from command line
+else() #assume default
   set(ARCH "32e")
 endif()
 
-set(ARCH_STR "Intel(R) 64")
+if("${arch}" STREQUAL "32e")
+  set(ARCH_STR "Intel(R) 64")
+elseif("${arch}" STREQUAL "ppc64")
+  set(ARCH_STR "PPC64")
+endif()
 
 set(FEATURE_FLAGS "-D USE_ITT_BUILD")
 set(FEATURE_FLAGS "${FEATURE_FLAGS} -D NDEBUG")
@@ -36,13 +42,22 @@ set(FEATURE_FLAGS "${FEATURE_FLAGS} -D _
 set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_USE_ASSERT")
 set(FEATURE_FLAGS "${FEATURE_FLAGS} -D BUILD_I8")
 set(FEATURE_FLAGS "${FEATURE_FLAGS} -D BUILD_TV")
+
 if(APPLE)
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -current_version 5.0")
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -compatibility_version 5.0")
 endif()
+
 set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_LIBRARY_FILE=\\\"libiomp5.${OMP_SHLIBEXT}\\\"")
 set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_VERSION_MAJOR=${VERSION}")
-set(FEATURE_FLAGS "${FEATURE_FLAGS} -D CACHE_LINE=64")
+
+# customize cache line size for ppc64 to 128 bytes: 64 in all other cases
+if("${arch}" STREQUAL "ppc64")
+	set(FEATURE_FLAGS "${FEATURE_FLAGS} -D CACHE_LINE=128")
+else()
+	set(FEATURE_FLAGS "${FEATURE_FLAGS} -D CACHE_LINE=64")	
+endif()
+
 set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_ADJUST_BLOCKTIME=1")
 set(FEATURE_FLAGS "${FEATURE_FLAGS} -D BUILD_PARALLEL_ORDERED")
 set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_ASM_INTRINS")
@@ -50,8 +65,13 @@ set(FEATURE_FLAGS "${FEATURE_FLAGS} -D U
 set(FEATURE_FLAGS "${FEATURE_FLAGS} -D USE_CBLKDATA")
 set(FEATURE_FLAGS "${FEATURE_FLAGS} -D GUIDEDLL_EXPORTS")
 set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_GOMP_COMPAT")
-set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_USE_ADAPTIVE_LOCKS=1")
-set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_DEBUG_ADAPTIVE_LOCKS=0")
+
+#adaptive locks use x86 assembly - disable for ppc64
+if("${arch}" STREQUAL "32e" OR "${arch}" STREQUAL "32" OR "${arch}" STREQUAL "arm")
+	set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_USE_ADAPTIVE_LOCKS=1")
+	set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_DEBUG_ADAPTIVE_LOCKS=0")
+endif()
+
 set(FEATURE_FLAGS "${FEATURE_FLAGS} -D OMP_50_ENABLED=0")
 set(FEATURE_FLAGS "${FEATURE_FLAGS} -D OMP_41_ENABLED=0")
 set(FEATURE_FLAGS "${FEATURE_FLAGS} -D OMP_40_ENABLED=1")
@@ -122,16 +142,38 @@ add_custom_command(
   OUTPUT omp.h
     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
 )
-add_custom_command(
-  OUTPUT z_Linux_asm.o
-    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}
-)
+
+if("${ARCH}" STREQUAL "ppc64")
+	add_custom_command(
+		OUTPUT z_Linux_asm.o
+    		       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}
+		       )
+else()
+	add_custom_command(
+		OUTPUT z_Linux_asm.o
+    		       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}
+		       )
+endif()
+
 
 add_custom_target(gen_kmp_i18n DEPENDS kmp_i18n_id.inc kmp_i18n_default.inc omp.h z_Linux_asm.o)
 
 if(NOT APPLE)
-  set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports_so.txt")
+	if(${ARCH} STREQUAL "ppc64" AND ${OS_GEN} STREQUAL "lin")
+  		set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports_so.txt -ldl")
+ 	else()
+   		set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports_so.txt")
+	endif()
 endif()
 
 add_library(iomp5 SHARED ${SOURCES} z_Linux_asm.o)
+
+# This is a workaround to a known ppc64 issue about libpthread. For more
+# information see
+# http://ryanarn.blogspot.com/2011/07/curious-case-of-pthreadatfork-on.html
+if("${ARCH}" STREQUAL "ppc64")
+	      find_library(PTHREAD NAMES pthread)
+	      target_link_libraries(iomp5 ${PTHREAD})
+endif()
+
 add_dependencies(iomp5 gen_kmp_i18n)

Modified: openmp/trunk/runtime/src/kmp.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp.h?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp.h (original)
+++ openmp/trunk/runtime/src/kmp.h Thu Aug  7 05:12:54 2014
@@ -459,9 +459,9 @@ typedef int PACKED_REDUCTION_METHOD_T;
 /*
  * Only Linux* OS and Windows* OS support thread affinity.
  */
-#if KMP_OS_LINUX || KMP_OS_WINDOWS
+#if (KMP_OS_LINUX || KMP_OS_WINDOWS) && !KMP_OS_CNK && !KMP_ARCH_PPC64
 # define KMP_AFFINITY_SUPPORTED 1
-#elif KMP_OS_DARWIN || KMP_OS_FREEBSD
+#elif KMP_OS_DARWIN || KMP_OS_FREEBSD || KMP_OS_CNK || KMP_ARCH_PPC64
 // affinity not supported
 # define KMP_AFFINITY_SUPPORTED 0
 #else
@@ -476,7 +476,7 @@ extern size_t __kmp_affin_mask_size;
 
 # if KMP_OS_LINUX
 //
-// On Linux* OS, the mask isactually a vector of length __kmp_affin_mask_size
+// On Linux* OS, the mask is actually a vector of length __kmp_affin_mask_size
 // (in bytes).  It should be allocated on a word boundary.
 //
 // WARNING!!!  We have made the base type of the affinity mask unsigned char,
@@ -946,6 +946,9 @@ extern unsigned int __kmp_place_core_off
 #if KMP_OS_WINDOWS
 #  define KMP_INIT_WAIT    64U          /* initial number of spin-tests   */
 #  define KMP_NEXT_WAIT    32U          /* susequent number of spin-tests */
+#elif KMP_OS_CNK
+#  define KMP_INIT_WAIT    16U          /* initial number of spin-tests   */
+#  define KMP_NEXT_WAIT     8U          /* susequent number of spin-tests */
 #elif KMP_OS_LINUX
 #  define KMP_INIT_WAIT  1024U          /* initial number of spin-tests   */
 #  define KMP_NEXT_WAIT   512U          /* susequent number of spin-tests */
@@ -971,6 +974,11 @@ extern void __kmp_x86_cpuid( int mode, i
   extern void __kmp_x86_pause( void );
 # endif
 # define KMP_CPU_PAUSE()        __kmp_x86_pause()
+#elif KMP_ARCH_PPC64
+# define KMP_PPC64_PRI_LOW() __asm__ volatile ("or 1, 1, 1")
+# define KMP_PPC64_PRI_MED() __asm__ volatile ("or 2, 2, 2")
+# define KMP_PPC64_PRI_LOC_MB() __asm__ volatile ("" : : : "memory")
+# define KMP_CPU_PAUSE() do { KMP_PPC64_PRI_LOW(); KMP_PPC64_PRI_MED(); KMP_PPC64_PRI_LOC_MB(); } while (0)
 #else
 # define KMP_CPU_PAUSE()        /* nothing to do */
 #endif

Modified: openmp/trunk/runtime/src/kmp_csupport.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_csupport.c?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_csupport.c (original)
+++ openmp/trunk/runtime/src/kmp_csupport.c Thu Aug  7 05:12:54 2014
@@ -837,6 +837,19 @@ __kmpc_flush(ident_t *loc, ...)
             #endif // KMP_MIC
         #elif KMP_ARCH_ARM
             // Nothing yet
+	     #elif KMP_ARCH_PPC64
+            // Nothing needed here (we have a real MB above).
+            #if KMP_OS_CNK
+	     	 // The flushing thread needs to yield here; this prevents a
+		    // busy-waiting thread from saturating the pipeline. flush is
+		       // often used in loops like this:
+                // while (!flag) {
+                //   #pragma omp flush(flag)
+                // }
+		    // and adding the yield here is good for at least a 10x speedup
+		       // when running >2 threads per core (on the NAS LU benchmark).
+                __kmp_yield(TRUE);
+            #endif
         #else
             #error Unknown or unsupported architecture
         #endif

Modified: openmp/trunk/runtime/src/kmp_ftn_os.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_ftn_os.h?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_ftn_os.h (original)
+++ openmp/trunk/runtime/src/kmp_ftn_os.h Thu Aug  7 05:12:54 2014
@@ -478,7 +478,7 @@
 //#define KMP_API_NAME_GOMP_TARGET_UPDATE                GOMP_target_update
 #define KMP_API_NAME_GOMP_TEAMS                          GOMP_teams
 
-#if KMP_OS_LINUX
+#if KMP_OS_LINUX && !KMP_OS_CNK && !KMP_ARCH_PPC64
     #define xstr(x) str(x) 
     #define str(x) #x
 

Modified: openmp/trunk/runtime/src/kmp_global.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_global.c?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_global.c (original)
+++ openmp/trunk/runtime/src/kmp_global.c Thu Aug  7 05:12:54 2014
@@ -321,7 +321,11 @@ int        __kmp_env_consistency_check
 kmp_uint32 __kmp_yield_init = KMP_INIT_WAIT;
 kmp_uint32 __kmp_yield_next = KMP_NEXT_WAIT;
 kmp_uint32 __kmp_yielding_on = 1;
+#if KMP_OS_CNK
+kmp_uint32 __kmp_yield_cycle = 0;
+#else
 kmp_uint32 __kmp_yield_cycle = 1;     /* Yield-cycle is on by default */
+#endif
 kmp_int32  __kmp_yield_on_count = 10; /* By default, yielding is on for 10 monitor periods. */
 kmp_int32  __kmp_yield_off_count = 1; /* By default, yielding is off for 1 monitor periods. */
 /* ----------------------------------------------------- */

Modified: openmp/trunk/runtime/src/kmp_gsupport.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_gsupport.c?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_gsupport.c (original)
+++ openmp/trunk/runtime/src/kmp_gsupport.c Thu Aug  7 05:12:54 2014
@@ -15,7 +15,7 @@
 //===----------------------------------------------------------------------===//
 
 
-#if defined(__x86_64)
+#if defined(__x86_64) || defined (__powerpc64__)
 # define KMP_I8
 #endif
 #include "kmp.h"

Modified: openmp/trunk/runtime/src/kmp_lock.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_lock.h?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_lock.h (original)
+++ openmp/trunk/runtime/src/kmp_lock.h Thu Aug  7 05:12:54 2014
@@ -518,7 +518,7 @@ __kmp_destroy_bootstrap_lock( kmp_bootst
 // Internal RTL locks are also implemented as ticket locks, for now.
 //
 // FIXME - We should go through and figure out which lock kind works best for
-// each internal lock, and use the type deeclaration and function calls for
+// each internal lock, and use the type declaration and function calls for
 // that explicit lock kind (and get rid of this section).
 //
 

Modified: openmp/trunk/runtime/src/kmp_os.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_os.h?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_os.h (original)
+++ openmp/trunk/runtime/src/kmp_os.h Thu Aug  7 05:12:54 2014
@@ -70,10 +70,12 @@
 #define KMP_OS_FREEBSD  0
 #define KMP_OS_DARWIN   0
 #define KMP_OS_WINDOWS    0
+#define KMP_OS_CNK      0
 #define KMP_OS_UNIX     0  /* disjunction of KMP_OS_LINUX, KMP_OS_DARWIN etc. */
 
 #define KMP_ARCH_X86        0
 #define KMP_ARCH_X86_64	    0
+#define KMP_ARCH_PPC64      0
 
 #ifdef _WIN32
 # undef KMP_OS_WINDOWS
@@ -85,9 +87,14 @@
 # define KMP_OS_DARWIN 1
 #endif
 
+// in some ppc64 linux installations, only the second condition is met
 #if ( defined __linux )
 # undef KMP_OS_LINUX
 # define KMP_OS_LINUX 1
+#elif ( defined __linux__)
+# undef KMP_OS_LINUX
+# define KMP_OS_LINUX 1
+#else
 #endif
 
 #if ( defined __FreeBSD__ )
@@ -95,6 +102,11 @@
 # define KMP_OS_FREEBSD 1
 #endif
 
+#if ( defined __bgq__ )
+# undef KMP_OS_CNK
+# define KMP_OS_CNK 1
+#endif
+
 #if (1 != KMP_OS_LINUX + KMP_OS_FREEBSD + KMP_OS_DARWIN + KMP_OS_WINDOWS)
 # error Unknown OS
 #endif
@@ -121,6 +133,9 @@
 # elif defined __i386
 #  undef KMP_ARCH_X86
 #  define KMP_ARCH_X86 1
+# elif defined __powerpc64__
+#  undef KMP_ARCH_PPC64
+#  define KMP_ARCH_PPC64 1
 # endif
 #endif
 
@@ -160,7 +175,7 @@
 # define KMP_ARCH_ARM 1
 #endif
 
-#if (1 != KMP_ARCH_X86 + KMP_ARCH_X86_64 + KMP_ARCH_ARM)
+#if (1 != KMP_ARCH_X86 + KMP_ARCH_X86_64 + KMP_ARCH_ARM + KMP_ARCH_PPC64)
 # error Unknown or unsupported architecture
 #endif
 
@@ -238,7 +253,7 @@
 
 #if KMP_ARCH_X86 || KMP_ARCH_ARM
 # define KMP_SIZE_T_SPEC KMP_UINT32_SPEC
-#elif KMP_ARCH_X86_64
+#elif KMP_ARCH_X86_64 || KMP_ARCH_PPC64
 # define KMP_SIZE_T_SPEC KMP_UINT64_SPEC
 #else
 # error "Can't determine size_t printf format specifier."
@@ -663,6 +678,10 @@ extern kmp_real64 __kmp_test_then_add_re
 # endif
 #endif /* KMP_OS_WINDOWS */
 
+#if KMP_ARCH_PPC64
+# define KMP_MB()       __sync_synchronize()
+#endif
+
 #ifndef KMP_MB
 # define KMP_MB()       /* nothing to do */
 #endif
@@ -769,7 +788,7 @@ typedef void    (*microtask_t)( int *gti
 #endif /* KMP_I8 */
 
 /* Workaround for Intel(R) 64 code gen bug when taking address of static array (Intel(R) 64 Tracker #138) */
-#if KMP_ARCH_X86_64 && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_PPC64) && KMP_OS_LINUX
 # define STATIC_EFI2_WORKAROUND
 #else
 # define STATIC_EFI2_WORKAROUND static

Modified: openmp/trunk/runtime/src/kmp_runtime.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_runtime.c?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_runtime.c (original)
+++ openmp/trunk/runtime/src/kmp_runtime.c Thu Aug  7 05:12:54 2014
@@ -8450,7 +8450,7 @@ __kmp_determine_reduction_method( ident_
         int atomic_available = FAST_REDUCTION_ATOMIC_METHOD_GENERATED;
         int tree_available   = FAST_REDUCTION_TREE_METHOD_GENERATED;
 
-        #if KMP_ARCH_X86_64
+        #if KMP_ARCH_X86_64 || KMP_ARCH_PPC64
 
             #if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN
                 #if KMP_MIC

Modified: openmp/trunk/runtime/src/kmp_settings.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_settings.c?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_settings.c (original)
+++ openmp/trunk/runtime/src/kmp_settings.c Thu Aug  7 05:12:54 2014
@@ -536,6 +536,7 @@ __kmp_stg_parse_file(
 
 static char * par_range_to_print = NULL;
 
+#ifdef KMP_DEBUG
 static void
 __kmp_stg_parse_par_range(
     char const * name,
@@ -614,7 +615,7 @@ __kmp_stg_parse_par_range(
         break;
     }
 } // __kmp_stg_parse_par_range
-
+#endif
 
 int
 __kmp_initial_threads_capacity( int req_nproc )

Modified: openmp/trunk/runtime/src/makefile.mk
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/makefile.mk?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/src/makefile.mk (original)
+++ openmp/trunk/runtime/src/makefile.mk Thu Aug  7 05:12:54 2014
@@ -313,6 +313,9 @@ endif
 ifeq "$(CPLUSPLUS)" "on"
     ifeq "$(os)" "win"
         c-flags   += -TP
+    else ifeq "$(arch)" "ppc64"
+    # c++0x on ppc64 linux removes definition of preproc. macros, needed in .hs
+      c-flags   += -x c++ -std=gnu++0x
     else
         ifneq "$(filter gcc clang,$(c))" ""
             c-flags   += -x c++ -std=c++0x
@@ -373,7 +376,7 @@ ifeq "$(os)" "lin"
             ld-flags-extra += -lirc_pic
             endif
         endif
-        ifeq "$(filter 32 32e 64,$(arch))" ""
+        ifeq "$(filter 32 32e 64 ppc64,$(arch))" ""
             ld-flags-extra += $(shell pkg-config --libs libffi)
         endif
     else
@@ -469,7 +472,14 @@ ifneq "$(os)" "win"
 endif
 cpp-flags += -D KMP_LIBRARY_FILE=\"$(lib_file)\"
 cpp-flags += -D KMP_VERSION_MAJOR=$(VERSION)
-cpp-flags += -D CACHE_LINE=64
+
+# customize ppc64 cache line size to 128, 64 otherwise
+ifeq "$(arch)" "ppc64"
+	cpp-flags += -D CACHE_LINE=128
+else 
+	cpp-flags += -D CACHE_LINE=64
+endif
+
 cpp-flags += -D KMP_ADJUST_BLOCKTIME=1
 cpp-flags += -D BUILD_PARALLEL_ORDERED
 cpp-flags += -D KMP_ASM_INTRINS
@@ -584,9 +594,12 @@ ifneq "$(os)" "win"
     ifeq "$(arch)" "arm"
         z_Linux_asm$(obj) : \
 		    cpp-flags += -D KMP_ARCH_ARM
-    else
+    else ifeq "$(arch)" "ppc64" 
         z_Linux_asm$(obj) : \
-            cpp-flags += -D KMP_ARCH_X86$(if $(filter 32e,$(arch)),_64)
+			cpp-flags += -D KMP_ARCH_PPC64		    
+    else
+    	z_Linux_asm$(obj) : \
+       		cpp-flags += -D KMP_ARCH_X86$(if $(filter 32e,$(arch)),_64)	
     endif
 endif
 
@@ -735,7 +748,9 @@ endif
         else # 5
             lib_c_items += kmp_gsupport
         endif
+#        ifneq "$(arch)" "ppc64"
         lib_asm_items += z_Linux_asm
+#	     endif
     endif
 endif
 
@@ -1397,9 +1412,13 @@ ifneq "$(filter %-dyna win-%,$(os)-$(LIN
             td_exp += libc.so.6
             td_exp += ld-linux-armhf.so.3
         endif
+        ifeq "$(arch)" "ppc64"
+            td_exp += libc.so.6
+            td_exp += ld64.so.1
+        endif
         td_exp += libdl.so.2
         td_exp += libgcc_s.so.1
-        ifeq "$(filter 32 32e 64,$(arch))" ""
+        ifeq "$(filter 32 32e 64 ppc64,$(arch))" ""
             td_exp += libffi.so.6
             td_exp += libffi.so.5
         endif

Modified: openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_config.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_config.h?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_config.h (original)
+++ openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_config.h Thu Aug  7 05:12:54 2014
@@ -132,6 +132,11 @@
 #  define ITT_ARCH_ARM  4
 #endif /* ITT_ARCH_ARM */
 
+#ifndef ITT_ARCH_PPC64
+#  define ITT_ARCH_PPC64  5
+#endif /* ITT_ARCH_PPC64 */
+
+
 #ifndef ITT_ARCH
 #  if defined _M_IX86 || defined __i386__
 #    define ITT_ARCH ITT_ARCH_IA32
@@ -141,6 +146,8 @@
 #    define ITT_ARCH ITT_ARCH_IA64
 #  elif defined _M_ARM || __arm__
 #    define ITT_ARCH ITT_ARCH_ARM
+#  elif defined __powerpc64__
+#    define ITT_ARCH ITT_ARCH_PPC64
 #  endif
 #endif
 
@@ -274,7 +281,7 @@ ITT_INLINE long __TBB_machine_fetchadd4(
                           : "memory");
     return result;
 }
-#elif ITT_ARCH==ITT_ARCH_ARM
+#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_PPC64
 #define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)
 #endif /* ITT_ARCH==ITT_ARCH_IA64 */
 #ifndef ITT_SIMPLE_INIT

Modified: openmp/trunk/runtime/src/z_Linux_asm.s
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/z_Linux_asm.s?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/src/z_Linux_asm.s (original)
+++ openmp/trunk/runtime/src/z_Linux_asm.s Thu Aug  7 05:12:54 2014
@@ -138,7 +138,7 @@ __kmp_unnamed_critical_addr:
 #endif /* KMP_GOMP_COMPAT */
 
 
-#if KMP_ARCH_X86
+#if KMP_ARCH_X86 && !KMP_ARCH_PPC64
 
 // -----------------------------------------------------------------------
 // microtasking routines specifically written for IA-32 architecture
@@ -1585,6 +1585,16 @@ __kmp_unnamed_critical_addr:
     .size __kmp_unnamed_critical_addr,4
 #endif /* KMP_ARCH_ARM */
 
+#if KMP_ARCH_PPC64
+    .data
+    .comm .gomp_critical_user_,32,8
+    .data
+    .align 8
+    .global __kmp_unnamed_critical_addr
+__kmp_unnamed_critical_addr:
+    .8byte .gomp_critical_user_
+    .size __kmp_unnamed_critical_addr,8
+#endif /* KMP_ARCH_PPC64 */
 
 #if defined(__linux__)
 .section .note.GNU-stack,"", at progbits

Modified: openmp/trunk/runtime/src/z_Linux_util.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/z_Linux_util.c?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/src/z_Linux_util.c (original)
+++ openmp/trunk/runtime/src/z_Linux_util.c Thu Aug  7 05:12:54 2014
@@ -32,7 +32,7 @@
 #include <sys/resource.h>
 #include <sys/syscall.h>
 
-#if KMP_OS_LINUX
+#if KMP_OS_LINUX && !KMP_OS_CNK
 # include <sys/sysinfo.h>
 # if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM)
 // We should really include <futex.h>, but that causes compatibility problems on different
@@ -61,7 +61,7 @@
 #include <fcntl.h>
 
 // For non-x86 architecture
-#if KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64)
+#if KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_PPC64)
 # include <stdbool.h>
 # include <ffi.h>
 #endif
@@ -110,7 +110,7 @@ __kmp_print_cond( char *buffer, kmp_cond
 /* ------------------------------------------------------------------------ */
 /* ------------------------------------------------------------------------ */
 
-#if KMP_OS_LINUX && KMP_AFFINITY_SUPPORTED
+#if ( KMP_OS_LINUX && KMP_AFFINITY_SUPPORTED)
 
 /*
  * Affinity support
@@ -147,6 +147,19 @@ __kmp_print_cond( char *buffer, kmp_cond
 #    error Wrong code for getaffinity system call.
 #   endif /* __NR_sched_getaffinity */
 
+#  elif KMP_ARCH_PPC64
+#   ifndef __NR_sched_setaffinity
+#    define __NR_sched_setaffinity  222
+#   elif __NR_sched_setaffinity != 222
+#    error Wrong code for setaffinity system call.
+#   endif /* __NR_sched_setaffinity */
+#   ifndef __NR_sched_getaffinity
+#    define __NR_sched_getaffinity  223
+#   elif __NR_sched_getaffinity != 223
+#    error Wrong code for getaffinity system call.
+#   endif /* __NR_sched_getaffinity */
+
+
 #  else
 #   error Unknown or unsupported architecture
 
@@ -445,7 +458,7 @@ __kmp_change_thread_affinity_mask( int g
 /* ------------------------------------------------------------------------ */
 /* ------------------------------------------------------------------------ */
 
-#if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM)
+#if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM) && !KMP_OS_CNK
 
 int
 __kmp_futex_determine_capable()
@@ -462,7 +475,7 @@ __kmp_futex_determine_capable()
     return retval;
 }
 
-#endif // KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM)
+#endif // KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM) && !KMP_OS_CNK
 
 /* ------------------------------------------------------------------------ */
 /* ------------------------------------------------------------------------ */
@@ -481,7 +494,7 @@ __kmp_test_then_or32( volatile kmp_int32
     old_value = TCR_4( *p );
     new_value = old_value | d;
 
-    while ( ! __kmp_compare_and_store32 ( p, old_value, new_value ) )
+    while ( ! KMP_COMPARE_AND_STORE_REL32 ( p, old_value, new_value ) )
     {
         KMP_CPU_PAUSE();
         old_value = TCR_4( *p );
@@ -498,7 +511,7 @@ __kmp_test_then_and32( volatile kmp_int3
     old_value = TCR_4( *p );
     new_value = old_value & d;
 
-    while ( ! __kmp_compare_and_store32 ( p, old_value, new_value ) )
+    while ( ! KMP_COMPARE_AND_STORE_REL32 ( p, old_value, new_value ) )
     {
         KMP_CPU_PAUSE();
         old_value = TCR_4( *p );
@@ -507,7 +520,7 @@ __kmp_test_then_and32( volatile kmp_int3
     return old_value;
 }
 
-# if KMP_ARCH_X86
+# if KMP_ARCH_X86 || KMP_ARCH_PPC64
 kmp_int64
 __kmp_test_then_add64( volatile kmp_int64 *p, kmp_int64 d )
 {
@@ -516,7 +529,7 @@ __kmp_test_then_add64( volatile kmp_int6
     old_value = TCR_8( *p );
     new_value = old_value + d;
 
-    while ( ! __kmp_compare_and_store64 ( p, old_value, new_value ) )
+    while ( ! KMP_COMPARE_AND_STORE_REL64 ( p, old_value, new_value ) )
     {
         KMP_CPU_PAUSE();
         old_value = TCR_8( *p );
@@ -533,7 +546,7 @@ __kmp_test_then_or64( volatile kmp_int64
 
     old_value = TCR_8( *p );
     new_value = old_value | d;
-    while ( ! __kmp_compare_and_store64 ( p, old_value, new_value ) )
+    while ( ! KMP_COMPARE_AND_STORE_REL64 ( p, old_value, new_value ) )
     {
         KMP_CPU_PAUSE();
         old_value = TCR_8( *p );
@@ -549,7 +562,7 @@ __kmp_test_then_and64( volatile kmp_int6
 
     old_value = TCR_8( *p );
     new_value = old_value & d;
-    while ( ! __kmp_compare_and_store64 ( p, old_value, new_value ) )
+    while ( ! KMP_COMPARE_AND_STORE_REL64 ( p, old_value, new_value ) )
     {
         KMP_CPU_PAUSE();
         old_value = TCR_8( *p );
@@ -2527,7 +2540,7 @@ __kmp_get_load_balance( int max )
 #endif // USE_LOAD_BALANCE
 
 
-#if KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64)
+#if KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_PPC64)
 
 int __kmp_invoke_microtask( microtask_t pkfn, int gtid, int tid, int argc,
         void *p_argv[] )
@@ -2561,7 +2574,89 @@ int __kmp_invoke_microtask( microtask_t
     return 1;
 }
 
-#endif // KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64)
+#endif // KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_PPC64)
+
+#if KMP_ARCH_PPC64
+
+// we really only need the case with 1 argument, because CLANG always build
+// a struct of pointers to shared variables referenced in the outlined function
+int
+__kmp_invoke_microtask( microtask_t pkfn,
+                        int gtid, int tid,
+                        int argc, void *p_argv[] ) {
+  switch (argc) {
+  default:
+    fprintf(stderr, "Too many args to microtask: %d!\n", argc);
+    fflush(stderr);
+    exit(-1);
+  case 0:
+    (*pkfn)(&gtid, &tid);
+    break;
+  case 1:
+    (*pkfn)(&gtid, &tid, p_argv[0]);
+    break;
+  case 2:
+    (*pkfn)(&gtid, &tid, p_argv[0], p_argv[1]);
+    break;
+  case 3:
+    (*pkfn)(&gtid, &tid, p_argv[0], p_argv[1], p_argv[2]);
+    break;
+  case 4:
+    (*pkfn)(&gtid, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3]);
+    break;
+  case 5:
+    (*pkfn)(&gtid, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4]);
+    break;
+  case 6:
+    (*pkfn)(&gtid, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],
+            p_argv[5]);
+    break;
+  case 7:
+    (*pkfn)(&gtid, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],
+            p_argv[5], p_argv[6]);
+    break;
+  case 8:
+    (*pkfn)(&gtid, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],
+            p_argv[5], p_argv[6], p_argv[7]);
+    break;
+  case 9:
+    (*pkfn)(&gtid, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],
+            p_argv[5], p_argv[6], p_argv[7], p_argv[8]);
+    break;
+  case 10:
+    (*pkfn)(&gtid, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],
+            p_argv[5], p_argv[6], p_argv[7], p_argv[8], p_argv[9]);
+    break;
+  case 11:
+    (*pkfn)(&gtid, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],
+            p_argv[5], p_argv[6], p_argv[7], p_argv[8], p_argv[9], p_argv[10]);
+    break;
+  case 12:
+    (*pkfn)(&gtid, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],
+            p_argv[5], p_argv[6], p_argv[7], p_argv[8], p_argv[9], p_argv[10],
+            p_argv[11]);
+    break;
+  case 13:
+    (*pkfn)(&gtid, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],
+            p_argv[5], p_argv[6], p_argv[7], p_argv[8], p_argv[9], p_argv[10],
+            p_argv[11], p_argv[12]);
+    break;
+  case 14:
+    (*pkfn)(&gtid, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],
+            p_argv[5], p_argv[6], p_argv[7], p_argv[8], p_argv[9], p_argv[10],
+            p_argv[11], p_argv[12], p_argv[13]);
+    break;
+  case 15:
+    (*pkfn)(&gtid, &tid, p_argv[0], p_argv[1], p_argv[2], p_argv[3], p_argv[4],
+            p_argv[5], p_argv[6], p_argv[7], p_argv[8], p_argv[9], p_argv[10],
+            p_argv[11], p_argv[12], p_argv[13], p_argv[14]);
+    break;
+  }
+
+  return 1;
+}
+
+#endif
 
 // end of file //
 

Modified: openmp/trunk/runtime/tools/lib/Platform.pm
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/tools/lib/Platform.pm?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/tools/lib/Platform.pm (original)
+++ openmp/trunk/runtime/tools/lib/Platform.pm Thu Aug  7 05:12:54 2014
@@ -50,6 +50,8 @@ sub canon_arch($) {
             $arch = "32e";
         } elsif ( $arch =~ m{\Aarm(?:v7\D*)?\z} ) {
             $arch = "arm";
+        } elsif ( $arch =~ m{\Appc64} ) {
+        	$arch = "ppc64";            
         } else {
             $arch = undef;
         }; # if
@@ -159,6 +161,8 @@ sub target_options() {
         $_host_arch = "32e";
     } elsif ( $hardware_platform eq "arm" ) {
         $_host_arch = "arm";
+    } elsif ( $hardware_platform eq "ppc64" ) {
+        $_host_arch = "ppc64";
     } else {
         die "Unsupported host hardware platform: \"$hardware_platform\"; stopped";
     }; # if

Modified: openmp/trunk/runtime/tools/lib/Uname.pm
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/tools/lib/Uname.pm?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/tools/lib/Uname.pm (original)
+++ openmp/trunk/runtime/tools/lib/Uname.pm Thu Aug  7 05:12:54 2014
@@ -147,6 +147,8 @@ if ( 0 ) {
         $values{ hardware_platform } = "x86_64";
     } elsif ( $values{ machine } =~ m{\Aarmv7\D*\z} ) {
         $values{ hardware_platform } = "arm";
+    } elsif ( $values{ machine } =~ m{\Appc64\z} ) {
+        $values{ hardware_platform } = "ppc64";
     } else {
         die "Unsupported machine (\"$values{ machine }\") returned by POSIX::uname(); stopped";
     }; # if

Modified: openmp/trunk/runtime/tools/src/common-defs.mk
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/tools/src/common-defs.mk?rev=215093&r1=215092&r2=215093&view=diff
==============================================================================
--- openmp/trunk/runtime/tools/src/common-defs.mk (original)
+++ openmp/trunk/runtime/tools/src/common-defs.mk Thu Aug  7 05:12:54 2014
@@ -45,7 +45,7 @@ endif
 # Description:
 #     The function return printable name of specified architecture, IA-32 architecture or Intel(R) 64.
 #
-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))))))
+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)))))))
 
 # Synopsis:
 #     var_name = $(call check_variable,var,list)
@@ -128,9 +128,9 @@ endif
 # --------------------------------------------------------------------------------------------------
 
 os       := $(call check_variable,os,lin lrb mac win)
-arch     := $(call check_variable,arch,32 32e 64 arm)
+arch     := $(call check_variable,arch,32 32e 64 arm ppc64)
 platform := $(os)_$(arch)
-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)
+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)
 # oa-opts means "os and arch options". They are passed to almost all perl scripts.
 oa-opts  := --os=$(os) --arch=$(arch)
 





More information about the Openmp-commits mailing list