File tree Expand file tree Collapse file tree
lib/CodeGen/TargetBuiltins Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7306,9 +7306,10 @@ Value *CodeGenFunction::EmitAArch64CpuInit() {
73067306Value *CodeGenFunction::EmitAArch64CpuSupports (const CallExpr *E) {
73077307 const Expr *ArgExpr = E->getArg (0 )->IgnoreParenCasts ();
73087308 StringRef ArgStr = cast<StringLiteral>(ArgExpr)->getString ();
7309+ llvm::SmallVector<StringRef, 8 > OrigFeatures;
7310+ ArgStr.split (OrigFeatures, " +" );
73097311 llvm::SmallVector<StringRef, 8 > Features;
7310- ArgStr.split (Features, " +" );
7311- for (auto &Feature : Features) {
7312+ for (StringRef Feature : OrigFeatures) {
73127313 Feature = Feature.trim ();
73137314 if (!llvm::AArch64::parseFMVExtension (Feature))
73147315 return Builder.getFalse ();
Original file line number Diff line number Diff line change @@ -217,6 +217,21 @@ int test_versions() {
217217 return code ();
218218}
219219
220+ // CHECK: Function Attrs: noinline nounwind optnone
221+ // CHECK-LABEL: define dso_local i32 @test_long(
222+ // CHECK-SAME: ) #[[ATTR0]] {
223+ // CHECK-NEXT: [[ENTRY:.*:]]
224+ // CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
225+ // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 577586773744664575
226+ // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 577586773744664575
227+ // CHECK-NEXT: [[TMP3:%.*]] = and i1 true, [[TMP2]]
228+ // CHECK-NEXT: [[CONV:%.*]] = zext i1 [[TMP3]] to i32
229+ // CHECK-NEXT: ret i32 [[CONV]]
230+ //
231+ int test_long (void ) {
232+ return __builtin_cpu_supports ("rng+flagm+flagm2+fp16fml+dotprod+sm4+rdm+lse+fp+simd+aes+bf16+bti+crc+cssc+dit+dotprod+f32mm+f64mm+flagm+fp16fml+fp16+i8mm+mops+sha2+sha3+sm4+sve2" );
233+ }
234+
220235//.
221236// CHECK: attributes #[[ATTR0]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
222237// CHECK: attributes #[[ATTR1]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+fp-armv8,+neon" }
You can’t perform that action at this time.
0 commit comments