From 70aa541dcb37f6571385610f5528a6ad6b11ab07 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Wed, 30 Jul 2008 09:32:27 -0700 Subject: [PATCH] Updating x86/amd64 arch support. Original patches by William Cooke and reported to Gentoo bug #224429, modified by me. --- ChangeLog | 5 +++ arch/amd64.py | 67 ++++++++++++++++++++++++++++-------- arch/x86.py | 94 +++++++++++++++++++++++++++++++++++++-------------- 3 files changed, 127 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 55ebdfc8..95e2e0c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 # $Id: $ + 30 Jul 2008; Chris Gianelloni arch/amd64.py, + arch/x86.py: + Updating x86/amd64 arch support. Original patches by William Cooke + and reported to Gentoo bug #224429, modified by me. + 28 Jul 2008; Chris Gianelloni modules/generic_stage_target.py, modules/livecd_stage2_target.py, modules/snapshot_target.py, modules/stage4_target.py, diff --git a/arch/amd64.py b/arch/amd64.py index 2ede817e..40593cfc 100644 --- a/arch/amd64.py +++ b/arch/amd64.py @@ -8,28 +8,67 @@ class generic_amd64(builder.generic): self.settings["CHROOT"]="chroot" class arch_amd64(generic_amd64): - "builder class for generic amd64 (athlon64/opteron)" + "builder class for generic amd64 (Intel and AMD)" def __init__(self,myspec): generic_amd64.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -pipe" self.settings["CHOST"]="x86_64-pc-linux-gnu" self.settings["HOSTUSE"]=["mmx","sse","sse2"] -#class arch_nocona(generic_x86): -# def __init__(self,myspec): -# generic_amd64.__init__(self,myspec) -# self.settings["CFLAGS"]="-O2 -march=nocona -pipe" -# self.settings["HOSTUSE"]=["mmx","sse","sse2"] +class arch_nocona(generic_amd64): + "improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE, SSE2 and SSE3 support" + def __init__(self,myspec): + generic_amd64.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=nocona -pipe" + self.settings["HOSTUSE"]=["mmx","sse","sse2"] -#class arch_core2(generic_x86): -# def __init__(self,myspec): -# generic_amd64.__init__(self,myspec) -# self.settings["CFLAGS"]="-O2 -march=core2 -pipe" -# self.settings["HOSTUSE"]=["mmx","sse","sse2"] +# Requires gcc 4.3 to use this class +class arch_core2(generic_amd64): + "Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3 support" + def __init__(self,myspec): + generic_amd64.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=core2 -pipe" + self.settings["HOSTUSE"]=["mmx","sse","sse2","ssse3"] + +class arch_k8(generic_amd64): + "generic k8, opteron and athlon64 support" + def __init__(self,myspec): + generic_amd64.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=k8 -pipe" + self.settings["CHOST"]="x86_64-pc-linux-gnu" + self.settings["HOSTUSE"]=["mmx","sse","sse2","3dnow"] + +class arch_k8_sse3(generic_amd64): + "improved versions of k8, opteron and athlon64 with SSE3 support" + def __init__(self,myspec): + generic_amd64.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=k8-sse3 -pipe" + self.settings["CHOST"]="x86_64-pc-linux-gnu" + self.settings["HOSTUSE"]=["mmx","sse","sse2","3dnow"] + +class arch_amdfam10(generic_amd64): + "AMD Family 10h core based CPUs with x86-64 instruction set support" + def __init__(self,myspec): + generic_amd64.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=amdfam10 -pipe" + self.settings["CHOST"]="x86_64-pc-linux-gnu" + self.settings["HOSTUSE"]=["mmx","sse","sse2","3dnow"] def register(): - "Inform main catalyst program of the contents of this plugin." + "inform main catalyst program of the contents of this plugin" return ({ - "amd64" : arch_amd64 - }, ("x86_64", )) + "amd64" : arch_amd64, + "k8" : arch_k8, + "opteron" : arch_k8, + "athlon64" : arch_k8, + "athlonfx" : arch_k8 + "nocona" : arch_nocona, +# uncomment when gcc 4.3 is stable and delete this line +# "core2" : arch_core2, +# "k8-sse3" : arch_k8_sse3, +# "opteron-sse3" : arch_k8_sse3, +# "athlon64-sse3" : arch_k8_sse3, +# "amdfam10" : arch_amdfam10, +# "barcelona" : arch_amdfam10 + }, ("x86_64","amd64","nocona")) diff --git a/arch/x86.py b/arch/x86.py index 23f7d190..9f3d39d3 100644 --- a/arch/x86.py +++ b/arch/x86.py @@ -1,6 +1,6 @@ import builder,os -from catalyst_support import * +from catalyst_supportimport * class generic_x86(builder.generic): "abstract base class for all x86 builders" @@ -22,73 +22,107 @@ class arch_x86(generic_x86): self.settings["CHOST"]="i386-pc-linux-gnu" class arch_i386(generic_x86): + "Intel i386 CPU" def __init__(self,myspec): generic_x86.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=i386 -pipe" self.settings["CHOST"]="i386-pc-linux-gnu" class arch_i486(generic_x86): + "Intel i486 CPU" def __init__(self,myspec): generic_x86.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=i486 -pipe" self.settings["CHOST"]="i486-pc-linux-gnu" class arch_i586(generic_x86): + "Intel Pentium CPU" def __init__(self,myspec): generic_x86.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=i586 -pipe" self.settings["CHOST"]="i586-pc-linux-gnu" class arch_i686(generic_x86): + "Intel Pentium Pro CPU" def __init__(self,myspec): generic_x86.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=i686 -pipe" self.settings["CHOST"]="i686-pc-linux-gnu" -class arch_athlon(generic_x86): - def __init__(self,myspec): - generic_x86.__init__(self,myspec) - self.settings["CFLAGS"]="-O2 -march=athlon -pipe" - self.settings["CHOST"]="i686-pc-linux-gnu" - self.settings["HOSTUSE"]=["mmx","3dnow"] - -class arch_athlon_xp(generic_x86): +class arch_pentium_mmx(generic_x86): + "Intel Pentium MMX CPU with MMX support" def __init__(self,myspec): generic_x86.__init__(self,myspec) - self.settings["CFLAGS"]="-O2 -march=athlon-xp -pipe" - self.settings["CHOST"]="i686-pc-linux-gnu" - self.settings["HOSTUSE"]=["mmx","3dnow","sse"] - -class arch_pentium_mmx(arch_i586): - def __init__(self,myspec): - arch_i586.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=pentium-mmx -pipe" self.settings["HOSTUSE"]=["mmx"] class arch_pentium2(generic_x86): + "Intel Pentium 2 CPU with MMX support" def __init__(self,myspec): - arch_i686.__init__(self,myspec) + generic_x86.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=pentium2 -pipe" self.settings["HOSTUSE"]=["mmx"] class arch_pentium3(generic_x86): + "Intel Pentium 3 CPU with MMX and SSE support" def __init__(self,myspec): - arch_i686.__init__(self,myspec) + generic_x86.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=pentium3 -pipe" self.settings["HOSTUSE"]=["mmx","sse"] class arch_pentium4(generic_x86): + "Intel Pentium 4 CPU with MMX, SSE and SSE2 support" def __init__(self,myspec): - arch_i686.__init__(self,myspec) + generic_x86.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=pentium4 -pipe" self.settings["HOSTUSE"]=["mmx","sse","sse2"] +class arch_pentium_m(generic_x86): + "Intel Pentium M CPU with MMX, SSE and SSE2 support" + def __init__(self,myspec): + generic_x86.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=pentium-m -pipe" + self.settings["HOSTUSER"]=["mmx","sse","sse2"] + class arch_prescott(generic_x86): + "improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 support" def __init__(self,myspec): - arch_i686.__init__(self,myspec) + generic_x86.__init__(self,myspec) self.settings["CFLAGS"]="-O2 -march=prescott -pipe" self.settings["HOSTUSE"]=["mmx","sse","sse2"] +class arch_k6(generic_x86): + "AMD K6 CPU with MMX support" + def __init__(self,myspec): + generic_x86.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=k6 -pipe" + self.settings["CHOST"]="i686-pc-linux-gnu" + self.settings["HOSTUSE"]=["mmx"] + +class arch_k6_2(generic_x86): + "AMD K6-2 CPU with MMX and 3dNOW! support" + def __init__(self,myspec): + generic_x86.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=k6-2 -pipe" + self.settings["CHOST"]="i686-pc-linux-gnu" + self.settings["HOSTUSE"]=["mmx","3dnow"] + +class arch_athlon(generic_x86): + "AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch support" + def __init__(self,myspec): + generic_x86.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=athlon -pipe" + self.settings["CHOST"]="i686-pc-linux-gnu" + self.settings["HOSTUSE"]=["mmx","3dnow"] + +class arch_athlon_xp(generic_x86): + "improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE support" + def __init__(self,myspec): + generic_x86.__init__(self,myspec) + self.settings["CFLAGS"]="-O2 -march=athlon-xp -pipe" + self.settings["CHOST"]="i686-pc-linux-gnu" + self.settings["HOSTUSE"]=["mmx","3dnow","sse"] + def register(): "Inform main catalyst program of the contents of this plugin." return ({ @@ -97,13 +131,23 @@ def register(): "i486" : arch_i486, "i586" : arch_i586, "i686" : arch_i686, - "athlon" : arch_athlon, - "athlon-xp" : arch_athlon_xp, - "athlon-mp" : arch_athlon_xp, - "pentium-mmx" : arch_pentium_mmx, + "pentium" : arch_i586, "pentium2" : arch_pentium2, "pentium3" : arch_pentium3, + "pentium3m" : arch_pentium3, + "pentium-m" : arch_pentium_m, "pentium4" : arch_pentium4, - "prescott" : arch_prescott + "pentium4m" : arch_pentium4, + "pentiumpro" : arch_i686, + "pentium-mmx" : arch_pentium_mmx, + "prescott" : arch_prescott, + "k6" : arch_k6, + "k6-2" : arch_k6_2, + "k6-3" : arch_k6_2, + "athlon" : arch_athlon, + "athlon-tbird" : arch_athlon, + "athlon-4" : arch_athlon_xp, + "athlon-xp" : arch_athlon_xp, + "athlon-mp" : arch_athlon_xp }, ('i386', 'i486', 'i586', 'i686')) -- 2.26.2