diff --git a/raid/internal.h b/raid/internal.h index f34f376f..9501d0c5 100644 --- a/raid/internal.h +++ b/raid/internal.h @@ -520,6 +520,12 @@ static __always_inline void raid_neon_begin(void) static __always_inline void raid_neon_end(void) { + /* + * Compiler memory barrier to ensure memory operations are not + * reordered across the end of SIMD operations. + */ + asm volatile ("" : : : "memory"); + /* * Clobbers registers used in NEON asm operations. * @@ -551,6 +557,12 @@ static __always_inline void raid_neon32_begin(void) static __always_inline void raid_neon32_end(void) { + /* + * Compiler memory barrier to ensure memory operations are not + * reordered across the end of SIMD operations. + */ + asm volatile ("" : : : "memory"); + /* * Clobbers registers used in AArch32 NEON asm operations. *