Make F16C feature imply AVX. Matches GCC behavior.

llvm-svn: 190776
This commit is contained in:
Craig Topper 2013-09-16 04:54:13 +00:00
parent a6d204ec68
commit 31db3a2efc
2 changed files with 14 additions and 1 deletions

View File

@ -2172,7 +2172,7 @@ void X86TargetInfo::setSSELevel(llvm::StringMap<bool> &Features,
case SSE42:
Features["sse4.2"] = false;
case AVX:
Features["fma"] = Features["avx"] = false;
Features["fma"] = Features["avx"] = Features["f16c"] = false;
setXOPLevel(Features, FMA4, false);
case AVX2:
Features["avx2"] = false;
@ -2290,6 +2290,9 @@ void X86TargetInfo::setFeatureEnabled(llvm::StringMap<bool> &Features,
setXOPLevel(Features, XOP, Enabled);
} else if (Name == "sse4a") {
setXOPLevel(Features, SSE4A, Enabled);
} else if (Name == "f16c") {
if (Enabled)
setSSELevel(Features, AVX, Enabled);
}
}

View File

@ -152,3 +152,13 @@
// RUN: %clang -target i386-unknown-unknown -march=atom -msse -mno-mmx -x c -E -dM -o - %s | FileCheck --check-prefix=SSENOMMX %s
// SSENOMMX-NOT: #define __MMX__ 1
// RUN: %clang -target i386-unknown-unknown -march=atom -mf16c -x c -E -dM -o - %s | FileCheck --check-prefix=F16C %s
// F16C: #define __AVX__ 1
// F16C: #define __F16C__ 1
// RUN: %clang -target i386-unknown-unknown -march=atom -mf16c -mno-avx -x c -E -dM -o - %s | FileCheck --check-prefix=F16CNOAVX %s
// F16CNOAVX-NOT: #define __AVX__ 1
// F16CNOAVX-NOT: #define __F16C__ 1