Merge pull request #1226 from ashwinyes/develop_arm_clang_ual_fix
[platform/upstream/openblas.git] / common_arm.h
index 7e0c023..27fa76b 100644 (file)
@@ -51,6 +51,8 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #ifndef ASSEMBLER
 
+#if defined(ARMV6) || defined(ARMV7) || defined(ARMV8)
+
 static void __inline blas_lock(volatile BLASULONG *address){
 
   int register ret;
@@ -71,12 +73,17 @@ static void __inline blas_lock(volatile BLASULONG *address){
   MB;
 }
 
+#define BLAS_LOCK_DEFINED
+#endif
 
 static inline int blas_quickdivide(blasint x, blasint y){
   return x / y;
 }
 
-#if defined(DOUBLE)
+#if !defined(HAVE_VFP)
+/* no FPU, soft float */
+#define GET_IMAGE(res)
+#elif defined(DOUBLE)
 #define GET_IMAGE(res)  __asm__ __volatile__("vstr.f64 d1, %0" : "=m"(res) : : "memory")
 #else
 #define GET_IMAGE(res)  __asm__ __volatile__("vstr.f32 s1, %0" : "=m"(res) : : "memory")
@@ -98,7 +105,6 @@ static inline int blas_quickdivide(blasint x, blasint y){
 #define PROLOGUE \
        .arm             ;\
        .global REALNAME ;\
-       .func   REALNAME  ;\
 REALNAME:
 
 #define EPILOGUE
@@ -124,4 +130,8 @@ REALNAME:
 #define MAP_ANONYMOUS MAP_ANON
 #endif
 
+#if !defined(ARMV5) && !defined(ARMV6) && !defined(ARMV7) && !defined(ARMV8)
+#error "you must define ARMV5, ARMV6, ARMV7 or ARMV8"
+#endif
+
 #endif