Apply patch provided in issue #224. Add support for ARM64.

pull/229/head
Ignacio 9 years ago
parent 4ef408b591
commit 58617584d4

@ -493,6 +493,11 @@ LLVM:
# define POSH_CPU_STRING "ARM" # define POSH_CPU_STRING "ARM"
#endif #endif
#if defined __aarch64__
# define POSH_CPU_AARCH64 1
# define POSH_CPU_STRING "ARM64"
#endif
#if defined mips || defined __mips__ || defined __MIPS__ || defined _MIPS #if defined mips || defined __mips__ || defined __MIPS__ || defined _MIPS
# define POSH_CPU_MIPS 1 # define POSH_CPU_MIPS 1
# if defined _R5900 # if defined _R5900
@ -666,7 +671,7 @@ LLVM:
** the MIPS series, so we have to be careful about those. ** the MIPS series, so we have to be careful about those.
** ---------------------------------------------------------------------------- ** ----------------------------------------------------------------------------
*/ */
#if defined POSH_CPU_X86 || defined POSH_CPU_AXP || defined POSH_CPU_STRONGARM || defined POSH_OS_WIN32 || defined POSH_OS_WINCE || defined __MIPSEL__ #if defined POSH_CPU_X86 || defined POSH_CPU_AXP || defined POSH_CPU_STRONGARM || defined POSH_CPU_AARCH64 || defined POSH_OS_WIN32 || defined POSH_OS_WINCE || defined __MIPSEL__
# define POSH_ENDIAN_STRING "little" # define POSH_ENDIAN_STRING "little"
# define POSH_LITTLE_ENDIAN 1 # define POSH_LITTLE_ENDIAN 1
#else #else

@ -656,6 +656,9 @@ namespace
# elif NV_CPU_PPC # elif NV_CPU_PPC
ucontext_t * ucp = (ucontext_t *)secret; ucontext_t * ucp = (ucontext_t *)secret;
return (void *) ucp->uc_mcontext.regs->nip; return (void *) ucp->uc_mcontext.regs->nip;
# elif NV_CPU_AARCH64
ucontext_t * ucp = (ucontext_t *)secret;
return (void *) ucp->uc_mcontext.pc;
# else # else
# error "Unknown CPU" # error "Unknown CPU"
# endif # endif

@ -93,6 +93,7 @@
// NV_CPU_X86_64 // NV_CPU_X86_64
// NV_CPU_PPC // NV_CPU_PPC
// NV_CPU_ARM // NV_CPU_ARM
// NV_CPU_AARCH64
#define NV_CPU_STRING POSH_CPU_STRING #define NV_CPU_STRING POSH_CPU_STRING
@ -105,6 +106,8 @@
# define NV_CPU_PPC 1 # define NV_CPU_PPC 1
#elif defined POSH_CPU_STRONGARM #elif defined POSH_CPU_STRONGARM
# define NV_CPU_ARM 1 # define NV_CPU_ARM 1
#elif defined POSH_CPU_AARCH64
# define NV_CPU_AARCH64 1
#else #else
# error "Unsupported CPU" # error "Unsupported CPU"
#endif #endif

@ -58,7 +58,7 @@ namespace nv {
uint32 ret = *ptr; // on x86, loads are Acquire uint32 ret = *ptr; // on x86, loads are Acquire
nvCompilerReadBarrier(); nvCompilerReadBarrier();
return ret; return ret;
#elif POSH_CPU_STRONGARM #elif POSH_CPU_STRONGARM || POSH_CPU_AARCH64
// need more specific cpu type for armv7? // need more specific cpu type for armv7?
// also utilizes a full barrier // also utilizes a full barrier
// currently treating laod like x86 - this could be wrong // currently treating laod like x86 - this could be wrong
@ -82,7 +82,7 @@ namespace nv {
nvCompilerWriteBarrier(); nvCompilerWriteBarrier();
*ptr = value; // on x86, stores are Release *ptr = value; // on x86, stores are Release
//nvCompilerWriteBarrier(); // @@ IC: Where does this barrier go? In nvtt it was after, in Witness before. Not sure which one is right. //nvCompilerWriteBarrier(); // @@ IC: Where does this barrier go? In nvtt it was after, in Witness before. Not sure which one is right.
#elif POSH_CPU_STRONGARM #elif POSH_CPU_STRONGARM || POSH_CPU_AARCH64
// this is the easiest but slowest way to do this // this is the easiest but slowest way to do this
nvCompilerReadWriteBarrier(); nvCompilerReadWriteBarrier();
*ptr = value; //strex? *ptr = value; //strex?

Loading…
Cancel
Save