NeonMode
};
+ std::string CPU;
unsigned FPU;
unsigned CRC;
unsigned Crypto;
.Cases("cortex-a53", "cortex-a57", true)
.Case("cyclone", true)
.Default(false);
+ if (CPUKnown)
+ CPU = Name;
return CPUKnown;
}
(Feature == "neon" && FPU == NeonMode);
}
+ void getDefaultFeatures(llvm::StringMap<bool> &Features) const override {
+
+ if (CPU == "cyclone") {
+ Features["fp-armv8"] = true;
+ Features["neon"] = true;
+ Features["crypto"] = true;
+ Features["crc"] = true;
+ Features["zcm"] = true;
+ Features["zcz"] = true;
+ } else if (CPU == "cortex-a53" || CPU == "cortex-a57") {
+ Features["fp-armv8"] = true;
+ Features["neon"] = true;
+ Features["crypto"] = true;
+ Features["crc"] = true;
+ }
+}
+
bool handleTargetFeatures(std::vector<std::string> &Features,
DiagnosticsEngine &Diags) override {
FPU = FPUMode;
// RUN: %clang -target arm64-none-linux-gnu -mfpu=neon -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-NEON %s
// CHECK-NEON: __ARM_NEON 1
// CHECK-NEON: __ARM_NEON_FP 0xe
+
+// RUN: %clang -target aarch64-none-linux-gnu -mcpu=cortex-a53 -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-FEATURE %s
+// RUN: %clang -target aarch64-none-linux-gnu -mcpu=cortex-a57 -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-FEATURE %s
+// RUN: %clang -target aarch64-none-linux-gnu -mcpu=cyclone -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-FEATURE %s
+// CHECK-FEATURE: __ARM_FEATURE_CRC32 1
+// CHECK-FEATURE: __ARM_FEATURE_CRYPTO 1
+// CHECK-FEATURE: __ARM_NEON 1
+// CHECK-FEATURE: __ARM_NEON_FP 0xe
+
+