LLVM API Documentation

X86GenSubtarget.inc

Go to the documentation of this file.
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   FeatureAVX =  1 << 3,
00020   FeatureFMA3 =  1 << 4,
00021   FeatureFMA4 =  1 << 5,
00022   FeatureMMX =  1 << 6,
00023   FeatureSSE1 =  1 << 7,
00024   FeatureSSE2 =  1 << 8,
00025   FeatureSSE3 =  1 << 9,
00026   FeatureSSE41 =  1 << 10,
00027   FeatureSSE42 =  1 << 11,
00028   FeatureSSE4A =  1 << 12,
00029   FeatureSSSE3 =  1 << 13,
00030   FeatureSlowBTMem =  1 << 14
00031 };
00032 
00033 // Sorted (by key) array of values for CPU features.
00034 static const llvm::SubtargetFeatureKV FeatureKV[] = {
00035   { "3dnow", "Enable 3DNow! instructions", Feature3DNow, 0 },
00036   { "3dnowa", "Enable 3DNow! Athlon instructions", Feature3DNowA, Feature3DNow },
00037   { "64bit", "Support 64-bit instructions", Feature64Bit, 0 },
00038   { "avx", "Enable AVX instructions", FeatureAVX, 0 },
00039   { "fma3", "Enable three-operand fused multiple-add", FeatureFMA3, 0 },
00040   { "fma4", "Enable four-operand fused multiple-add", FeatureFMA4, 0 },
00041   { "mmx", "Enable MMX instructions", FeatureMMX, 0 },
00042   { "slow-bt-mem", "Bit testing of memory is slow", FeatureSlowBTMem, 0 },
00043   { "sse", "Enable SSE instructions", FeatureSSE1, FeatureMMX },
00044   { "sse2", "Enable SSE2 instructions", FeatureSSE2, FeatureSSE1 },
00045   { "sse3", "Enable SSE3 instructions", FeatureSSE3, FeatureSSE2 },
00046   { "sse41", "Enable SSE 4.1 instructions", FeatureSSE41, FeatureSSSE3 },
00047   { "sse42", "Enable SSE 4.2 instructions", FeatureSSE42, FeatureSSE41 },
00048   { "sse4a", "Support SSE 4a instructions", FeatureSSE4A, 0 },
00049   { "ssse3", "Enable SSSE3 instructions", FeatureSSSE3, FeatureSSE3 }
00050 };
00051 
00052 enum {
00053   FeatureKVSize = sizeof(FeatureKV)/sizeof(llvm::SubtargetFeatureKV)
00054 };
00055 
00056 // Sorted (by key) array of values for CPU subtype.
00057 static const llvm::SubtargetFeatureKV SubTypeKV[] = {
00058   { "amdfam10", "Select the amdfam10 processor", FeatureSSE3 | FeatureSSE4A | Feature3DNowA | Feature64Bit | FeatureSlowBTMem, 0 },
00059   { "athlon", "Select the athlon processor", FeatureMMX | Feature3DNowA | FeatureSlowBTMem, 0 },
00060   { "athlon-4", "Select the athlon-4 processor", FeatureSSE1 | Feature3DNowA | FeatureSlowBTMem, 0 },
00061   { "athlon-fx", "Select the athlon-fx processor", FeatureSSE2 | Feature3DNowA | Feature64Bit | FeatureSlowBTMem, 0 },
00062   { "athlon-mp", "Select the athlon-mp processor", FeatureSSE1 | Feature3DNowA | FeatureSlowBTMem, 0 },
00063   { "athlon-tbird", "Select the athlon-tbird processor", FeatureMMX | Feature3DNowA | FeatureSlowBTMem, 0 },
00064   { "athlon-xp", "Select the athlon-xp processor", FeatureSSE1 | Feature3DNowA | FeatureSlowBTMem, 0 },
00065   { "athlon64", "Select the athlon64 processor", FeatureSSE2 | Feature3DNowA | Feature64Bit | FeatureSlowBTMem, 0 },
00066   { "athlon64-sse3", "Select the athlon64-sse3 processor", FeatureSSE3 | Feature3DNowA | Feature64Bit | FeatureSlowBTMem, 0 },
00067   { "atom", "Select the atom processor", FeatureSSE3 | Feature64Bit | FeatureSlowBTMem, 0 },
00068   { "barcelona", "Select the barcelona processor", FeatureSSE3 | FeatureSSE4A | Feature3DNowA | Feature64Bit | FeatureSlowBTMem, 0 },
00069   { "c3", "Select the c3 processor", FeatureMMX | Feature3DNow, 0 },
00070   { "c3-2", "Select the c3-2 processor", FeatureSSE1, 0 },
00071   { "core2", "Select the core2 processor", FeatureSSSE3 | Feature64Bit | FeatureSlowBTMem, 0 },
00072   { "corei7", "Select the corei7 processor", FeatureSSE42 | Feature64Bit | FeatureSlowBTMem, 0 },
00073   { "generic", "Select the generic processor", 0, 0 },
00074   { "i386", "Select the i386 processor", 0, 0 },
00075   { "i486", "Select the i486 processor", 0, 0 },
00076   { "i586", "Select the i586 processor", 0, 0 },
00077   { "i686", "Select the i686 processor", 0, 0 },
00078   { "istanbul", "Select the istanbul processor", Feature3DNowA | Feature64Bit | FeatureSSE4A | Feature3DNowA, 0 },
00079   { "k6", "Select the k6 processor", FeatureMMX, 0 },
00080   { "k6-2", "Select the k6-2 processor", FeatureMMX | Feature3DNow, 0 },
00081   { "k6-3", "Select the k6-3 processor", FeatureMMX | Feature3DNow, 0 },
00082   { "k8", "Select the k8 processor", FeatureSSE2 | Feature3DNowA | Feature64Bit | FeatureSlowBTMem, 0 },
00083   { "k8-sse3", "Select the k8-sse3 processor", FeatureSSE3 | Feature3DNowA | Feature64Bit | FeatureSlowBTMem, 0 },
00084   { "nehalem", "Select the nehalem processor", FeatureSSE42 | Feature64Bit | FeatureSlowBTMem, 0 },
00085   { "nocona", "Select the nocona processor", FeatureSSE3 | Feature64Bit | FeatureSlowBTMem, 0 },
00086   { "opteron", "Select the opteron processor", FeatureSSE2 | Feature3DNowA | Feature64Bit | FeatureSlowBTMem, 0 },
00087   { "opteron-sse3", "Select the opteron-sse3 processor", FeatureSSE3 | Feature3DNowA | Feature64Bit | FeatureSlowBTMem, 0 },
00088   { "penryn", "Select the penryn processor", FeatureSSE41 | Feature64Bit | FeatureSlowBTMem, 0 },
00089   { "pentium", "Select the pentium processor", 0, 0 },
00090   { "pentium-m", "Select the pentium-m processor", FeatureSSE2 | FeatureSlowBTMem, 0 },
00091   { "pentium-mmx", "Select the pentium-mmx processor", FeatureMMX, 0 },
00092   { "pentium2", "Select the pentium2 processor", FeatureMMX, 0 },
00093   { "pentium3", "Select the pentium3 processor", FeatureSSE1, 0 },
00094   { "pentium4", "Select the pentium4 processor", FeatureSSE2, 0 },
00095   { "pentiumpro", "Select the pentiumpro processor", 0, 0 },
00096   { "prescott", "Select the prescott processor", FeatureSSE3 | FeatureSlowBTMem, 0 },
00097   { "sandybridge", "Select the sandybridge processor", FeatureSSE42 | FeatureAVX | Feature64Bit, 0 },
00098   { "shanghai", "Select the shanghai processor", Feature3DNowA | Feature64Bit | FeatureSSE4A | Feature3DNowA, 0 },
00099   { "winchip-c6", "Select the winchip-c6 processor", FeatureMMX, 0 },
00100   { "winchip2", "Select the winchip2 processor", FeatureMMX | Feature3DNow, 0 },
00101   { "x86-64", "Select the x86-64 processor", FeatureSSE2 | Feature64Bit | FeatureSlowBTMem, 0 },
00102   { "yonah", "Select the yonah processor", FeatureSSE3 | FeatureSlowBTMem, 0 }
00103 };
00104 
00105 enum {
00106   SubTypeKVSize = sizeof(SubTypeKV)/sizeof(llvm::SubtargetFeatureKV)
00107 };
00108 
00109 
00110 enum {
00111   ItinClassesSize = 1
00112 };
00113 
00114 // ParseSubtargetFeatures - Parses features string setting specified
00115 // subtarget options.
00116 std::string llvm::X86Subtarget::ParseSubtargetFeatures(const std::string &FS,
00117                                   const std::string &CPU) {
00118   SubtargetFeatures Features(FS);
00119   Features.setCPUIfNone(CPU);
00120   uint32_t Bits =  Features.getBits(SubTypeKV, SubTypeKVSize,
00121                                     FeatureKV, FeatureKVSize);
00122   if ((Bits & Feature3DNow) != 0 && X863DNowLevel < ThreeDNow) X863DNowLevel = ThreeDNow;
00123   if ((Bits & Feature3DNowA) != 0 && X863DNowLevel < ThreeDNowA) X863DNowLevel = ThreeDNowA;
00124   if ((Bits & Feature64Bit) != 0) HasX86_64 = true;
00125   if ((Bits & FeatureAVX) != 0) HasAVX = true;
00126   if ((Bits & FeatureFMA3) != 0) HasFMA3 = true;
00127   if ((Bits & FeatureFMA4) != 0) HasFMA4 = true;
00128   if ((Bits & FeatureMMX) != 0 && X86SSELevel < MMX) X86SSELevel = MMX;
00129   if ((Bits & FeatureSSE1) != 0 && X86SSELevel < SSE1) X86SSELevel = SSE1;
00130   if ((Bits & FeatureSSE2) != 0 && X86SSELevel < SSE2) X86SSELevel = SSE2;
00131   if ((Bits & FeatureSSE3) != 0 && X86SSELevel < SSE3) X86SSELevel = SSE3;
00132   if ((Bits & FeatureSSE41) != 0 && X86SSELevel < SSE41) X86SSELevel = SSE41;
00133   if ((Bits & FeatureSSE42) != 0 && X86SSELevel < SSE42) X86SSELevel = SSE42;
00134   if ((Bits & FeatureSSE4A) != 0) HasSSE4A = true;
00135   if ((Bits & FeatureSSSE3) != 0 && X86SSELevel < SSSE3) X86SSELevel = SSSE3;
00136   if ((Bits & FeatureSlowBTMem) != 0) IsBTMemSlow = true;
00137   return Features.getCPU();
00138 }