Align with new GCC options for x86 Android

32-bit: +ssse3
64-bit: +sse4.2 +popcnt

Differential Revision: http://reviews.llvm.org/D4287

llvm-svn: 211688
This commit is contained in:
Alexey Volkov 2014-06-25 12:15:36 +00:00
parent b8fd41926c
commit 54ff080e39
2 changed files with 9 additions and 4 deletions

View File

@ -1426,9 +1426,13 @@ static void getX86TargetFeatures(const llvm::Triple &Triple,
Features.push_back("-fsgsbase");
}
// Add features to comply with gcc on Android
if (Triple.getEnvironment() == llvm::Triple::Android) {
// Add sse3 feature to comply with gcc on Android
Features.push_back("+sse3");
if (Triple.getArch() == llvm::Triple::x86_64) {
Features.push_back("+sse4.2");
Features.push_back("+popcnt");
} else
Features.push_back("+ssse3");
}
// Now add any that the user explicitly requested on the command line,

View File

@ -211,14 +211,15 @@
// RUN: | FileCheck --check-prefix=ANDROID-X86 %s
// ANDROID-X86: clang
// ANDROID-X86: "-target-cpu" "i686"
// ANDROID-X86: "-target-feature" "+sse3"
// ANDROID-X86: "-target-feature" "+ssse3"
// RUN: %clang -target x86_64-linux-android -### -S %s 2>&1 \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=ANDROID-X86_64 %s
// ANDROID-X86_64: clang
// ANDROID-X86_64: "-target-cpu" "x86-64"
// ANDROID-X86_64: "-target-feature" "+sse3"
// ANDROID-X86_64: "-target-feature" "+sse4.2"
// ANDROID-X86_64: "-target-feature" "+popcnt"
// RUN: %clang -target mips-linux-gnu -### -S %s 2>&1 | \
// RUN: FileCheck -check-prefix=MIPS %s