[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFzCuu=n0SFiVyxv7ETxFTYZCBW-0S_RX=WZnwzORh4-7g@mail.gmail.com>
Date: Mon, 4 May 2015 13:35:59 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Richard Henderson <rth@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Vladimir Makarov <vmakarov@...hat.com>,
Jakub Jelinek <jakub@...hat.com>,
Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Borislav Petkov <bp@...en8.de>,
"gcc@....gnu.org" <gcc@....gnu.org>
Subject: Re: [RFC] Design for flag bit outputs from asms
On Mon, May 4, 2015 at 1:14 PM, H. Peter Anvin <hpa@...or.com> wrote:
>
> I would argue that for x86 what you actually want is to model the
> *conditions* that are available on the flags, not the flags themselves.
Yes. Otherwise it would be a nightmare to try to describe simple
conditions like "le", which a rather complicated combination of three
of the actual flag bits:
((SF ^^ OF) || ZF) = 1
which would just be ridiculously painful for (a) the user to describe
and (b) fior the compiler to recognize once described.
Now, I do admit that most of the cases where you'd use inline asm with
condition codes would probably fall into just simple "test ZF or CF".
But I could certainly imagine other cases.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists