This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] S/390: Hardware transactional memory support
- From: David Edelsohn <dje dot gcc at gmail dot com>
- To: Peter Bergner <bergner at vnet dot ibm dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 15 Jul 2013 23:03:47 -0400
- Subject: Re: [PATCH] S/390: Hardware transactional memory support
- References: <20130621102314 dot GA753 at bart> <20130715193231 dot GR2475 at laptop dot redhat dot com> <1373919992 dot 4538 dot 177 dot camel at otta>
On Mon, Jul 15, 2013 at 4:26 PM, Peter Bergner <bergner@vnet.ibm.com> wrote:
> On Mon, 2013-07-15 at 21:32 +0200, Jakub Jelinek wrote:
>> Have you considered trying it to work even when libitm itself isn't built
>> for zEC12 or later only? I mean, both the i?86/x86_64 and powerpc* libitm
>> HTM don't define htm_available as unconditional true, they check in some way
>> whether the CPU supports HTM and return true if yes, and as needed some
>> parts or whole of libitm is compiled with some compiler option that
>> allows the HTM instructions to be generated.
>>
>> I see your patch will currently error out if you have HTM builtins
>> insode of code, -mtx and don't enable -march=zEC12, could that be changed,
>> so that -mtx is essentially independent on the chosen CPU?
>
> Now that you mention this, my Power HTM patch enabled other ISA flags too,
> if you used -mhtm. Like so:
>
> /* For the newer switches (vsx, dfp, etc.) set some of the older options,
> unless the user explicitly used the -mno-<option> to disable the code. */
> - if (TARGET_P8_VECTOR || TARGET_DIRECT_MOVE || TARGET_CRYPTO)
> + if (TARGET_P8_VECTOR || TARGET_DIRECT_MOVE || TARGET_CRYPTO || TARGET_HTM)
> rs6000_isa_flags |= (ISA_2_7_MASKS_SERVER & ~rs6000_isa_flags_explicit);
>
> I think I agree with you that we shouldn't do that, since adding in
> those extra flags with -mhtm basically means libitm can only really
> run on a power8 system instead of the default -mcpu system.
>
> David, do you prefer reverting the above hunk from the Power HTM
> patch or should I add the associated -mno-* options to the building
> of libitm?
How is libitm built for Intel? The principle of least surprises
suggests following that precedent.
- David