};
unsigned FPU;
+ unsigned CRC;
unsigned Crypto;
static const Builtin::Info BuiltinInfo[];
Builder.defineMacro("__ARM_NEON_FP", "7");
}
+ if (CRC)
+ Builder.defineMacro("__ARM_FEATURE_CRC32");
+
if (Crypto) {
Builder.defineMacro("__ARM_FEATURE_CRYPTO");
}
bool handleTargetFeatures(std::vector<std::string> &Features,
DiagnosticsEngine &Diags) override {
FPU = FPUMode;
+ CRC = 0;
Crypto = 0;
for (unsigned i = 0, e = Features.size(); i != e; ++i) {
if (Features[i] == "+neon")
FPU = NeonMode;
+ if (Features[i] == "+crc")
+ CRC = 1;
if (Features[i] == "+crypto")
Crypto = 1;
}
};
unsigned FPU;
+ unsigned CRC;
unsigned Crypto;
static const Builtin::Info BuiltinInfo[];
Builder.defineMacro("__ARM_NEON_FP", "7");
}
+ if (CRC)
+ Builder.defineMacro("__ARM_FEATURE_CRC32");
+
if (Crypto)
Builder.defineMacro("__ARM_FEATURE_CRYPTO");
}
bool handleTargetFeatures(std::vector<std::string> &Features,
DiagnosticsEngine &Diags) override {
FPU = FPUMode;
+ CRC = 0;
Crypto = 0;
for (unsigned i = 0, e = Features.size(); i != e; ++i) {
if (Features[i] == "+neon")
FPU = NeonMode;
+ if (Features[i] == "+crc")
+ CRC = 1;
if (Features[i] == "+crypto")
Crypto = 1;
}
Features.push_back("-crypto");
Features.push_back("-neon");
}
+
+ // En/disable crc
+ if (Arg *A = Args.getLastArg(options::OPT_mcrc,
+ options::OPT_mnocrc)) {
+ if (A->getOption().matches(options::OPT_mcrc))
+ Features.push_back("+crc");
+ else
+ Features.push_back("-crc");
+ }
}
static void getTargetFeatures(const Driver &D, const llvm::Triple &Triple,
// CHECK: __ARM_ARCH_PROFILE 'A'
// CHECK-NOT: __ARM_FEATURE_BIG_ENDIAN
// CHECK: __ARM_FEATURE_CLZ 1
+// CHECK-NOT: __ARM_FEATURE_CRC32 1
// CHECK-NOT: __ARM_FEATURE_CRYPTO 1
// CHECK: __ARM_FEATURE_DIV 1
// CHECK: __ARM_FEATURE_FMA 1
// RUN: %clang -target aarch64-none-linux-gnu -mfpu=crypto-neon-fp-armv8 -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-CRYPTO %s
// CHECK-CRYPTO: __ARM_FEATURE_CRYPTO 1
+// RUN: %clang -target aarch64-none-linux-gnu -mcrc -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-CRC32 %s
+// RUN: %clang -target arm64-none-linux-gnu -mcrc -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-CRC32 %s
+// CHECK-CRC32: __ARM_FEATURE_CRC32 1
+
// RUN: %clang -target aarch64-none-linux-gnu -ffast-math -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-FASTMATH %s
// CHECK-FASTMATH: __ARM_FP_FAST 1