On Mon, Jul 15, 2013 at 4:26 PM, Peter Bergner <berg...@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