diff --git a/benchmarks/sizeof/main.cpp b/benchmarks/sizeof/main.cpp index 90573c614..4f5e236d0 100644 --- a/benchmarks/sizeof/main.cpp +++ b/benchmarks/sizeof/main.cpp @@ -5,9 +5,16 @@ using namespace Upp; CONSOLE_APP_MAIN { StdLogSetup(LOG_COUT|LOG_FILE); + #ifdef CPU_64 RLOG("CPU_64"); #endif +#ifdef CPU_UNALIGNED + RLOG("CPU_UNALIGNED"); +#endif +#ifdef CPU_LE + RLOG("CPU_LE"); +#endif #ifdef CPP_11 RLOG("CPP_11"); #endif diff --git a/uppsrc/Core/Mt.cpp b/uppsrc/Core/Mt.cpp index d66ce8839..2198c599b 100644 --- a/uppsrc/Core/Mt.cpp +++ b/uppsrc/Core/Mt.cpp @@ -415,6 +415,7 @@ void WriteMemoryBarrier() { #else +#ifndef COMPILER_GCC void ReadMemoryBarrier() { static Atomic x; @@ -424,6 +425,7 @@ void ReadMemoryBarrier() void WriteMemoryBarrier() { ReadMemoryBarrier(); } +#endif #endif diff --git a/uppsrc/Core/Mt.h b/uppsrc/Core/Mt.h index 09417addd..fa9644284 100644 --- a/uppsrc/Core/Mt.h +++ b/uppsrc/Core/Mt.h @@ -148,6 +148,16 @@ inline void WriteMemoryBarrier() { #endif #endif } +#elif defined(COMPILER_GCC) +inline void ReadMemoryBarrier() +{ + __sync_synchronize(); +} + +inline void WriteMemoryBarrier() +{ + __sync_synchronize(); +} #endif #ifdef CPU_BLACKFIN diff --git a/uppsrc/Core/config.h b/uppsrc/Core/config.h index 6ee8991bc..8a6cfef5f 100644 --- a/uppsrc/Core/config.h +++ b/uppsrc/Core/config.h @@ -81,9 +81,18 @@ #elif __arm__ #define CPU_32 1 #define CPU_ARM 1 - #define CPU_LE 1 - #define CPU_LITTLE_ENDIAN 1 - #define CPU_ALIGNED 1 + #ifdef __ARM_BIG_ENDIAN + #define CPU_BE 1 + #define CPU_BIG_ENDIAN 1 + #else + #define CPU_LE 1 + #define CPU_LITTLE_ENDIAN 1 + #endif + #ifdef __ARM_FEATURE_UNALIGNED + #define CPU_UNALIGNED 1 + #else + #define CPU_ALIGNED 1 + #endif #elif __bfin #define CPU_32 1 #define CPU_BLACKFIN