An ABI incompatibility between POWER and Z HTM builtins and intrinsics has been found. The incompatibility is on mainline, 4.9 and 4.8. We're still waiting to hear what the XL team has implemented for their return status. Does the XL on POWER and Z match the POWER or Z sematics? Does XL on POWER match GCC on POWER and XL on Z match GCC on Z? We're tracking that answer down now. The intent was that common code on all platforms and compilers would have the same ABI.
Author: bergner Date: Fri May 16 03:43:12 2014 New Revision: 210486 URL: http://gcc.gnu.org/viewcvs?rev=210486&root=gcc&view=rev Log: PR target/61193 * config/rs6000/htmxlintrin.h (_HTM_TBEGIN_STARTED): New define. (__TM_simple_begin): Use it. (__TM_begin): Likewise. Modified: trunk/gcc/ChangeLog trunk/gcc/config/rs6000/htmxlintrin.h
Author: bergner Date: Fri May 16 03:44:19 2014 New Revision: 210487 URL: http://gcc.gnu.org/viewcvs?rev=210487&root=gcc&view=rev Log: PR target/61193 * config/rs6000/htmxlintrin.h (_HTM_TBEGIN_STARTED): New define. (__TM_simple_begin): Use it. (__TM_begin): Likewise. Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/config/rs6000/htmxlintrin.h
Author: bergner Date: Fri May 16 03:46:23 2014 New Revision: 210488 URL: http://gcc.gnu.org/viewcvs?rev=210488&root=gcc&view=rev Log: Backport from mainline 2014-05-15 Peter Bergner <bergner@vnet.ibm.com> PR target/61193 * config/rs6000/htmxlintrin.h (_HTM_TBEGIN_STARTED): New define. (__TM_simple_begin): Use it. (__TM_begin): Likewise. Modified: branches/gcc-4_8-branch/gcc/ChangeLog branches/gcc-4_8-branch/gcc/config/rs6000/htmxlintrin.h
After discussing this with the XL compiler team, the S390 GCC team and the Power GCC team, we have decided to leave the incompatibility between Power and S390. However, the XL and GCC compilers will be compatible with each other when targeting the same processor target. To mitigate the incompatibility somewhat, we have decided to add a macro to the powerpc*-linux's htmintrin.h file that defines what the "sucessful" return status value of the __TM_simple_begin() and __TM_begin() intrinsic function is. This macro is already defined in the S390's htmintrin.h header file and is used by the S390 to determine whether the transaction was successfully started or not. By adding the same macro on Power, we allow users to write common code between Power and S390, even though our successful return status values are different. For example, the following code can be used on Power and S390, even though the actual value returned by __TM_simple_begin() is different. if ((tx_state = __TM_simple_begin ()) == _HTM_TBEGIN_STARTED) { /* Transaction State Initiated. */ ... } else { /* Transaction State Failed. */ ... }
Fixes committed to mainline and the 4.9 and 4.8 branches.