On 03/05/2012 10:04 AM, Uros Bizjak wrote: > On Mon, Mar 5, 2012 at 6:12 PM, Andi Kleen <a...@firstfloor.org> wrote: >> On Mon, Mar 05, 2012 at 03:31:32PM +0400, Kirill Yukhin wrote: >>> Adding patch >> >> I would still remove the "-mrtm" option. I never understood what options >> for intrinsics are good for. They are just a pain to add to Makefiles, >> but don't give any benefit. > > Without -mrtm, the test will just emit a call to > __builtin_ia32_xbegin, for instance. You would ge linking error from > your app. > > And the reason to have -mXXX flags is quite obvious. You don't want > combiner to optimize the sequence of two supported instructions (SSE > level X, for example) to an unsupported one (SSE level X+N) that > implements the same functionality. The same goes for integer > instructions, but less obvious ;) > > So, I'm afraid that -mXXX options stay. But you can sprinkle target > option pragmas around the code now.
-mrtm is a bit different from the other -m options. E.g. -msse affects the header files in that it controls whether the __m128 data type is even available. E.g. -mssse3, -mavx, -mbmi all affect the code generated for any code written in plain old C using no intrinsics. But -mrtm *only* affects the availability of certain intrinsics. One can reasonably argue that you simply don't use those when you don't want to use them. That said, -mrtm could easily be tested by the compiler to generate (or not) inline HTM for implementing -fgnu-tm.... r~