Lines Matching refs:Features
683 // Target cpu features.
785 void getDefaultFeatures(llvm::StringMap<bool> &Features) const override;
787 bool handleTargetFeatures(std::vector<std::string> &Features,
926 /// configured set of features.
927 bool PPCTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
930 for (unsigned i = 0, e = Features.size(); i !=e; ++i) {
931 // Ignore disabled features.
932 if (Features[i][0] == '-')
935 StringRef Feature = StringRef(Features[i]).substr(1);
1109 void PPCTargetInfo::getDefaultFeatures(llvm::StringMap<bool> &Features) const {
1110 Features["altivec"] = llvm::StringSwitch<bool>(CPU)
1124 Features["qpx"] = (CPU == "a2q");
1352 // Define available target features
1871 static void setSSELevel(llvm::StringMap<bool> &Features, X86SSEEnum Level,
1873 static void setMMXLevel(llvm::StringMap<bool> &Features, MMX3DNowEnum Level,
1875 static void setXOPLevel(llvm::StringMap<bool> &Features, XOPEnum Level,
1877 void setFeatureEnabled(llvm::StringMap<bool> &Features,
1879 setFeatureEnabledImpl(Features, Name, Enabled);
1883 static void setFeatureEnabledImpl(llvm::StringMap<bool> &Features,
1885 void getDefaultFeatures(llvm::StringMap<bool> &Features) const override;
1887 bool handleTargetFeatures(std::vector<std::string> &Features,
2055 void X86TargetInfo::getDefaultFeatures(llvm::StringMap<bool> &Features) const {
2060 setFeatureEnabledImpl(Features, "sse2", true);
2073 setFeatureEnabledImpl(Features, "mmx", true);
2077 setFeatureEnabledImpl(Features, "sse", true);
2083 setFeatureEnabledImpl(Features, "sse2", true);
2088 setFeatureEnabledImpl(Features, "sse3", true);
2089 setFeatureEnabledImpl(Features, "cx16", true);
2092 setFeatureEnabledImpl(Features, "ssse3", true);
2093 setFeatureEnabledImpl(Features, "cx16", true);
2096 setFeatureEnabledImpl(Features, "sse4.1", true);
2097 setFeatureEnabledImpl(Features, "cx16", true);
2100 setFeatureEnabledImpl(Features, "ssse3", true);
2101 setFeatureEnabledImpl(Features, "cx16", true);
2104 setFeatureEnabledImpl(Features, "sse4.2", true);
2105 setFeatureEnabledImpl(Features, "aes", true);
2106 setFeatureEnabledImpl(Features, "cx16", true);
2107 setFeatureEnabledImpl(Features, "pclmul", true);
2110 setFeatureEnabledImpl(Features, "sse4.2", true);
2111 setFeatureEnabledImpl(Features, "cx16", true);
2114 setFeatureEnabledImpl(Features, "avx", true);
2115 setFeatureEnabledImpl(Features, "aes", true);
2116 setFeatureEnabledImpl(Features, "cx16", true);
2117 setFeatureEnabledImpl(Features, "pclmul", true);
2120 setFeatureEnabledImpl(Features, "avx", true);
2121 setFeatureEnabledImpl(Features, "aes", true);
2122 setFeatureEnabledImpl(Features, "pclmul", true);
2123 setFeatureEnabledImpl(Features, "rdrnd", true);
2124 setFeatureEnabledImpl(Features, "f16c", true);
2127 setFeatureEnabledImpl(Features, "avx2", true);
2128 setFeatureEnabledImpl(Features, "aes", true);
2129 setFeatureEnabledImpl(Features, "pclmul", true);
2130 setFeatureEnabledImpl(Features, "lzcnt", true);
2131 setFeatureEnabledImpl(Features, "rdrnd", true);
2132 setFeatureEnabledImpl(Features, "f16c", true);
2133 setFeatureEnabledImpl(Features, "bmi", true);
2134 setFeatureEnabledImpl(Features, "bmi2", true);
2135 setFeatureEnabledImpl(Features, "rtm", true);
2136 setFeatureEnabledImpl(Features, "fma", true);
2137 setFeatureEnabledImpl(Features, "cx16", true);
2140 setFeatureEnabledImpl(Features, "avx512f", true);
2141 setFeatureEnabledImpl(Features, "avx512cd", true);
2142 setFeatureEnabledImpl(Features, "avx512er", true);
2143 setFeatureEnabledImpl(Features, "avx512pf", true);
2144 setFeatureEnabledImpl(Features, "aes", true);
2145 setFeatureEnabledImpl(Features, "pclmul", true);
2146 setFeatureEnabledImpl(Features, "lzcnt", true);
2147 setFeatureEnabledImpl(Features, "rdrnd", true);
2148 setFeatureEnabledImpl(Features, "f16c", true);
2149 setFeatureEnabledImpl(Features, "bmi", true);
2150 setFeatureEnabledImpl(Features, "bmi2", true);
2151 setFeatureEnabledImpl(Features, "rtm", true);
2152 setFeatureEnabledImpl(Features, "fma", true);
2156 setFeatureEnabledImpl(Features, "mmx", true);
2162 setFeatureEnabledImpl(Features, "3dnow", true);
2167 setFeatureEnabledImpl(Features, "3dnowa", true);
2172 setFeatureEnabledImpl(Features, "sse", true);
2173 setFeatureEnabledImpl(Features, "3dnowa", true);
2179 setFeatureEnabledImpl(Features, "sse2", true);
2180 setFeatureEnabledImpl(Features, "3dnowa", true);
2185 setFeatureEnabledImpl(Features, "sse3", true);
2186 setFeatureEnabledImpl(Features, "3dnowa", true);
2189 setFeatureEnabledImpl(Features, "sse3", true);
2190 setFeatureEnabledImpl(Features, "sse4a", true);
2191 setFeatureEnabledImpl(Features, "3dnowa", true);
2192 setFeatureEnabledImpl(Features, "lzcnt", true);
2193 setFeatureEnabledImpl(Features, "popcnt", true);
2196 setFeatureEnabledImpl(Features, "ssse3", true);
2197 setFeatureEnabledImpl(Features, "sse4a", true);
2198 setFeatureEnabledImpl(Features, "cx16", true);
2199 setFeatureEnabledImpl(Features, "lzcnt", true);
2200 setFeatureEnabledImpl(Features, "popcnt", true);
2201 setFeatureEnabledImpl(Features, "prfchw", true);
2204 setFeatureEnabledImpl(Features, "avx", true);
2205 setFeatureEnabledImpl(Features, "sse4a", true);
2206 setFeatureEnabledImpl(Features, "lzcnt", true);
2207 setFeatureEnabledImpl(Features, "aes", true);
2208 setFeatureEnabledImpl(Features, "pclmul", true);
2209 setFeatureEnabledImpl(Features, "prfchw", true);
2210 setFeatureEnabledImpl(Features, "bmi", true);
2211 setFeatureEnabledImpl(Features, "f16c", true);
2212 setFeatureEnabledImpl(Features, "cx16", true);
2215 setFeatureEnabledImpl(Features, "xop", true);
2216 setFeatureEnabledImpl(Features, "lzcnt", true);
2217 setFeatureEnabledImpl(Features, "aes", true);
2218 setFeatureEnabledImpl(Features, "pclmul", true);
2219 setFeatureEnabledImpl(Features, "prfchw", true);
2220 setFeatureEnabledImpl(Features, "cx16", true);
2223 setFeatureEnabledImpl(Features, "avx2", true);
2224 setFeatureEnabledImpl(Features, "bmi2", true);
2228 setFeatureEnabledImpl(Features, "xop", true);
2229 setFeatureEnabledImpl(Features, "lzcnt", true);
2230 setFeatureEnabledImpl(Features, "aes", true);
2231 setFeatureEnabledImpl(Features, "pclmul", true);
2232 setFeatureEnabledImpl(Features, "prfchw", true);
2233 setFeatureEnabledImpl(Features, "bmi", true);
2234 setFeatureEnabledImpl(Features, "fma", true);
2235 setFeatureEnabledImpl(Features, "f16c", true);
2236 setFeatureEnabledImpl(Features, "tbm", true);
2237 setFeatureEnabledImpl(Features, "cx16", true);
2240 setFeatureEnabledImpl(Features, "sse", true);
2245 void X86TargetInfo::setSSELevel(llvm::StringMap<bool> &Features,
2250 Features["avx512f"] = true;
2252 Features["avx2"] = true;
2254 Features["avx"] = true;
2256 Features["sse4.2"] = true;
2258 Features["sse4.1"] = true;
2260 Features["ssse3"] = true;
2262 Features["sse3"] = true;
2264 Features["sse2"] = true;
2266 Features["sse"] = true;
2276 Features["sse"] = false;
2278 Features["sse2"] = Features["pclmul"] = Features["aes"] =
2279 Features["sha"] = false;
2281 Features["sse3"] = false;
2282 setXOPLevel(Features, NoXOP, false);
2284 Features["ssse3"] = false;
2286 Features["sse4.1"] = false;
2288 Features["sse4.2"] = false;
2290 Features["fma"] = Features["avx"] = Features["f16c"] = false;
2291 setXOPLevel(Features, FMA4, false);
2293 Features["avx2"] = false;
2295 Features["avx512f"] = Features["avx512cd"] = Features["avx512er"] =
2296 Features["avx512pf"] = false;
2300 void X86TargetInfo::setMMXLevel(llvm::StringMap<bool> &Features,
2305 Features["3dnowa"] = true;
2307 Features["3dnow"] = true;
2309 Features["mmx"] = true;
2319 Features["mmx"] = false;
2321 Features["3dnow"] = false;
2323 Features["3dnowa"] = false;
2327 void X86TargetInfo::setXOPLevel(llvm::StringMap<bool> &Features, XOPEnum Level,
2332 Features["xop"] = true;
2334 Features["fma4"] = true;
2335 setSSELevel(Features, AVX, true);
2337 Features["sse4a"] = true;
2338 setSSELevel(Features, SSE3, true);
2348 Features["sse4a"] = false;
2350 Features["fma4"] = false;
2352 Features["xop"] = false;
2356 void X86TargetInfo::setFeatureEnabledImpl(llvm::StringMap<bool> &Features,
2359 // options into llvm subtarget features.
2363 Features[Name] = Enabled;
2366 setMMXLevel(Features, MMX, Enabled);
2368 setSSELevel(Features, SSE1, Enabled);
2370 setSSELevel(Features, SSE2, Enabled);
2372 setSSELevel(Features, SSE3, Enabled);
2374 setSSELevel(Features, SSSE3, Enabled);
2376 setSSELevel(Features, SSE42, Enabled);
2378 setSSELevel(Features, SSE41, Enabled);
2380 setMMXLevel(Features, AMD3DNow, Enabled);
2382 setMMXLevel(Features, AMD3DNowAthlon, Enabled);
2385 setSSELevel(Features, SSE2, Enabled);
2388 setSSELevel(Features, SSE2, Enabled);
2390 setSSELevel(Features, AVX, Enabled);
2392 setSSELevel(Features, AVX2, Enabled);
2394 setSSELevel(Features, AVX512F, Enabled);
2397 setSSELevel(Features, AVX512F, Enabled);
2400 setSSELevel(Features, AVX, Enabled);
2402 setXOPLevel(Features, FMA4, Enabled);
2404 setXOPLevel(Features, XOP, Enabled);
2406 setXOPLevel(Features, SSE4A, Enabled);
2409 setSSELevel(Features, AVX, Enabled);
2412 setSSELevel(Features, SSE2, Enabled);
2417 /// configured set of features.
2418 bool X86TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
2421 for (unsigned i = 0, e = Features.size(); i !=e; ++i) {
2422 // Ignore disabled features.
2423 if (Features[i][0] == '-')
2426 StringRef Feature = StringRef(Features[i]).substr(1);
2518 assert(Features[i][0] == '+' && "Invalid target feature!");
2552 std::find(Features.begin(), Features.end(), "-popcnt") == Features.end()){
2554 Features.push_back("+popcnt");
2559 std::find(Features.begin(), Features.end(), "-prfchw") == Features.end()){
2561 Features.push_back("+prfchw");
2579 it = std::find(Features.begin(), Features.end(), "-mmx");
2580 if (it != Features.end())
2581 Features.erase(it);
3447 // Possible HWDiv features.
3474 // Initialized via features.
3696 void getDefaultFeatures(llvm::StringMap<bool> &Features) const override {
3698 Features["aapcs"] = true;
3700 Features["apcs"] = true;
3704 Features["vfp2"] = true;
3707 Features["vfp3"] = true;
3708 Features["neon"] = true;
3711 Features["vfp4"] = true;
3712 Features["neon"] = true;
3716 Features["vfp4"] = true;
3717 Features["neon"] = true;
3718 Features["hwdiv"] = true;
3719 Features["hwdiv-arm"] = true;
3721 Features["v8fp"] = true;
3722 Features["neon"] = true;
3723 Features["hwdiv"] = true;
3724 Features["hwdiv-arm"] = true;
3726 Features["fp-armv8"] = true;
3727 Features["neon"] = true;
3728 Features["hwdiv"] = true;
3729 Features["hwdiv-arm"] = true;
3730 Features["crc"] = true;
3731 Features["crypto"] = true;
3739 Features["hwdiv"] = true;
3740 Features["hwdiv-arm"] = true;
3742 Features["hwdiv"] = true;
3746 bool handleTargetFeatures(std::vector<std::string> &Features,
3753 for (unsigned i = 0, e = Features.size(); i != e; ++i) {
3754 if (Features[i] == "+soft-float")
3756 else if (Features[i] == "+soft-float-abi")
3758 else if (Features[i] == "+vfp2")
3760 else if (Features[i] == "+vfp3")
3762 else if (Features[i] == "+vfp4")
3764 else if (Features[i] == "+fp-armv8")
3766 else if (Features[i] == "+neon")
3768 else if (Features[i] == "+long64")
3770 else if (Features[i] == "+hwdiv")
3772 else if (Features[i] == "+hwdiv-arm")
3774 else if (Features[i] == "+crc")
3776 else if (Features[i] == "+crypto")
3786 Features.push_back("+neonfp");
3788 Features.push_back("-neonfp");
3792 it = std::find(Features.begin(), Features.end(), "+soft-float");
3793 if (it != Features.end())
3794 Features.erase(it);
3795 it = std::find(Features.begin(), Features.end(), "+soft-float-abi");
3796 if (it != Features.end())
3797 Features.erase(it);
4288 // FIXME: This should be based off of the target features in ARMleTargetInfo.
4442 void getDefaultFeatures(llvm::StringMap<bool> &Features) const override {
4445 Features["fp-armv8"] = true;
4446 Features["neon"] = true;
4447 Features["crypto"] = true;
4448 Features["crc"] = true;
4449 Features["zcm"] = true;
4450 Features["zcz"] = true;
4452 Features["fp-armv8"] = true;
4453 Features["neon"] = true;
4454 Features["crypto"] = true;
4455 Features["crc"] = true;
4459 bool handleTargetFeatures(std::vector<std::string> &Features,
4464 for (unsigned i = 0, e = Features.size(); i != e; ++i) {
4465 if (Features[i] == "+neon")
4467 if (Features[i] == "+crc")
4469 if (Features[i] == "+crypto")
4832 bool handleTargetFeatures(std::vector<std::string> &Features,
4835 for (unsigned i = 0, e = Features.size(); i != e; ++i)
4836 if (Features[i] == "+soft-float")
5337 void getDefaultFeatures(llvm::StringMap<bool> &Features) const override {
5342 Features["o32"] = false;
5343 Features["n64"] = false;
5345 Features[ABI] = true;
5347 Features["mips64r2"] = Features["cnmips"] = true;
5349 Features[CPU] = true;
5482 bool handleTargetFeatures(std::vector<std::string> &Features,
5492 for (std::vector<std::string>::iterator it = Features.begin(),
5493 ie = Features.end(); it != ie; ++it) {
5520 std::find(Features.begin(), Features.end(), "+soft-float");
5521 if (it != Features.end())
5522 Features.erase(it);
5835 void getDefaultFeatures(llvm::StringMap<bool> &Features) const override {
5902 // Define available target features
6436 // Compute the default target features, we need the target to handle this
6437 // because features may have dependencies on one another.
6438 llvm::StringMap<bool> Features;
6439 Target->getDefaultFeatures(Features);
6447 Target->setFeatureEnabled(Features, Name + 1, Enabled);
6450 // Add the features to the compile options.
6454 Opts->Features.clear();
6455 for (llvm::StringMap<bool>::const_iterator it = Features.begin(),
6456 ie = Features.end(); it != ie; ++it)
6457 Opts->Features.push_back((it->second ? "+" : "-") + it->first().str());
6458 if (!Target->handleTargetFeatures(Opts->Features, Diags))