12 changes: 2 additions & 10 deletions openmp/runtime/src/kmp_gsupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -40,7 +40,6 @@ xexpand(KMP_API_NAME_GOMP_BARRIER)(void)
}


/* */
//
// Mutual exclusion
//
Expand Down Expand Up @@ -216,7 +215,6 @@ xexpand(KMP_API_NAME_GOMP_ORDERED_END)(void)
}


/* */
//
// Dispatch macro defs
//
Expand All @@ -239,7 +237,6 @@ xexpand(KMP_API_NAME_GOMP_ORDERED_END)(void)
# define KMP_DISPATCH_NEXT_ULL __kmpc_dispatch_next_8u


/* */
//
// The parallel contruct
//
Expand Down Expand Up @@ -288,7 +285,7 @@ __kmp_GOMP_fork_call(ident_t *loc, int gtid, microtask_t wrapper, int argc,...)
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
Expand Down Expand Up @@ -344,7 +341,6 @@ xexpand(KMP_API_NAME_GOMP_PARALLEL_END)(void)
}


/* */
//
// Loop worksharing constructs
//
Expand Down Expand Up @@ -500,7 +496,6 @@ xexpand(KMP_API_NAME_GOMP_LOOP_END_NOWAIT)(void)
}


/* */
//
// Unsigned long long loop worksharing constructs
//
Expand Down Expand Up @@ -622,7 +617,6 @@ LOOP_NEXT_ULL(xexpand(KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_RUNTIME_NEXT), \
{ KMP_DISPATCH_FINI_CHUNK_ULL(&loc, gtid); })


/* */
//
// Combined parallel / loop worksharing constructs
//
Expand Down Expand Up @@ -666,7 +660,6 @@ PARALLEL_LOOP_START(xexpand(KMP_API_NAME_GOMP_PARALLEL_LOOP_GUIDED_START), kmp_s
PARALLEL_LOOP_START(xexpand(KMP_API_NAME_GOMP_PARALLEL_LOOP_RUNTIME_START), kmp_sch_runtime)


/* */
//
// Tasking constructs
//
Expand Down Expand Up @@ -739,7 +732,6 @@ xexpand(KMP_API_NAME_GOMP_TASKWAIT)(void)
}


/* */
//
// Sections worksharing constructs
//
Expand Down
4 changes: 2 additions & 2 deletions openmp/runtime/src/kmp_lock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -359,7 +359,7 @@ __kmp_destroy_nested_tas_lock_with_checks( 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 */
Expand Down
12 changes: 6 additions & 6 deletions openmp/runtime/src/kmp_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ extern void __kmp_init_nested_tas_lock( kmp_tas_lock_t *lck );
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.
Expand Down Expand Up @@ -224,7 +224,7 @@ extern void __kmp_release_nested_futex_lock( kmp_futex_lock_t *lck, kmp_int32 gt
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)


// ----------------------------------------------------------------------------
Expand Down Expand Up @@ -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,
Expand All @@ -607,7 +607,7 @@ extern kmp_lock_kind_t __kmp_user_lock_kind;

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;
Expand Down Expand Up @@ -635,7 +635,7 @@ __kmp_get_user_lock_owner( kmp_user_lock_p lck )

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) { \
Expand Down Expand Up @@ -685,7 +685,7 @@ __kmp_acquire_user_lock_with_checks( kmp_user_lock_p lck, kmp_int32 gtid )

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 */
Expand Down
15 changes: 10 additions & 5 deletions openmp/runtime/src/kmp_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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__) || \
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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."
Expand Down Expand Up @@ -721,7 +726,7 @@ extern kmp_real64 __kmp_xchg_real64( volatile kmp_real64 *p, kmp_real64 v );
#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))
Expand Down
18 changes: 9 additions & 9 deletions openmp/runtime/src/kmp_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 * );
Expand Down Expand Up @@ -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 ));
Expand Down Expand Up @@ -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 * );
Expand All @@ -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 * );
Expand Down Expand Up @@ -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 * );
Expand Down Expand Up @@ -6943,7 +6943,7 @@ __kmp_determine_reduction_method( ident_t *loc, kmp_int32 global_tid,
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
Expand All @@ -6966,7 +6966,7 @@ __kmp_determine_reduction_method( ident_t *loc, kmp_int32 global_tid,
#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

Expand Down
21 changes: 18 additions & 3 deletions openmp/runtime/src/makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -1467,6 +1478,10 @@ ifneq "$(filter %-dyna win-%,$(os)-$(LINK_TYPE))" ""
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
Expand Down
9 changes: 8 additions & 1 deletion openmp/runtime/src/thirdparty/ittnotify/ittnotify_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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

Expand Down Expand Up @@ -281,7 +288,7 @@ ITT_INLINE long __TBB_machine_fetchadd4(volatile void* ptr, long addend)
: "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
Expand Down
4 changes: 2 additions & 2 deletions openmp/runtime/src/z_Linux_asm.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
24 changes: 18 additions & 6 deletions openmp/runtime/src/z_Linux_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>.
Expand All @@ -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
Expand Down Expand Up @@ -137,6 +137,18 @@ __kmp_print_cond( char *buffer, kmp_cond_align_t *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
Expand Down Expand Up @@ -460,7 +472,7 @@ __kmp_change_thread_affinity_mask( int gtid, kmp_affin_mask_t *new_mask,
/* ------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------ */

#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()
Expand Down Expand Up @@ -522,7 +534,7 @@ __kmp_test_then_and32( volatile kmp_int32 *p, kmp_int32 d )
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 )
{
Expand Down Expand Up @@ -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[] )
Expand Down Expand Up @@ -2636,7 +2648,7 @@ int __kmp_invoke_microtask( microtask_t pkfn, int gtid, int tid, int argc,

#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
Expand Down
6 changes: 6 additions & 0 deletions openmp/runtime/tools/lib/Platform.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -64,6 +66,7 @@ sub canon_arch($) {
"32" => "IA-32 architecture",
"32e" => "Intel(R) 64",
"arm" => "ARM",
"aarch64" => "AArch64",
);

sub legal_arch($) {
Expand All @@ -82,6 +85,7 @@ sub canon_arch($) {
"32e" => "intel64",
"64" => "ia64",
"arm" => "arm",
"aarch64" => "aarch",
);

sub arch_opt($) {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions openmp/runtime/tools/lib/Uname.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions openmp/runtime/tools/src/common-defs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down