On Mon, Mar 05, 2012 at 07:04:47PM +0100, 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.

Disabling it for the __builtin_* too of course.
> 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 ;)

I don't think the compiler ever changes intrinsics into something else?
Especially not for RTM of course, but I also didn't think it applied
to any others?

The problem I have with the flag is that the typical use model is to 
have multiple code paths, like:

if (cpuid_has_rtm())
    ... do rtm ...
    ... do something else ...

So you have a basic block which needs RTM and another one which doesn't
want it.  If the flag would affect the code generation of the else block 
that would be bad.  So essentially the flag has to be a nop anyways 
except for the intrinsic itself.


a...@linux.intel.com -- Speaking for myself only.

Reply via email to