Skip to content

Commit 114dda0

Browse files
committed
Update cpu_model.c and clang AArch64 targets
1 parent 64ff862 commit 114dda0

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

clang/lib/Basic/Targets/AArch64.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,7 @@ bool AArch64TargetInfo::hasFeature(StringRef Feature) const {
677677
.Case("sme", HasSME)
678678
.Case("sme-f64f64", HasSMEF64F64)
679679
.Case("sme-i16i64", HasSMEI16I64)
680+
.Case("sme-fa64", HasSMEFA64)
680681
.Cases("memtag", "memtag2", HasMTE)
681682
.Case("sb", HasSB)
682683
.Case("predres", HasPredRes)
@@ -806,6 +807,10 @@ bool AArch64TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
806807
HasBFloat16 = true;
807808
HasFullFP16 = true;
808809
}
810+
if (Feature == "+sme-fa64") {
811+
HasSME = true;
812+
HasSMEFA64 = true;
813+
}
809814
if (Feature == "+sb")
810815
HasSB = true;
811816
if (Feature == "+predres")

clang/lib/Basic/Targets/AArch64.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
7070
bool HasSME = false;
7171
bool HasSMEF64F64 = false;
7272
bool HasSMEI16I64 = false;
73+
bool HasSMEFA64 = false;
7374
bool HasSB = false;
7475
bool HasPredRes = false;
7576
bool HasSSBS = false;

compiler-rt/lib/builtins/cpu_model.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ typedef struct __ifunc_arg_t {
11341134
#define HWCAP2_SME_F64F64 (1 << 25)
11351135
#endif
11361136
#ifndef HWCAP2_SME_FA64
1137-
#define HWCAP2_SME_FA64 (1 << 26)
1137+
#define HWCAP2_SME_FA64 (1 << 30)
11381138
#endif
11391139
#ifndef HWCAP2_WFXT
11401140
#define HWCAP2_WFXT (1UL << 31)

llvm/lib/Target/AArch64/AArch64.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ def SME2Unsupported : AArch64Unsupported {
799799
}
800800

801801
def SMEUnsupported : AArch64Unsupported {
802-
let F = !listconcat([HasSME, HasSMEI16I64, HasSMEF16F16, HasSMEF64F64],
802+
let F = !listconcat([HasSME, HasSMEI16I64, HasSMEF16F16, HasSMEF64F64, HasSMEFA64],
803803
SME2Unsupported.F);
804804
}
805805

llvm/lib/Target/AArch64/AArch64Subtarget.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -499,15 +499,13 @@ bool AArch64Subtarget::isStreamingCompatible() const {
499499
}
500500

501501
bool AArch64Subtarget::isNeonAvailable() const {
502-
if (hasSMEFA64())
503-
return true;
504-
return (hasNEON() && !isStreaming() && !isStreamingCompatible());
502+
return hasNEON() &&
503+
(hasSMEFA64() || (!isStreaming() && !isStreamingCompatible()));
505504
}
506505

507506
bool AArch64Subtarget::isSVEAvailable() const {
508-
if (hasSMEFA64())
509-
return true;
510-
return (hasSVE() && !isStreaming() && !isStreamingCompatible());
507+
return hasSVE() &&
508+
(hasSMEFA64() || (!isStreaming() && !isStreamingCompatible()));
511509
}
512510

513511
// If return address signing is enabled, tail calls are emitted as follows:

0 commit comments

Comments
 (0)