Bug 61193 - ABI incompatibility between POWER and Z HTM builtins and intrinsics
Summary: ABI incompatibility between POWER and Z HTM builtins and intrinsics
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.8.3
: P1 blocker
Target Milestone: 4.8.3
Assignee: Peter Bergner
URL: https://gcc.gnu.org/ml/gcc-patches/20...
Keywords: ABI
Depends on:
Blocks:
 
Reported: 2014-05-15 12:01 UTC by Peter Bergner
Modified: 2014-05-16 03:59 UTC (History)
5 users (show)

See Also:
Host:
Target: powerpc*-linux s390-linux
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-05-16 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Bergner 2014-05-15 12:01:31 UTC
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.
Comment 1 Peter Bergner 2014-05-16 03:43:45 UTC
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
Comment 2 Peter Bergner 2014-05-16 03:44:50 UTC
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
Comment 3 Peter Bergner 2014-05-16 03:46:55 UTC
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
Comment 4 Peter Bergner 2014-05-16 03:51:01 UTC
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.  */
      ...
    }
Comment 5 Peter Bergner 2014-05-16 03:59:40 UTC
Fixes committed to mainline and the 4.9 and 4.8 branches.