From: Jakub Jelinek <jakub@redhat.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Alan <alan@lxorguk.ukuu.org.uk>,
Grzegorz Kulewski <kangur@polcom.net>,
Mikael Pettersson <mikpe@it.uu.se>,
s0348365@sms.ed.ac.uk, torvalds@osdl.org,
76306.1226@compuserve.com, akpm@osdl.org, bunk@stusta.de,
greg@kroah.com, linux-kernel@vger.kernel.org,
yanmin_zhang@linux.intel.com
Subject: Re: kernel + gcc 4.1 = several problems
Date: Wed, 3 Jan 2007 08:58:08 -0500 [thread overview]
Message-ID: <20070103135808.GS29911@devserv.devel.redhat.com> (raw)
In-Reply-To: <1167831136.3095.8.camel@laptopd505.fenrus.org>
On Wed, Jan 03, 2007 at 05:32:16AM -0800, Arjan van de Ven wrote:
> On Wed, 2007-01-03 at 12:44 +0000, Alan wrote:
> > > > fixed. At that point an i686 kernel would contain i686 instructions and
> > > > actually run on all i686 processors ending all the i586 pain for most
> > > > users and distributions.
> > >
> > > Could you explain why CMOV is pointless now? Are there any benchmarks
> > > proving that?
> >
> > Take a look at the recent ffmpeg bits on the mplayer list for one example
> > I have to hand - P4 cmov is pretty slow. The crypto folks find the same
> > things.
>
> cmov is effectively the same cost as a compare and jump, in both cases
> the cpu needs to do a prediction, and on a mispredict, restart.
>
> the reason cmov can make sense is because it's smaller code...
BTW, from GCC POV availability of CMOV is the only difference between
-march=i586 -mtune=something and -march=i686 -mtune=something. So this is
just a naming thing, it could be called -march=i686cmov to make it more
obvious but it is too late (and too unimportant) to change it now.
Perhaps adding a note to info gcc/man gcc ought to be enough?
If you don't want CMOV being emitted, compile with -march=i586 -mtune=generic
(or whatever other tuning you pick up), with -march=i686 -mtune=generic
you tell GCC you have CMOV. Whether CMOV is actually used in generated
code is another matter, which should be decided based on the selected
-mtune. For -Os CMOV should be used whenever available, as that means
usually smaller code, otherwise if on some particular chip CMOV is actually
slower than compare, jump and assignment, then CMOV should not be selected
for that particular tuning (say if Pentium4 has slower CMOV than
compare+jump+assignment, -mtune=pentium4 should not emit CMOV, at least not
often), if you have examples of that, please file a bug to
http://gcc.gnu.org/bugzilla/. -mtune=generic should emit resp. not emit
CMOV depending on whether it is a win on the currently common CPUs.
Jakub
next prev parent reply other threads:[~2007-01-03 14:01 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-03 2:12 kernel + gcc 4.1 = several problems Mikael Pettersson
2007-01-03 2:20 ` Alistair John Strachan
2007-01-05 15:53 ` Alistair John Strachan
2007-01-05 16:02 ` Linus Torvalds
2007-01-05 16:19 ` Alistair John Strachan
2007-01-05 16:49 ` Linus Torvalds
2007-01-07 0:36 ` Pavel Machek
2007-01-07 0:57 ` Alistair John Strachan
2007-01-03 5:55 ` Willy Tarreau
2007-01-03 10:29 ` Alan
2007-01-03 10:32 ` Grzegorz Kulewski
2007-01-03 11:51 ` Jeff Garzik
2007-01-03 12:44 ` Alan
2007-01-03 13:32 ` Arjan van de Ven
2007-01-03 13:58 ` Jakub Jelinek [this message]
2007-01-03 14:28 ` Alan
2007-01-03 16:06 ` Linus Torvalds
2007-01-03 16:03 ` Linus Torvalds
2007-01-03 17:01 ` l.genoni
2007-01-03 17:45 ` Tim Schmielau
2007-01-03 20:24 ` Linus Torvalds
2007-01-03 17:06 ` l.genoni
2007-01-03 17:53 ` Mariusz Kozlowski
2007-01-03 19:47 ` Denis Vlasenko
2007-01-03 20:38 ` Linus Torvalds
2007-01-03 21:48 ` Denis Vlasenko
2007-01-03 22:13 ` Linus Torvalds
2007-01-03 21:44 ` Thomas Sailer
2007-01-03 22:08 ` Linus Torvalds
2007-01-04 3:08 ` Zou, Nanhai
2007-01-04 15:34 ` Linus Torvalds
-- strict thread matches above, loose matches on Subject: below --
2007-01-04 7:11 Albert Cahalan
2007-01-04 16:43 ` Segher Boessenkool
2007-01-04 17:04 ` Albert Cahalan
2007-01-04 17:24 ` Segher Boessenkool
2007-01-04 17:47 ` Linus Torvalds
2007-01-04 18:53 ` Segher Boessenkool
2007-01-04 19:10 ` Al Viro
2007-01-05 17:17 ` Pavel Machek
2007-01-06 8:23 ` Segher Boessenkool
2007-01-04 17:37 ` Linus Torvalds
2007-01-04 18:34 ` Segher Boessenkool
2007-01-04 22:02 ` Geert Bosch
2007-01-07 4:25 ` Denis Vlasenko
2007-01-07 4:45 ` Linus Torvalds
2007-01-07 5:26 ` Jeff Garzik
2007-01-07 15:10 ` Segher Boessenkool
2007-01-26 22:05 ` Michael K. Edwards
2007-01-04 18:08 ` Andreas Schwab
2006-12-20 14:21 Oops in 2.6.19.1 Alistair John Strachan
2006-12-30 16:59 ` Alistair John Strachan
2006-12-31 16:27 ` Adrian Bunk
2006-12-31 16:55 ` Alistair John Strachan
2007-01-02 21:10 ` kernel + gcc 4.1 = several problems Adrian Bunk
2007-01-02 21:56 ` Alistair John Strachan
2007-01-02 22:06 ` D. Hazelton
2007-01-02 23:24 ` Adrian Bunk
2007-01-02 23:41 ` D. Hazelton
2007-01-03 2:05 ` Horst H. von Brand
2007-01-02 22:13 ` Linus Torvalds
2007-01-02 23:18 ` Alistair John Strachan
2007-01-03 1:43 ` Linus Torvalds
2007-01-02 22:01 ` Linus Torvalds
2007-01-02 23:09 ` David Rientjes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070103135808.GS29911@devserv.devel.redhat.com \
--to=jakub@redhat.com \
--cc=76306.1226@compuserve.com \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arjan@infradead.org \
--cc=bunk@stusta.de \
--cc=greg@kroah.com \
--cc=kangur@polcom.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mikpe@it.uu.se \
--cc=s0348365@sms.ed.ac.uk \
--cc=torvalds@osdl.org \
--cc=yanmin_zhang@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).