public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander van Heukelum <heukelum@mailshack.com>
To: Willy Tarreau <w@1wt.eu>, Ingo Molnar <mingo@elte.hu>
Cc: Alexander van Heukelum <heukelum@fastmail.fm>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Andi Kleen <andi@firstfloor.org>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] x86: K8, GEODE_LX, CRUSOE, EFFICEON and CORE2 support the cmovxx instructions.
Date: Sun, 16 Mar 2008 14:16:56 +0100	[thread overview]
Message-ID: <20080316131656.GA29207@mailshack.com> (raw)
In-Reply-To: <20080315211125.GB13012@1wt.eu>

x86: K8, GEODE_LX, CRUSOE, EFFICEON and CORE2 support CMOV.

Instead of summing up the cpu's that have support for the
cmov instruction, sum up the cpu's that don't.

GEODE_LX has no entry in arch/x86/Makefile_32.cpu, so it
did not get any -march or -mtune arguments at all. I quite
arbitrarily added -march=i686 -mtune=pentium-mmx. This way
gcc is allowed to use cmov instructions.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
---

Willy Tarreau said:
> > > Crusoe has CMOV as well.
> 
> So does GEODE_LX BTW

> in my experience (on user-space code), optimizing for "i586" gives
> good results. However, the cache is small, so everything which can
> reduce code size (especially loop/jump/function alignment) is worth
> checking.

Thanks for letting me know.

I chose i686 with pentium-mmx scheduling. This enables cmov, while
the scheduling is still pentium-like. If i586 is really better,
GEODE_LX should be listed as not using cmov at all (because the
compiler does not generate them).

Loop/jump/function alignment is automatically turned off if you
compile the kernel with CONFIG_CC_OPTIMIZE_FOR_SIZE=y so I think
it should not be set explicitly.

Qemu does not run GEODE_LX-kernels (no 3dNow).

Greetings,
	Alexander

diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 31e92fb..38af3e1 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -399,7 +399,7 @@ config X86_TSC
 # generates cmov.
 config X86_CMOV
 	def_bool y
-	depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7)
+	depends on !(MCYRIXIII || MGEODEGX1 || MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MK6 || M586MMX || M586TSC || M586 || M486 || M386 || X86_ELAN)
 
 config X86_MINIMUM_CPU_FAMILY
 	int
diff --git a/arch/x86/Makefile_32.cpu b/arch/x86/Makefile_32.cpu
index e372b58..b5e2438 100644
--- a/arch/x86/Makefile_32.cpu
+++ b/arch/x86/Makefile_32.cpu
@@ -38,8 +38,9 @@ cflags-$(CONFIG_MCORE2)		+= -march=i686 $(call tune,core2)
 # AMD Elan support
 cflags-$(CONFIG_X86_ELAN)	+= -march=i486
 
-# Geode GX1 support
+# Geode GX1 and GX/LX support
 cflags-$(CONFIG_MGEODEGX1)	+= -march=pentium-mmx
+cflags-$(CONFIG_MGEODE_LX)	+= -march=i686 $(call tune,pentium-mmx)
 
 # add at the end to overwrite eventual tuning options from earlier
 # cpu entries


  reply	other threads:[~2008-03-16 13:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-12 20:01 [PATCH] x86: merge the simple bitops and move them to bitops.h Alexander van Heukelum
2008-03-14 18:07 ` Jeremy Fitzhardinge
2008-03-14 19:43   ` Alexander van Heukelum
2008-03-14 19:55     ` Andi Kleen
2008-03-14 21:33       ` Alexander van Heukelum
2008-03-14 21:42         ` Andi Kleen
2008-03-14 22:01           ` Alexander van Heukelum
2008-03-14 22:18             ` Andi Kleen
2008-03-15 17:54               ` Alexander van Heukelum
2008-03-15 19:19         ` K8, EFFICEON and CORE2 support the cmovxx instructions Alexander van Heukelum
2008-03-15 20:18           ` H. Peter Anvin
2008-03-15 21:06             ` Alexander van Heukelum
2008-03-15 21:11               ` Willy Tarreau
2008-03-16 13:16                 ` Alexander van Heukelum [this message]
2008-03-21 12:38                   ` [PATCH] x86: K8, GEODE_LX, CRUSOE, " Ingo Molnar
2008-03-14 20:35     ` [PATCH v2] x86: merge the simple bitops and move them to bitops.h Alexander van Heukelum
2008-03-14 23:30       ` Randy Dunlap
2008-03-15 12:04         ` [PATCH v3] " Alexander van Heukelum
2008-03-21 12:35           ` Ingo Molnar
2008-03-14 21:15     ` [PATCH] " Jeremy Fitzhardinge

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=20080316131656.GA29207@mailshack.com \
    --to=heukelum@mailshack.com \
    --cc=andi@firstfloor.org \
    --cc=heukelum@fastmail.fm \
    --cc=hpa@zytor.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=w@1wt.eu \
    /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