Blame SOURCES/gcc48-rh1659698.patch

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