aboutsummaryrefslogtreecommitdiff
path: root/libitm/config/powerpc
diff options
context:
space:
mode:
authorPeter Bergner <bergner@linux.ibm.com>2018-12-13 18:04:11 +0000
committerPeter Bergner <bergner@gcc.gnu.org>2018-12-13 12:04:11 -0600
commitd1573fe051974d73af613b1ccce5dcecc21ee94a (patch)
tree77c11c4e0cb30b901606cdc831553b6eede54670 /libitm/config/powerpc
parentfe0827eed09d14064efe070dc0f4db71bc66bbd4 (diff)
downloadgcc-d1573fe051974d73af613b1ccce5dcecc21ee94a.zip
gcc-d1573fe051974d73af613b1ccce5dcecc21ee94a.tar.gz
gcc-d1573fe051974d73af613b1ccce5dcecc21ee94a.tar.bz2
target.h (htm_available): Add support for PPC_FEATURE2_HTM_NO_SUSPEND.
libitm/ * config/powerpc/target.h (htm_available): Add support for PPC_FEATURE2_HTM_NO_SUSPEND. Use __builtin_cpu_supports if available. From-SVN: r267101
Diffstat (limited to 'libitm/config/powerpc')
-rw-r--r--libitm/config/powerpc/target.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/libitm/config/powerpc/target.h b/libitm/config/powerpc/target.h
index 8288173..77652a6 100644
--- a/libitm/config/powerpc/target.h
+++ b/libitm/config/powerpc/target.h
@@ -81,7 +81,20 @@ cpu_relax (void)
static inline bool
htm_available (void)
{
- return (getauxval (AT_HWCAP2) & PPC_FEATURE2_HAS_HTM) ? true : false;
+#ifdef __BUILTIN_CPU_SUPPORTS__
+ if (__builtin_cpu_supports ("htm-no-suspend")
+ || __builtin_cpu_supports ("htm"))
+ return true;
+#else
+ unsigned long htm_flags = PPC_FEATURE2_HAS_HTM
+#ifdef PPC_FEATURE2_HTM_NO_SUSPEND
+ | PPC_FEATURE2_HTM_NO_SUSPEND
+#endif
+ | 0;
+ if (getauxval (AT_HWCAP2) & htm_flags)
+ return true;
+#endif
+ return false;
}
static inline uint32_t