Skip to content

Commit

Permalink
Attempting to fix aarch64 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Epixu committed Jul 24, 2024
1 parent e6529aa commit 64212c6
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions simde/x86/sse.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@

// MemoryBarrier() function has been extracted from the original windows headers
#ifdef _MSC_VER
#if defined(SIMDE_ARCH_AARCH64)
/*#if defined(SIMDE_ARCH_AARCH64)
#include <intrin.h>
#define simde_MemoryBarrier __faststorefence

/*#elif defined(SIMDE_ARCH_ARM_NEON)
*/
#if defined(SIMDE_ARCH_AARCH64)
#include <intrin.h>

typedef enum simde_tag_ARM64INTR_BARRIER_TYPE
Expand All @@ -64,11 +64,11 @@
}
SIMDE_ARM64INTR_BARRIER_TYPE;

static HEDLEY_ALWAYS_INLINE
HEDLEY_ALWAYS_INLINE
void simde_MemoryBarrier(void) {
__dmb(SIMDE_ARM64_BARRIER_SY);
}
#elif defined(__x86_64__)
/*#elif defined(__x86_64__)
#pragma intrinsic(__faststorefence)
void __faststorefence(void);
Expand All @@ -92,23 +92,28 @@
}
SIMDE_ARMINTR_BARRIER_TYPE;

static HEDLEY_ALWAYS_INLINE
HEDLEY_ALWAYS_INLINE
void simde_MemoryBarrier(void) {
__dmb(SIMDE_ARM_BARRIER_SY);
}
#elif defined(_M_X86)
static HEDLEY_ALWAYS_INLINE
HEDLEY_ALWAYS_INLINE
long simde_InterlockedOr(long volatile* dest, long val) {
return __sync_fetch_and_or(dest, val);
}

static HEDLEY_ALWAYS_INLINE
HEDLEY_ALWAYS_INLINE
void simde_MemoryBarrier(void) {
long dummy;
simde_InterlockedOr(&dummy, 0);
}
#elif defined(SIMDE_X86_SSE_NO_NATIVE)
HEDLEY_ALWAYS_INLINE
void simde_MemoryBarrier(void) {
((void)0); // intentionally no-op
}
#else
#error "should simde_MemoryBarrier be defined as no-op in this case?"
#error "Missing implementation"
#endif
#endif

Expand Down

0 comments on commit 64212c6

Please sign in to comment.