From 584c496166eeaacfb320431ac9b4e3d26004c3ae Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 17 Aug 2013 12:13:40 +0400 Subject: [PATCH] Support ARMv8 target (gcc/arm) * src/atomic_ops/sysdeps/gcc/arm.h (__ARM_ARCH_8A__): Detect new macro (treated same as __ARM_ARCH_7A__). * src/atomic_ops/sysdeps/gcc/arm.h (AO_ARM_HAVE_SWP): Do not define for ARMv8 (since SWP{B} obsoleted); add comment. * src/atomic_ops/sysdeps/gcc/arm.h (AO_compare_and_swap): Add TODO item (for deprecated IT block containing wide Thumb instruction). --- src/atomic_ops/sysdeps/gcc/arm.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/atomic_ops/sysdeps/gcc/arm.h b/src/atomic_ops/sysdeps/gcc/arm.h index 9b05216..18a6355 100644 --- a/src/atomic_ops/sysdeps/gcc/arm.h +++ b/src/atomic_ops/sysdeps/gcc/arm.h @@ -47,7 +47,8 @@ && ((!defined(__ARM_ARCH_5__) && !defined(__ARM_ARCH_5E__) \ && !defined(__ARM_ARCH_5T__) && !defined(__ARM_ARCH_5TE__) \ && !defined(__ARM_ARCH_5TEJ__) && !defined(__ARM_ARCH_6M__)) \ - || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__)) + || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \ + || defined(__ARM_ARCH_8A__)) # define AO_ARM_HAVE_LDREX # if !defined(__ARM_ARCH_6__) && !defined(__ARM_ARCH_6J__) \ && !defined(__ARM_ARCH_6T2__) @@ -73,9 +74,10 @@ #endif /* ARMv6+ */ #if !defined(__ARM_ARCH_2__) && !defined(__ARM_ARCH_6M__) \ - && !defined(__thumb2__) + && !defined(__ARM_ARCH_8A__) && !defined(__thumb2__) # define AO_ARM_HAVE_SWP /* Note: ARMv6M is excluded due to no ARM mode support. */ + /* Also, SWP is obsoleted for ARMv8+. */ #endif /* !__thumb2__ */ #ifdef AO_UNIPROCESSOR @@ -440,6 +442,8 @@ AO_xor(volatile AO_t *p, AO_t value) " ldrex %1, [%3]\n" /* get original */ " teq %1, %4\n" /* see if match */ # ifdef __thumb2__ + /* TODO: Eliminate warning: it blocks containing wide Thumb */ + /* instructions are deprecated in ARMv8. */ " it eq\n" # endif " strexeq %0, %5, [%3]\n" /* store new one if matched */ -- 2.40.0