LLVM API Documentation
00001 //===- TableGen'erated file -------------------------------------*- C++ -*-===// 00002 // 00003 // Subtarget Enumeration Source Fragment 00004 // 00005 // Automatically generated file, do not edit! 00006 // 00007 //===----------------------------------------------------------------------===// 00008 00009 #include "llvm/Target/SubtargetFeature.h" 00010 #include "llvm/Target/TargetInstrItineraries.h" 00011 00012 enum { 00013 }; 00014 00015 enum { 00016 Feature3DNow = 1 << 0, 00017 Feature3DNowA = 1 << 1, 00018 Feature64Bit = 1 << 2, 00019 FeatureMMX = 1 << 3, 00020 FeatureSSE1 = 1 << 4, 00021 FeatureSSE2 = 1 << 5, 00022 FeatureSSE3 = 1 << 6 00023 }; 00024 00025 // Sorted (by key) array of values for CPU features. 00026 static llvm::SubtargetFeatureKV FeatureKV[] = { 00027 { "3dnow", "Enable 3DNow! instructions", Feature3DNow }, 00028 { "3dnowa", "Enable 3DNow! Athlon instructions", Feature3DNowA }, 00029 { "64bit", "Enable 64-bit instructions", Feature64Bit }, 00030 { "mmx", "Enable MMX instructions", FeatureMMX }, 00031 { "sse", "Enable SSE instructions", FeatureSSE1 }, 00032 { "sse2", "Enable SSE2 instructions", FeatureSSE2 }, 00033 { "sse3", "Enable SSE3 instructions", FeatureSSE3 } 00034 }; 00035 00036 enum { 00037 FeatureKVSize = sizeof(FeatureKV)/sizeof(llvm::SubtargetFeatureKV) 00038 }; 00039 00040 // Sorted (by key) array of values for CPU subtype. 00041 static const llvm::SubtargetFeatureKV SubTypeKV[] = { 00042 { "athlon", "Select the athlon processor", FeatureMMX | Feature3DNow | Feature3DNowA }, 00043 { "athlon-4", "Select the athlon-4 processor", FeatureMMX | FeatureSSE1 | Feature3DNow | Feature3DNowA }, 00044 { "athlon-fx", "Select the athlon-fx processor", FeatureMMX | FeatureSSE1 | FeatureSSE2 | Feature3DNow | Feature3DNowA | Feature64Bit }, 00045 { "athlon-mp", "Select the athlon-mp processor", FeatureMMX | FeatureSSE1 | Feature3DNow | Feature3DNowA }, 00046 { "athlon-tbird", "Select the athlon-tbird processor", FeatureMMX | Feature3DNow | Feature3DNowA }, 00047 { "athlon-xp", "Select the athlon-xp processor", FeatureMMX | FeatureSSE1 | Feature3DNow | Feature3DNowA }, 00048 { "athlon64", "Select the athlon64 processor", FeatureMMX | FeatureSSE1 | FeatureSSE2 | Feature3DNow | Feature3DNowA | Feature64Bit }, 00049 { "c3", "Select the c3 processor", FeatureMMX | Feature3DNow }, 00050 { "c3-2", "Select the c3-2 processor", FeatureMMX | FeatureSSE1 }, 00051 { "generic", "Select the generic processor", 0 }, 00052 { "i386", "Select the i386 processor", 0 }, 00053 { "i486", "Select the i486 processor", 0 }, 00054 { "i686", "Select the i686 processor", 0 }, 00055 { "k6", "Select the k6 processor", FeatureMMX }, 00056 { "k6-2", "Select the k6-2 processor", FeatureMMX | Feature3DNow }, 00057 { "k6-3", "Select the k6-3 processor", FeatureMMX | Feature3DNow }, 00058 { "k8", "Select the k8 processor", FeatureMMX | FeatureSSE1 | FeatureSSE2 | Feature3DNow | Feature3DNowA | Feature64Bit }, 00059 { "nocona", "Select the nocona processor", FeatureMMX | FeatureSSE1 | FeatureSSE2 | FeatureSSE3 | Feature64Bit }, 00060 { "opteron", "Select the opteron processor", FeatureMMX | FeatureSSE1 | FeatureSSE2 | Feature3DNow | Feature3DNowA | Feature64Bit }, 00061 { "pentium", "Select the pentium processor", 0 }, 00062 { "pentium-m", "Select the pentium-m processor", FeatureMMX | FeatureSSE1 | FeatureSSE2 }, 00063 { "pentium-mmx", "Select the pentium-mmx processor", FeatureMMX }, 00064 { "pentium2", "Select the pentium2 processor", FeatureMMX }, 00065 { "pentium3", "Select the pentium3 processor", FeatureMMX | FeatureSSE1 }, 00066 { "pentium4", "Select the pentium4 processor", FeatureMMX | FeatureSSE1 | FeatureSSE2 }, 00067 { "pentiumpro", "Select the pentiumpro processor", 0 }, 00068 { "prescott", "Select the prescott processor", FeatureMMX | FeatureSSE1 | FeatureSSE2 | FeatureSSE3 }, 00069 { "winchip-c6", "Select the winchip-c6 processor", FeatureMMX }, 00070 { "winchip2", "Select the winchip2 processor", FeatureMMX | Feature3DNow }, 00071 { "x86-64", "Select the x86-64 processor", FeatureMMX | FeatureSSE1 | FeatureSSE2 | Feature64Bit }, 00072 { "yonah", "Select the yonah processor", FeatureMMX | FeatureSSE1 | FeatureSSE2 | FeatureSSE3 } 00073 }; 00074 00075 enum { 00076 SubTypeKVSize = sizeof(SubTypeKV)/sizeof(llvm::SubtargetFeatureKV) 00077 }; 00078 00079 00080 enum { 00081 ItinClassesSize = 1 00082 }; 00083 00084 // ParseSubtargetFeatures - Parses features string setting specified 00085 // subtarget options. 00086 void llvm::X86Subtarget::ParseSubtargetFeatures(const std::string &FS, 00087 const std::string &CPU) { 00088 SubtargetFeatures Features(FS); 00089 Features.setCPUIfNone(CPU); 00090 uint32_t Bits = Features.getBits(SubTypeKV, SubTypeKVSize, 00091 FeatureKV, FeatureKVSize); 00092 if ((Bits & Feature3DNow) != 0) X863DNowLevel = ThreeDNow; 00093 if ((Bits & Feature3DNowA) != 0) X863DNowLevel = ThreeDNowA; 00094 if ((Bits & Feature64Bit) != 0) Is64Bit = true; 00095 if ((Bits & FeatureMMX) != 0) X86SSELevel = MMX; 00096 if ((Bits & FeatureSSE1) != 0) X86SSELevel = SSE1; 00097 if ((Bits & FeatureSSE2) != 0) X86SSELevel = SSE2; 00098 if ((Bits & FeatureSSE3) != 0) X86SSELevel = SSE3; 00099 }