mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Denis Vlasenko <vda@ilport.com.ua>
To: Zwane Mwaikambo <zwane@arm.linux.org.uk>
Cc: Chris White <chriswhite@gentoo.org>,
	Margit Schubert-While <margitsw@t-online.de>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.13/14 x86 Makefile - Pentiums penalized ?
Date: Wed, 14 Sep 2005 10:51:13 +0300	[thread overview]
Message-ID: <200509141051.13197.vda@ilport.com.ua> (raw)
In-Reply-To: <Pine.LNX.4.61.0509140015250.13185@montezuma.fsmlabs.com>

> > > It's documented as being suboptimal to use inc/dec due to it modifying all 
> > > of eflags resulting in dependency related stalls. add/sub only modifies 
> > > one bit of eflags so is more optimal. However there is a problem of 
> > 
> > ?! add/sub doesn't modify "only one bit in eflags", it modifies all.
> > In fact, it's dec/inc which does not modify all bits.
> > It doesn't touch 'carry' bit (IIRC).
> > 
> > If inc/dec is slower on P4, it must be just another P4 quirk.
> 
> You're right about the add and the number of modified bits. The documented 
> part is found in the P4 optimisation manual;
> 
> "The inc and dec instructions should always be avoided. Using add
>  and sub instructions instead avoids data dependence and improves
>  performance."

I read this as "get saner processor".

But frankly any CPU optimization manuals, not just Intel's,
go to semi-absurd suggestions like "align all data
and branch targets to $BIGNUM bytes", "do not use instruction X
(because we failed to make it work reasonably fast), use Y".

Of course next gen CPU will prefer Y over X
(for example, AMD's recomended way to do NOPs).
--
vda

  reply	other threads:[~2005-09-14  7:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-13  6:04 Margit Schubert-While
2005-09-14  5:14 ` Chris White
2005-09-14  6:48   ` Zwane Mwaikambo
2005-09-14  6:59     ` Denis Vlasenko
2005-09-14  7:21       ` Zwane Mwaikambo
2005-09-14  7:51         ` Denis Vlasenko [this message]
2005-09-14  7:48       ` Margit Schubert-While
2005-09-14  7:54         ` Denis Vlasenko
2005-09-14  7:02   ` Margit Schubert-While

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=200509141051.13197.vda@ilport.com.ua \
    --to=vda@ilport.com.ua \
    --cc=chriswhite@gentoo.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=margitsw@t-online.de \
    --cc=zwane@arm.linux.org.uk \
    /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

all inboxes | Powered by JetHome®