AC_MSG_RESULT($fpu)
CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu=1"
unset fpu
+
+ AC_MSG_CHECKING(for ARMV6)
+ AC_TRY_RUN([
+ int main () { __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory"); return 0; }
+ ], armv6=yes, armv6=no)
+
+ AC_MSG_RESULT($armv6)
+ if test ${armv6} = yes; then
+ AC_DEFINE(HAVE_ARMV6, 1, "Host supports ARMV6 instructions")
+ fi
fi
if test ${TARGET} = unknown; then
static CRITICAL_SECTION mini_arch_mutex;
static int v5_supported = 0;
+static int v6_supported = 0;
static int v7_supported = 0;
static int thumb_supported = 0;
/*
thumb_supported = strstr (cpu_arch, "thumb") != NULL;
if (strncmp (cpu_arch, "armv", 4) == 0) {
v5_supported = cpu_arch [4] >= '5';
+ v6_supported = cpu_arch [4] >= '6';
v7_supported = cpu_arch [4] >= '7';
}
} else {
char *ver = strstr (line, "(v");
if (ver && (ver [2] == '5' || ver [2] == '6' || ver [2] == '7'))
v5_supported = TRUE;
+ if (ver && (ver [2] == '6' || ver [2] == '7'))
+ v6_supported = TRUE;
if (ver && (ver [2] == '7'))
v7_supported = TRUE;
continue;
switch (ins->opcode) {
case OP_MEMORY_BARRIER:
- ARM_MOV_REG_IMM8 (code, ARMREG_R0, 0);
- ARM_MCR (code, 15, 0, ARMREG_R0, 7, 10, 5);
+ if (v6_supported) {
+ ARM_MOV_REG_IMM8 (code, ARMREG_R0, 0);
+ ARM_MCR (code, 15, 0, ARMREG_R0, 7, 10, 5);
+ }
break;
case OP_TLS_GET:
#ifdef HAVE_AEABI_READ_TP
mono_arch_set_target (char *mtriple)
{
/* The GNU target triple format is not very well documented */
- if (strstr (mtriple, "armv7"))
+ if (strstr (mtriple, "armv7")) {
+ v6_supported = TRUE;
v7_supported = TRUE;
+ }
+ if (strstr (mtriple, "armv7")) {
+ v6_supported = TRUE;
+ }
if (strstr (mtriple, "darwin")) {
v5_supported = TRUE;
thumb_supported = TRUE;
#ifndef _MONO_UTILS_MONO_MEMBAR_H_
#define _MONO_UTILS_MONO_MEMBAR_H_
+#include <config.h>
+
#include <glib.h>
#ifdef __x86_64__
#elif defined(__arm__)
static inline void mono_memory_barrier (void)
{
+#ifdef HAVE_ARMV6
__asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory");
+#endif
}
static inline void mono_memory_read_barrier (void)