[Openmp-commits] [openmp] r225792 - aarch64 port sent by C. Bergstrom
Andrey Churbanov
Andrey.Churbanov at intel.com
Tue Jan 13 06:43:35 PST 2015
Author: achurbanov
Date: Tue Jan 13 08:43:35 2015
New Revision: 225792
URL: http://llvm.org/viewvc/llvm-project?rev=225792&view=rev
Log:
aarch64 port sent by C. Bergstrom
Modified:
openmp/trunk/runtime/Build_With_CMake.txt
openmp/trunk/runtime/CMakeLists.txt
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_gsupport.c
openmp/trunk/runtime/src/kmp_lock.cpp
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/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/runtime/Build_With_CMake.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/Build_With_CMake.txt?rev=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/Build_With_CMake.txt (original)
+++ openmp/trunk/runtime/Build_With_CMake.txt Tue Jan 13 08:43:35 2015
@@ -112,9 +112,9 @@ Build options
======================
==== Architecture ====
======================
--Darch=32|32e|arm|ppc64
+-Darch=32|32e|arm|ppc64|aarch64
* Architecture can be 32 (IA-32 architecture), 32e (Intel(R) 64 architecture),
- arm (ARM architecture), or ppc64 (PPC64 architecture).
+ arm (ARM architecture), aarch64 (ARMv8 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
Modified: openmp/trunk/runtime/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/CMakeLists.txt?rev=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/CMakeLists.txt (original)
+++ openmp/trunk/runtime/CMakeLists.txt Tue Jan 13 08:43:35 2015
@@ -50,7 +50,7 @@ include(GetArchitecture) # get_architect
# Build Configuration
set(os_possible_values lin mac win mic)
-set(arch_possible_values 32e 32 arm ppc64)
+set(arch_possible_values 32e 32 arm ppc64 aarch64)
set(build_type_possible_values release debug relwithdebinfo)
set(omp_version_possible_values 40 30)
set(lib_type_possible_values normal profile stubs)
@@ -170,6 +170,7 @@ endif()
set(IA32 FALSE)
set(INTEL64 FALSE)
set(ARM FALSE)
+set(AARCH64 FALSE)
set(PPC64 FALSE)
if("${arch}" STREQUAL "32") # IA-32 architecture
set(IA32 TRUE)
@@ -177,6 +178,8 @@ elseif("${arch}" STREQUAL "32e") # Intel
set(INTEL64 TRUE)
elseif("${arch}" STREQUAL "arm") # ARM architecture
set(ARM TRUE)
+elseif("${arch}" STREQUAL "aarch64") # AARCH64 architecture
+ set(AARCH64 TRUE)
elseif("${arch}" STREQUAL "ppc64") # PPC64 architecture
set(PPC64 TRUE)
endif()
@@ -644,6 +647,8 @@ set_source_files_properties(${src_dir}/k
# z_Linux_asm.o : -D KMP_ARCH_*
if(${ARM})
set_source_files_properties(${src_dir}/z_Linux_asm.s PROPERTIES COMPILE_DEFINITIONS "KMP_ARCH_ARM")
+elseif(${AARCH64})
+ set_source_files_properties(${src_dir}/z_Linux_asm.s PROPERTIES COMPILE_DEFINITIONS "KMP_ARCH_AARCH64")
elseif(${INTEL64})
set_source_files_properties(${src_dir}/z_Linux_asm.s PROPERTIES COMPILE_DEFINITIONS "KMP_ARCH_X86_64")
elseif(${IA32})
Modified: openmp/trunk/runtime/cmake/HelperFunctions.cmake
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/cmake/HelperFunctions.cmake?rev=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/cmake/HelperFunctions.cmake (original)
+++ openmp/trunk/runtime/cmake/HelperFunctions.cmake Tue Jan 13 08:43:35 2015
@@ -67,8 +67,10 @@ 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)
+ elseif(${PPC64})
+ set(${return_arch_string} "PPC64" PARENT_SCOPE)
+ elseif(${AARCH64})
+ set(${return_arch_string} "AARCH64" 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=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/src/CMakeLists.txt (original)
+++ openmp/trunk/runtime/src/CMakeLists.txt Tue Jan 13 08:43:35 2015
@@ -24,14 +24,16 @@ endif()
if(arch)
set(ARCH ${arch}) #acquire from command line
-else() #assume default
- set(ARCH "32e")
+else() # Ensure ARCH is set
+ message(FATAL_ERROR "ARCH not set. Possible values are 32e 32 arm ppc64 aarch64. Example -DARCH=e32 for x86-64/Intel64")
endif()
if("${arch}" STREQUAL "32e")
set(ARCH_STR "Intel(R) 64")
elseif("${arch}" STREQUAL "ppc64")
set(ARCH_STR "PPC64")
+elseif("${arch}" STREQUAL "aarch64")
+ set(ARCH_STR "AARCH64")
endif()
set(FEATURE_FLAGS "-D USE_ITT_BUILD")
@@ -67,7 +69,7 @@ set(FEATURE_FLAGS "${FEATURE_FLAGS} -D G
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_GOMP_COMPAT")
#adaptive locks use x86 assembly - disable for ppc64
-if("${arch}" STREQUAL "32e" OR "${arch}" STREQUAL "32" OR "${arch}" STREQUAL "arm")
+if("${arch}" STREQUAL "32e" OR "${arch}" STREQUAL "32")
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_USE_ADAPTIVE_LOCKS=1")
set(FEATURE_FLAGS "${FEATURE_FLAGS} -D KMP_DEBUG_ADAPTIVE_LOCKS=0")
endif()
@@ -144,17 +146,19 @@ add_custom_command(
)
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}
- )
+ set(KMP_ARCH_TEMP "KMP_ARCH_PPC64")
+elseif("${ARCH}" STREQUAL "arm")
+ set(KMP_ARCH_TEMP "KMP_ARCH_ARM")
+elseif("${ARCH}" STREQUAL "aarch64")
+ set(KMP_ARCH_TEMP "KMP_ARCH_AARCH64")
+else
+ set(KMP_ARCH_TEMP "KMP_ARCH_X86_64")
endif()
+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_TEMP} -x assembler-with-cpp ${CMAKE_CURRENT_SOURCE_DIR}/${ASM_SOURCES}
+)
add_custom_target(gen_kmp_i18n DEPENDS kmp_i18n_id.inc kmp_i18n_default.inc omp.h z_Linux_asm.o)
Modified: openmp/trunk/runtime/src/kmp.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp.h?rev=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp.h (original)
+++ openmp/trunk/runtime/src/kmp.h Tue Jan 13 08:43:35 2015
@@ -766,6 +766,8 @@ typedef struct kmp_nested_proc_bind_t {
extern kmp_nested_proc_bind_t __kmp_nested_proc_bind;
+#endif /* OMP_40_ENABLED */
+
# if KMP_AFFINITY_SUPPORTED
# define KMP_PLACE_ALL (-1)
# define KMP_PLACE_UNDEFINED (-2)
@@ -773,7 +775,6 @@ extern kmp_nested_proc_bind_t __kmp_nest
extern int __kmp_affinity_num_places;
-#endif /* OMP_40_ENABLED */
#if OMP_40_ENABLED
typedef enum kmp_cancel_kind_t {
@@ -2940,11 +2941,11 @@ extern void __kmp_balanced_affinity( int
extern void __kmp_get_hierarchy(kmp_uint32 nproc, kmp_bstate_t *thr_bar);
-#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_ARCH_AARCH64)
extern int __kmp_futex_determine_capable( void );
-#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_ARCH_AARCH64)
extern void __kmp_gtid_set_specific( int gtid );
extern int __kmp_gtid_get_specific( void );
@@ -3039,7 +3040,7 @@ enum fork_context_e
extern int __kmp_fork_call( ident_t *loc, int gtid, enum fork_context_e fork_context,
kmp_int32 argc, microtask_t microtask, launch_t invoker,
/* TODO: revert workaround for Intel(R) 64 tracker #96 */
-#if (KMP_ARCH_ARM || KMP_ARCH_X86_64) && KMP_OS_LINUX
+#if (KMP_ARCH_ARM || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && KMP_OS_LINUX
va_list *ap
#else
va_list ap
Modified: openmp/trunk/runtime/src/kmp_csupport.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_csupport.c?rev=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_csupport.c (original)
+++ openmp/trunk/runtime/src/kmp_csupport.c Tue Jan 13 08:43:35 2015
@@ -293,7 +293,7 @@ __kmpc_fork_call(ident_t *loc, kmp_int32
VOLATILE_CAST(microtask_t) microtask,
VOLATILE_CAST(launch_t) __kmp_invoke_task_func,
/* TODO: revert workaround for Intel(R) 64 tracker #96 */
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM) && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
&ap
#else
ap
@@ -362,7 +362,7 @@ __kmpc_fork_teams(ident_t *loc, kmp_int3
argc,
VOLATILE_CAST(microtask_t) __kmp_teams_master,
VOLATILE_CAST(launch_t) __kmp_invoke_teams_master,
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM) && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
&ap
#else
ap
@@ -590,8 +590,8 @@ __kmpc_flush(ident_t *loc, ...)
#endif // KMP_COMPILER_ICC
}; // if
#endif // KMP_MIC
- #elif KMP_ARCH_ARM
- // Nothing yet
+ #elif (KMP_ARCH_ARM || KMP_ARCH_AARCH64)
+ // Nothing to see here move along
#elif KMP_ARCH_PPC64
// Nothing needed here (we have a real MB above).
#if KMP_OS_CNK
@@ -848,7 +848,7 @@ __kmpc_critical( ident_t * loc, kmp_int3
&& ( sizeof( lck->tas.lk.poll ) <= OMP_CRITICAL_SIZE ) ) {
lck = (kmp_user_lock_p)crit;
}
-#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_ARCH_AARCH64)
else if ( ( __kmp_user_lock_kind == lk_futex )
&& ( sizeof( lck->futex.lk.poll ) <= OMP_CRITICAL_SIZE ) ) {
lck = (kmp_user_lock_p)crit;
@@ -901,7 +901,7 @@ __kmpc_end_critical(ident_t *loc, kmp_in
&& ( sizeof( lck->tas.lk.poll ) <= OMP_CRITICAL_SIZE ) ) {
lck = (kmp_user_lock_p)crit;
}
-#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_ARCH_AARCH64)
else if ( ( __kmp_user_lock_kind == lk_futex )
&& ( sizeof( lck->futex.lk.poll ) <= OMP_CRITICAL_SIZE ) ) {
lck = (kmp_user_lock_p)crit;
@@ -1342,7 +1342,7 @@ __kmpc_init_lock( ident_t * loc, kmp_int
&& ( sizeof( lck->tas.lk.poll ) <= OMP_LOCK_T_SIZE ) ) {
lck = (kmp_user_lock_p)user_lock;
}
-#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_ARCH_AARCH64)
else if ( ( __kmp_user_lock_kind == lk_futex )
&& ( sizeof( lck->futex.lk.poll ) <= OMP_LOCK_T_SIZE ) ) {
lck = (kmp_user_lock_p)user_lock;
@@ -1378,7 +1378,7 @@ __kmpc_init_nest_lock( ident_t * loc, km
+ sizeof( lck->tas.lk.depth_locked ) <= OMP_NEST_LOCK_T_SIZE ) ) {
lck = (kmp_user_lock_p)user_lock;
}
-#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_ARCH_AARCH64)
else if ( ( __kmp_user_lock_kind == lk_futex )
&& ( sizeof( lck->futex.lk.poll ) + sizeof( lck->futex.lk.depth_locked )
<= OMP_NEST_LOCK_T_SIZE ) ) {
@@ -1406,7 +1406,7 @@ __kmpc_destroy_lock( ident_t * loc, kmp_
&& ( sizeof( lck->tas.lk.poll ) <= OMP_LOCK_T_SIZE ) ) {
lck = (kmp_user_lock_p)user_lock;
}
-#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_ARCH_AARCH64)
else if ( ( __kmp_user_lock_kind == lk_futex )
&& ( sizeof( lck->futex.lk.poll ) <= OMP_LOCK_T_SIZE ) ) {
lck = (kmp_user_lock_p)user_lock;
@@ -1425,7 +1425,7 @@ __kmpc_destroy_lock( ident_t * loc, kmp_
&& ( sizeof( lck->tas.lk.poll ) <= OMP_LOCK_T_SIZE ) ) {
;
}
-#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_ARCH_AARCH64)
else if ( ( __kmp_user_lock_kind == lk_futex )
&& ( sizeof( lck->futex.lk.poll ) <= OMP_LOCK_T_SIZE ) ) {
;
@@ -1446,7 +1446,7 @@ __kmpc_destroy_nest_lock( ident_t * loc,
+ sizeof( lck->tas.lk.depth_locked ) <= OMP_NEST_LOCK_T_SIZE ) ) {
lck = (kmp_user_lock_p)user_lock;
}
-#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_ARCH_AARCH64)
else if ( ( __kmp_user_lock_kind == lk_futex )
&& ( sizeof( lck->futex.lk.poll ) + sizeof( lck->futex.lk.depth_locked )
<= OMP_NEST_LOCK_T_SIZE ) ) {
@@ -1467,7 +1467,7 @@ __kmpc_destroy_nest_lock( ident_t * loc,
+ sizeof( lck->tas.lk.depth_locked ) <= OMP_NEST_LOCK_T_SIZE ) ) {
;
}
-#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_ARCH_AARCH64)
else if ( ( __kmp_user_lock_kind == lk_futex )
&& ( sizeof( lck->futex.lk.poll ) + sizeof( lck->futex.lk.depth_locked )
<= OMP_NEST_LOCK_T_SIZE ) ) {
@@ -1488,7 +1488,7 @@ __kmpc_set_lock( ident_t * loc, kmp_int3
&& ( sizeof( lck->tas.lk.poll ) <= OMP_LOCK_T_SIZE ) ) {
lck = (kmp_user_lock_p)user_lock;
}
-#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_ARCH_AARCH64)
else if ( ( __kmp_user_lock_kind == lk_futex )
&& ( sizeof( lck->futex.lk.poll ) <= OMP_LOCK_T_SIZE ) ) {
lck = (kmp_user_lock_p)user_lock;
@@ -1518,7 +1518,7 @@ __kmpc_set_nest_lock( ident_t * loc, kmp
+ sizeof( lck->tas.lk.depth_locked ) <= OMP_NEST_LOCK_T_SIZE ) ) {
lck = (kmp_user_lock_p)user_lock;
}
-#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_ARCH_AARCH64)
else if ( ( __kmp_user_lock_kind == lk_futex )
&& ( sizeof( lck->futex.lk.poll ) + sizeof( lck->futex.lk.depth_locked )
<= OMP_NEST_LOCK_T_SIZE ) ) {
@@ -1550,7 +1550,7 @@ __kmpc_unset_lock( ident_t *loc, kmp_int
if ( ( __kmp_user_lock_kind == lk_tas )
&& ( sizeof( lck->tas.lk.poll ) <= OMP_LOCK_T_SIZE ) ) {
-#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_ARCH_AARCH64)
// "fast" path implemented to fix customer performance issue
#if USE_ITT_BUILD
__kmp_itt_lock_releasing( (kmp_user_lock_p)user_lock );
@@ -1562,7 +1562,7 @@ __kmpc_unset_lock( ident_t *loc, kmp_int
lck = (kmp_user_lock_p)user_lock;
#endif
}
-#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_ARCH_AARCH64)
else if ( ( __kmp_user_lock_kind == lk_futex )
&& ( sizeof( lck->futex.lk.poll ) <= OMP_LOCK_T_SIZE ) ) {
lck = (kmp_user_lock_p)user_lock;
@@ -1589,7 +1589,7 @@ __kmpc_unset_nest_lock( ident_t *loc, km
if ( ( __kmp_user_lock_kind == lk_tas ) && ( sizeof( lck->tas.lk.poll )
+ sizeof( lck->tas.lk.depth_locked ) <= OMP_NEST_LOCK_T_SIZE ) ) {
-#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_ARCH_AARCH64)
// "fast" path implemented to fix customer performance issue
kmp_tas_lock_t *tl = (kmp_tas_lock_t*)user_lock;
#if USE_ITT_BUILD
@@ -1604,7 +1604,7 @@ __kmpc_unset_nest_lock( ident_t *loc, km
lck = (kmp_user_lock_p)user_lock;
#endif
}
-#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_ARCH_AARCH64)
else if ( ( __kmp_user_lock_kind == lk_futex )
&& ( sizeof( lck->futex.lk.poll ) + sizeof( lck->futex.lk.depth_locked )
<= OMP_NEST_LOCK_T_SIZE ) ) {
@@ -1635,7 +1635,7 @@ __kmpc_test_lock( ident_t *loc, kmp_int3
&& ( sizeof( lck->tas.lk.poll ) <= OMP_LOCK_T_SIZE ) ) {
lck = (kmp_user_lock_p)user_lock;
}
-#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_ARCH_AARCH64)
else if ( ( __kmp_user_lock_kind == lk_futex )
&& ( sizeof( lck->futex.lk.poll ) <= OMP_LOCK_T_SIZE ) ) {
lck = (kmp_user_lock_p)user_lock;
@@ -1673,7 +1673,7 @@ __kmpc_test_nest_lock( ident_t *loc, kmp
+ sizeof( lck->tas.lk.depth_locked ) <= OMP_NEST_LOCK_T_SIZE ) ) {
lck = (kmp_user_lock_p)user_lock;
}
-#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_ARCH_AARCH64)
else if ( ( __kmp_user_lock_kind == lk_futex )
&& ( sizeof( lck->futex.lk.poll ) + sizeof( lck->futex.lk.depth_locked )
<= OMP_NEST_LOCK_T_SIZE ) ) {
Modified: openmp/trunk/runtime/src/kmp_gsupport.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_gsupport.c?rev=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_gsupport.c (original)
+++ openmp/trunk/runtime/src/kmp_gsupport.c Tue Jan 13 08:43:35 2015
@@ -15,7 +15,7 @@
//===----------------------------------------------------------------------===//
-#if defined(__x86_64) || defined (__powerpc64__)
+#if defined(__x86_64) || defined (__powerpc64__) || defined(__aarch64__)
# define KMP_I8
#endif
#include "kmp.h"
@@ -40,7 +40,6 @@ xexpand(KMP_API_NAME_GOMP_BARRIER)(void)
}
-/**/
//
// Mutual exclusion
//
@@ -216,7 +215,6 @@ xexpand(KMP_API_NAME_GOMP_ORDERED_END)(v
}
-/**/
//
// Dispatch macro defs
//
@@ -239,7 +237,6 @@ xexpand(KMP_API_NAME_GOMP_ORDERED_END)(v
# define KMP_DISPATCH_NEXT_ULL __kmpc_dispatch_next_8u
-/**/
//
// The parallel contruct
//
@@ -288,7 +285,7 @@ __kmp_GOMP_fork_call(ident_t *loc, int g
va_start(ap, argc);
rc = __kmp_fork_call(loc, gtid, fork_context_gnu, argc, wrapper, __kmp_invoke_task_func,
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM) && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
&ap
#else
ap
@@ -344,7 +341,6 @@ xexpand(KMP_API_NAME_GOMP_PARALLEL_END)(
}
-/**/
//
// Loop worksharing constructs
//
@@ -500,7 +496,6 @@ xexpand(KMP_API_NAME_GOMP_LOOP_END_NOWAI
}
-/**/
//
// Unsigned long long loop worksharing constructs
//
@@ -622,7 +617,6 @@ LOOP_NEXT_ULL(xexpand(KMP_API_NAME_GOMP_
{ KMP_DISPATCH_FINI_CHUNK_ULL(&loc, gtid); })
-/**/
//
// Combined parallel / loop worksharing constructs
//
@@ -666,7 +660,6 @@ PARALLEL_LOOP_START(xexpand(KMP_API_NAME
PARALLEL_LOOP_START(xexpand(KMP_API_NAME_GOMP_PARALLEL_LOOP_RUNTIME_START), kmp_sch_runtime)
-/**/
//
// Tasking constructs
//
@@ -739,7 +732,6 @@ xexpand(KMP_API_NAME_GOMP_TASKWAIT)(void
}
-/**/
//
// Sections worksharing constructs
//
Modified: openmp/trunk/runtime/src/kmp_lock.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_lock.cpp?rev=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_lock.cpp (original)
+++ openmp/trunk/runtime/src/kmp_lock.cpp Tue Jan 13 08:43:35 2015
@@ -23,7 +23,7 @@
#include "kmp_lock.h"
#include "kmp_io.h"
-#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_ARCH_AARCH64)
# include <unistd.h>
# include <sys/syscall.h>
// We should really include <futex.h>, but that causes compatibility problems on different
@@ -359,7 +359,7 @@ __kmp_destroy_nested_tas_lock_with_check
}
-#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_ARCH_AARCH64)
/* ------------------------------------------------------------------------ */
/* futex locks */
Modified: openmp/trunk/runtime/src/kmp_lock.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_lock.h?rev=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_lock.h (original)
+++ openmp/trunk/runtime/src/kmp_lock.h Tue Jan 13 08:43:35 2015
@@ -174,7 +174,7 @@ extern void __kmp_init_nested_tas_lock(
extern void __kmp_destroy_nested_tas_lock( kmp_tas_lock_t *lck );
-#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_ARCH_AARCH64)
// ----------------------------------------------------------------------------
// futex locks. futex locks are only available on Linux* OS.
@@ -224,7 +224,7 @@ extern void __kmp_release_nested_futex_l
extern void __kmp_init_nested_futex_lock( kmp_futex_lock_t *lck );
extern void __kmp_destroy_nested_futex_lock( kmp_futex_lock_t *lck );
-#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_ARCH_AARCH64)
// ----------------------------------------------------------------------------
@@ -590,7 +590,7 @@ __kmp_destroy_lock( kmp_lock_t *lck )
enum kmp_lock_kind {
lk_default = 0,
lk_tas,
-#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_ARCH_AARCH64)
lk_futex,
#endif
lk_ticket,
@@ -607,7 +607,7 @@ extern kmp_lock_kind_t __kmp_user_lock_k
union kmp_user_lock {
kmp_tas_lock_t tas;
-#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_ARCH_AARCH64)
kmp_futex_lock_t futex;
#endif
kmp_ticket_lock_t ticket;
@@ -635,7 +635,7 @@ __kmp_get_user_lock_owner( kmp_user_lock
extern void ( *__kmp_acquire_user_lock_with_checks_ )( kmp_user_lock_p lck, kmp_int32 gtid );
-#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_ARCH_AARCH64)
#define __kmp_acquire_user_lock_with_checks(lck,gtid) \
if (__kmp_user_lock_kind == lk_tas) { \
@@ -685,7 +685,7 @@ __kmp_acquire_user_lock_with_checks( kmp
extern int ( *__kmp_test_user_lock_with_checks_ )( kmp_user_lock_p lck, kmp_int32 gtid );
-#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_ARCH_AARCH64)
#include "kmp_i18n.h" /* AC: KMP_FATAL definition */
extern int __kmp_env_consistency_check; /* AC: copy from kmp.h here */
Modified: openmp/trunk/runtime/src/kmp_os.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_os.h?rev=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_os.h (original)
+++ openmp/trunk/runtime/src/kmp_os.h Tue Jan 13 08:43:35 2015
@@ -74,8 +74,9 @@
#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_X86_64 0
#define KMP_ARCH_PPC64 0
+#define KMP_ARCH_AARCH64 0
#ifdef _WIN32
# undef KMP_OS_WINDOWS
@@ -142,7 +143,10 @@
# elif defined __powerpc64__
# undef KMP_ARCH_PPC64
# define KMP_ARCH_PPC64 1
-# endif
+# elif defined __aarch64__
+# undef KMP_ARCH_AARCH64
+# define KMP_ARCH_AARCH64 1
+# endif
#endif
#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7R__) || \
@@ -181,7 +185,8 @@
# define KMP_ARCH_ARM 1
#endif
-#if (1 != KMP_ARCH_X86 + KMP_ARCH_X86_64 + KMP_ARCH_ARM + KMP_ARCH_PPC64)
+// TODO: Fixme - This is clever, but really fugly
+#if (1 != KMP_ARCH_X86 + KMP_ARCH_X86_64 + KMP_ARCH_ARM + KMP_ARCH_PPC64 + KMP_ARCH_AARCH64)
# error Unknown or unsupported architecture
#endif
@@ -259,7 +264,7 @@
#if KMP_ARCH_X86 || KMP_ARCH_ARM
# define KMP_SIZE_T_SPEC KMP_UINT32_SPEC
-#elif KMP_ARCH_X86_64 || KMP_ARCH_PPC64
+#elif KMP_ARCH_X86_64 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64
# define KMP_SIZE_T_SPEC KMP_UINT64_SPEC
#else
# error "Can't determine size_t printf format specifier."
@@ -721,7 +726,7 @@ extern kmp_real64 __kmp_xchg_real64( vol
#define TCX_SYNC_8(a,b,c) KMP_COMPARE_AND_STORE_REL64((volatile kmp_int64 *)(volatile void *)&(a), (kmp_int64)(b), (kmp_int64)(c))
#if KMP_ARCH_X86
-
+// What about ARM?
#define TCR_PTR(a) ((void *)TCR_4(a))
#define TCW_PTR(a,b) TCW_4((a),(b))
#define TCR_SYNC_PTR(a) ((void *)TCR_SYNC_4(a))
Modified: openmp/trunk/runtime/src/kmp_runtime.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_runtime.c?rev=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_runtime.c (original)
+++ openmp/trunk/runtime/src/kmp_runtime.c Tue Jan 13 08:43:35 2015
@@ -1422,7 +1422,7 @@ __kmp_fork_call(
microtask_t microtask,
launch_t invoker,
/* TODO: revert workaround for Intel(R) 64 tracker #96 */
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM) && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
va_list * ap
#else
va_list ap
@@ -1504,7 +1504,7 @@ __kmp_fork_call(
argv = (void**)parent_team->t.t_argv;
for( i=argc-1; i >= 0; --i )
/* TODO: revert workaround for Intel(R) 64 tracker #96 */
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM) && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
*argv++ = va_arg( *ap, void * );
#else
*argv++ = va_arg( ap, void * );
@@ -1598,11 +1598,11 @@ __kmp_fork_call(
/* create a serialized parallel region? */
if ( nthreads == 1 ) {
/* josh todo: hypothetical question: what do we do for OS X*? */
-#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_ARCH_AARCH64)
void * args[ argc ];
#else
void * * args = (void**) alloca( argc * sizeof( void * ) );
-#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_ARCH_AARCH64) */
__kmp_release_bootstrap_lock( &__kmp_forkjoin_lock );
KA_TRACE( 20, ("__kmp_fork_call: T#%d serializing parallel region\n", gtid ));
@@ -1632,7 +1632,7 @@ __kmp_fork_call(
if ( ap ) {
for( i=argc-1; i >= 0; --i )
// TODO: revert workaround for Intel(R) 64 tracker #96
-# if (KMP_ARCH_X86_64 || KMP_ARCH_ARM) && KMP_OS_LINUX
+# if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
*argv++ = va_arg( *ap, void * );
# else
*argv++ = va_arg( ap, void * );
@@ -1655,7 +1655,7 @@ __kmp_fork_call(
argv = args;
for( i=argc-1; i >= 0; --i )
// TODO: revert workaround for Intel(R) 64 tracker #96
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM) && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
*argv++ = va_arg( *ap, void * );
#else
*argv++ = va_arg( ap, void * );
@@ -1823,7 +1823,7 @@ __kmp_fork_call(
#endif /* OMP_40_ENABLED */
for ( i=argc-1; i >= 0; --i )
// TODO: revert workaround for Intel(R) 64 tracker #96
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM) && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
*argv++ = va_arg( *ap, void * );
#else
*argv++ = va_arg( ap, void * );
@@ -6943,7 +6943,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 || KMP_ARCH_PPC64
+ #if KMP_ARCH_X86_64 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64
#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN
#if KMP_MIC
@@ -6966,7 +6966,7 @@ __kmp_determine_reduction_method( ident_
#error "Unknown or unsupported OS"
#endif // KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_WINDOWS || KMP_OS_DARWIN
- #elif KMP_ARCH_X86 || KMP_ARCH_ARM
+ #elif KMP_ARCH_X86 || KMP_ARCH_ARM || KMP_ARCH_AARCH
#if KMP_OS_LINUX || KMP_OS_WINDOWS
Modified: openmp/trunk/runtime/src/makefile.mk
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/makefile.mk?rev=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/src/makefile.mk (original)
+++ openmp/trunk/runtime/src/makefile.mk Tue Jan 13 08:43:35 2015
@@ -326,11 +326,11 @@ 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
+ # c++11 on ppc64 linux removes definition of preproc. macros, needed in .hs
+ c-flags += -x c++ -std=gnu++11
else
ifneq "$(filter gcc clang,$(c))" ""
- c-flags += -x c++ -std=c++0x
+ c-flags += -x c++ -std=c++11
else
c-flags += -Kc++
endif
@@ -497,6 +497,14 @@ else
cpp-flags += -D CACHE_LINE=64
endif
+# customize aarch64 cache line size to 128, 64 otherwise magic won't happen
+# Just kidding.. can we have some documentation on this, please
+ifeq "$(arch)" "aarch64"
+ 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
@@ -630,6 +638,9 @@ ifneq "$(os)" "win"
else ifeq "$(arch)" "ppc64"
z_Linux_asm$(obj) : \
cpp-flags += -D KMP_ARCH_PPC64
+ else ifeq "$(arch)" "aarch64"
+ z_Linux_asm$(obj) : \
+ cpp-flags += -D KMP_ARCH_AARCH64
else
z_Linux_asm$(obj) : \
cpp-flags += -D KMP_ARCH_X86$(if $(filter 32e,$(arch)),_64)
@@ -1467,6 +1478,10 @@ ifneq "$(filter %-dyna win-%,$(os)-$(LIN
td_exp += libc.so.6
td_exp += ld64.so.1
endif
+ ifeq "$(arch)" "aarch"
+ td_exp += libc.so.6
+ td_exp += ld-linux-aarch64.so.1
+ endif
ifeq "$(std_cpp_lib)" "1"
td_exp += libstdc++.so.6
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=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_config.h (original)
+++ openmp/trunk/runtime/src/thirdparty/ittnotify/ittnotify_config.h Tue Jan 13 08:43:35 2015
@@ -128,6 +128,11 @@
# define ITT_ARCH_IA32E 2
#endif /* ITT_ARCH_IA32E */
+/* Was there a magical reason we didn't have 3 here before? */
+#ifndef ITT_ARCH_AARCH64
+# define ITT_ARCH_AARCH64 3
+#endif /* ITT_ARCH_AARCH64 */
+
#ifndef ITT_ARCH_ARM
# define ITT_ARCH_ARM 4
#endif /* ITT_ARCH_ARM */
@@ -148,6 +153,8 @@
# define ITT_ARCH ITT_ARCH_ARM
# elif defined __powerpc64__
# define ITT_ARCH ITT_ARCH_PPC64
+# elif defined __aarch64__
+# define ITT_ARCH ITT_ARCH_AARCH64
# endif
#endif
@@ -281,7 +288,7 @@ ITT_INLINE long __TBB_machine_fetchadd4(
: "memory");
return result;
}
-#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_PPC64
+#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_PPC64 || ITT_ARCH==ITT_ARCH_AARCH64
#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=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/src/z_Linux_asm.s (original)
+++ openmp/trunk/runtime/src/z_Linux_asm.s Tue Jan 13 08:43:35 2015
@@ -1377,7 +1377,7 @@ __kmp_unnamed_critical_addr:
.size __kmp_unnamed_critical_addr,4
#endif /* KMP_ARCH_ARM */
-#if KMP_ARCH_PPC64
+#if KMP_ARCH_PPC64 || KMP_ARCH_AARCH64
.data
.comm .gomp_critical_user_,32,8
.data
@@ -1386,7 +1386,7 @@ __kmp_unnamed_critical_addr:
__kmp_unnamed_critical_addr:
.8byte .gomp_critical_user_
.size __kmp_unnamed_critical_addr,8
-#endif /* KMP_ARCH_PPC64 */
+#endif /* KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 */
#if defined(__linux__)
# if KMP_ARCH_ARM
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=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/src/z_Linux_util.c (original)
+++ openmp/trunk/runtime/src/z_Linux_util.c Tue Jan 13 08:43:35 2015
@@ -36,7 +36,7 @@
#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)
+# if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64)
// We should really include <futex.h>, but that causes compatibility problems on different
// Linux* OS distributions that either require that you include (or break when you try to include)
// <pci/types.h>.
@@ -63,7 +63,7 @@
#include <fcntl.h>
// For non-x86 architecture
-#if KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_PPC64)
+#if KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64)
# include <stdbool.h>
# include <ffi.h>
#endif
@@ -137,6 +137,18 @@ __kmp_print_cond( char *buffer, kmp_cond
# error Wrong code for getaffinity system call.
# endif /* __NR_sched_getaffinity */
+# elif KMP_ARCH_AARCH64
+# ifndef __NR_sched_setaffinity
+# define __NR_sched_setaffinity 122
+# elif __NR_sched_setaffinity != 122
+# error Wrong code for setaffinity system call.
+# endif /* __NR_sched_setaffinity */
+# ifndef __NR_sched_getaffinity
+# define __NR_sched_getaffinity 123
+# elif __NR_sched_getaffinity != 123
+# error Wrong code for getaffinity system call.
+# endif /* __NR_sched_getaffinity */
+
# elif KMP_ARCH_X86_64
# ifndef __NR_sched_setaffinity
# define __NR_sched_setaffinity 203
@@ -460,7 +472,7 @@ __kmp_change_thread_affinity_mask( int g
/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */
-#if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM) && !KMP_OS_CNK
+#if KMP_OS_LINUX && (KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && !KMP_OS_CNK
int
__kmp_futex_determine_capable()
@@ -522,7 +534,7 @@ __kmp_test_then_and32( volatile kmp_int3
return old_value;
}
-# if KMP_ARCH_X86 || KMP_ARCH_PPC64
+# if KMP_ARCH_X86 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64
kmp_int64
__kmp_test_then_add64( volatile kmp_int64 *p, kmp_int64 d )
{
@@ -2600,7 +2612,7 @@ __kmp_get_load_balance( int max )
#endif // USE_LOAD_BALANCE
-#if KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_PPC64)
+#if KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64)
int __kmp_invoke_microtask( microtask_t pkfn, int gtid, int tid, int argc,
void *p_argv[] )
@@ -2636,7 +2648,7 @@ int __kmp_invoke_microtask( microtask_t
#endif // KMP_COMPILER_GCC && !(KMP_ARCH_X86 || KMP_ARCH_X86_64 || KMP_ARCH_PPC64)
-#if KMP_ARCH_PPC64
+#if KMP_ARCH_PPC64 || KMP_ARCH_AARCH64
// 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
Modified: openmp/trunk/runtime/tools/lib/Platform.pm
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/tools/lib/Platform.pm?rev=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/tools/lib/Platform.pm (original)
+++ openmp/trunk/runtime/tools/lib/Platform.pm Tue Jan 13 08:43:35 2015
@@ -52,6 +52,8 @@ sub canon_arch($) {
$arch = "arm";
} elsif ( $arch =~ m{\Appc64} ) {
$arch = "ppc64";
+ } elsif ( $arch =~ m{\Aaarch64} ) {
+ $arch = "aarch64";
} else {
$arch = undef;
}; # if
@@ -64,6 +66,7 @@ sub canon_arch($) {
"32" => "IA-32 architecture",
"32e" => "Intel(R) 64",
"arm" => "ARM",
+ "aarch64" => "AArch64",
);
sub legal_arch($) {
@@ -82,6 +85,7 @@ sub canon_arch($) {
"32e" => "intel64",
"64" => "ia64",
"arm" => "arm",
+ "aarch64" => "aarch",
);
sub arch_opt($) {
@@ -163,6 +167,8 @@ sub target_options() {
$_host_arch = "arm";
} elsif ( $hardware_platform eq "ppc64" ) {
$_host_arch = "ppc64";
+ } elsif ( $hardware_platform eq "aarch64" ) {
+ $_host_arch = "aarch64";
} 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=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/tools/lib/Uname.pm (original)
+++ openmp/trunk/runtime/tools/lib/Uname.pm Tue Jan 13 08:43:35 2015
@@ -149,6 +149,8 @@ if ( 0 ) {
$values{ hardware_platform } = "arm";
} elsif ( $values{ machine } =~ m{\Appc64\z} ) {
$values{ hardware_platform } = "ppc64";
+ } elsif ( $values{ machine } =~ m{\Aaarch64\z} ) {
+ $values{ hardware_platform } = "aarch64";
} 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=225792&r1=225791&r2=225792&view=diff
==============================================================================
--- openmp/trunk/runtime/tools/src/common-defs.mk (original)
+++ openmp/trunk/runtime/tools/src/common-defs.mk Tue Jan 13 08:43:35 2015
@@ -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,$(if $(filter ppc64,$(1)),PPC64,$(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,$(if $(filter aarch64,$(1)),AArch64,$(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 ppc64)
+arch := $(call check_variable,arch,32 32e 64 arm ppc64 aarch64)
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 lin_ppc64)
+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 lin_aarch64)
# 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