Blame SOURCES/gcc48-rh1659698.patch

719f08
2018-12-13  Peter Bergner  <bergner@linux.ibm.com>
719f08
719f08
	* config/powerpc/target.h (htm_available):  Add support for
719f08
	PPC_FEATURE2_HTM_NO_SUSPEND.  Use __builtin_cpu_supports if available.
719f08
719f08
--- libitm/config/powerpc/target.h
719f08
+++ libitm/config/powerpc/target.h
719f08
@@ -81,7 +81,20 @@ cpu_relax (void)
719f08
 static inline bool
719f08
 htm_available (void)
719f08
 {
719f08
-  return (getauxval (AT_HWCAP2) & PPC_FEATURE2_HAS_HTM) ? true : false;
719f08
+#ifdef __BUILTIN_CPU_SUPPORTS__
719f08
+  if (__builtin_cpu_supports ("htm-no-suspend")
719f08
+      || __builtin_cpu_supports ("htm"))
719f08
+    return true;
719f08
+#else
719f08
+  unsigned long htm_flags = PPC_FEATURE2_HAS_HTM
719f08
+#ifdef PPC_FEATURE2_HTM_NO_SUSPEND
719f08
+			    | PPC_FEATURE2_HTM_NO_SUSPEND
719f08
+#endif
719f08
+			    | 0;
719f08
+  if (getauxval (AT_HWCAP2) & htm_flags)
719f08
+    return true;
719f08
+#endif
719f08
+  return false;
719f08
 }
719f08
 
719f08
 static inline uint32_t