summaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86.td
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-10-06 09:17:41 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-10-06 09:17:41 +0000
commita26eb5e1a7e36521caff281da687764a0c43e428 (patch)
treee2893a109a201295b99a30ce13a746c811f0e904 /lib/Target/X86/X86.td
parentabc346ceda2374971513535f21cea5fcb4b7cf46 (diff)
downloadllvm-a26eb5e1a7e36521caff281da687764a0c43e428.tar.gz
llvm-a26eb5e1a7e36521caff281da687764a0c43e428.tar.bz2
llvm-a26eb5e1a7e36521caff281da687764a0c43e428.tar.xz
Still need to support -mcpu=<> or cross compilation will fail. Doh.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30764 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86.td')
-rw-r--r--lib/Target/X86/X86.td73
1 files changed, 73 insertions, 0 deletions
diff --git a/lib/Target/X86/X86.td b/lib/Target/X86/X86.td
index 7ed912bd9f..c4b3d8635f 100644
--- a/lib/Target/X86/X86.td
+++ b/lib/Target/X86/X86.td
@@ -17,6 +17,79 @@
include "../Target.td"
//===----------------------------------------------------------------------===//
+// X86 Subtarget features.
+//
+
+def Feature64Bit : SubtargetFeature<"64bit", "HasX86_64", "true",
+ "Support 64-bit instructions">;
+def FeatureMMX : SubtargetFeature<"mmx","X86SSELevel", "MMX",
+ "Enable MMX instructions">;
+def FeatureSSE1 : SubtargetFeature<"sse", "X86SSELevel", "SSE1",
+ "Enable SSE instructions">;
+def FeatureSSE2 : SubtargetFeature<"sse2", "X86SSELevel", "SSE2",
+ "Enable SSE2 instructions">;
+def FeatureSSE3 : SubtargetFeature<"sse3", "X86SSELevel", "SSE3",
+ "Enable SSE3 instructions">;
+def Feature3DNow : SubtargetFeature<"3dnow", "X863DNowLevel", "ThreeDNow",
+ "Enable 3DNow! instructions">;
+def Feature3DNowA : SubtargetFeature<"3dnowa", "X863DNowLevel", "ThreeDNowA",
+ "Enable 3DNow! Athlon instructions">;
+
+//===----------------------------------------------------------------------===//
+// X86 processors supported.
+//===----------------------------------------------------------------------===//
+
+class Proc<string Name, list<SubtargetFeature> Features>
+ : Processor<Name, NoItineraries, Features>;
+
+def : Proc<"generic", []>;
+def : Proc<"i386", []>;
+def : Proc<"i486", []>;
+def : Proc<"pentium", []>;
+def : Proc<"pentium-mmx", [FeatureMMX]>;
+def : Proc<"i686", []>;
+def : Proc<"pentiumpro", []>;
+def : Proc<"pentium2", [FeatureMMX]>;
+def : Proc<"pentium3", [FeatureMMX, FeatureSSE1]>;
+def : Proc<"pentium-m", [FeatureMMX, FeatureSSE1, FeatureSSE2]>;
+def : Proc<"pentium4", [FeatureMMX, FeatureSSE1, FeatureSSE2]>;
+def : Proc<"x86-64", [FeatureMMX, FeatureSSE1, FeatureSSE2,
+ Feature64Bit]>;
+def : Proc<"yonah", [FeatureMMX, FeatureSSE1, FeatureSSE2,
+ FeatureSSE3]>;
+def : Proc<"prescott", [FeatureMMX, FeatureSSE1, FeatureSSE2,
+ FeatureSSE3]>;
+def : Proc<"nocona", [FeatureMMX, FeatureSSE1, FeatureSSE2,
+ FeatureSSE3, Feature64Bit]>;
+def : Proc<"core2", [FeatureMMX, FeatureSSE1, FeatureSSE2,
+ FeatureSSE3, Feature64Bit]>;
+
+def : Proc<"k6", [FeatureMMX]>;
+def : Proc<"k6-2", [FeatureMMX, Feature3DNow]>;
+def : Proc<"k6-3", [FeatureMMX, Feature3DNow]>;
+def : Proc<"athlon", [FeatureMMX, Feature3DNow, Feature3DNowA]>;
+def : Proc<"athlon-tbird", [FeatureMMX, Feature3DNow, Feature3DNowA]>;
+def : Proc<"athlon-4", [FeatureMMX, FeatureSSE1, Feature3DNow,
+ Feature3DNowA]>;
+def : Proc<"athlon-xp", [FeatureMMX, FeatureSSE1, Feature3DNow,
+ Feature3DNowA]>;
+def : Proc<"athlon-mp", [FeatureMMX, FeatureSSE1, Feature3DNow,
+ Feature3DNowA]>;
+def : Proc<"k8", [FeatureMMX, FeatureSSE1, FeatureSSE2,
+ Feature3DNow, Feature3DNowA, Feature64Bit]>;
+def : Proc<"opteron", [FeatureMMX, FeatureSSE1, FeatureSSE2,
+ Feature3DNow, Feature3DNowA, Feature64Bit]>;
+def : Proc<"athlon64", [FeatureMMX, FeatureSSE1, FeatureSSE2,
+ Feature3DNow, Feature3DNowA, Feature64Bit]>;
+def : Proc<"athlon-fx", [FeatureMMX, FeatureSSE1, FeatureSSE2,
+ Feature3DNow, Feature3DNowA, Feature64Bit]>;
+
+def : Proc<"winchip-c6", [FeatureMMX]>;
+def : Proc<"winchip2", [FeatureMMX, Feature3DNow]>;
+def : Proc<"c3", [FeatureMMX, Feature3DNow]>;
+def : Proc<"c3-2", [FeatureMMX, FeatureSSE1]>;
+
+//===----------------------------------------------------------------------===//
// Register File Description
//===----------------------------------------------------------------------===//