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
This commit is contained in:
Peter Bergner 2018-12-13 18:04:11 +00:00 committed by Peter Bergner
parent fe0827eed0
commit d1573fe051
2 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2018-12-13 Peter Bergner <bergner@linux.ibm.com>
* config/powerpc/target.h (htm_available): Add support for
PPC_FEATURE2_HTM_NO_SUSPEND. Use __builtin_cpu_supports if available.
2018-10-31 Joseph Myers <joseph@codesourcery.com>
PR bootstrap/82856

View File

@ -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