Skip to content

Commit 5e5afd1

Browse files
Jenkinsronlieb
authored andcommitted
merge main into amd-staging
Change-Id: I1ff565e230dbaa3b1c82ca6bfbc971c38fecc6a8
2 parents aeef72e + 1b44c3a commit 5e5afd1

File tree

275 files changed

+6768
-1187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+6768
-1187
lines changed

bolt/unittests/Core/MCPlusBuilder.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,15 @@ INSTANTIATE_TEST_SUITE_P(AArch64, MCPlusBuilderTester,
9090
::testing::Values(Triple::aarch64));
9191

9292
TEST_P(MCPlusBuilderTester, AliasX0) {
93-
uint64_t AliasesX0[] = {AArch64::W0, AArch64::X0, AArch64::W0_W1,
93+
uint64_t AliasesX0[] = {AArch64::W0, AArch64::W0_HI,
94+
AArch64::X0, AArch64::W0_W1,
9495
AArch64::X0_X1, AArch64::X0_X1_X2_X3_X4_X5_X6_X7};
9596
size_t AliasesX0Count = sizeof(AliasesX0) / sizeof(*AliasesX0);
9697
testRegAliases(Triple::aarch64, AArch64::X0, AliasesX0, AliasesX0Count);
9798
}
9899

99100
TEST_P(MCPlusBuilderTester, AliasSmallerX0) {
100-
uint64_t AliasesX0[] = {AArch64::W0, AArch64::X0};
101+
uint64_t AliasesX0[] = {AArch64::W0, AArch64::W0_HI, AArch64::X0};
101102
size_t AliasesX0Count = sizeof(AliasesX0) / sizeof(*AliasesX0);
102103
testRegAliases(Triple::aarch64, AArch64::X0, AliasesX0, AliasesX0Count, true);
103104
}

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ Resolutions to C++ Defect Reports
279279
C Language Changes
280280
------------------
281281

282+
- Extend clang's ``<limits.h>`` to define ``LONG_LONG_*`` macros for Android's bionic.
283+
282284
C2y Feature Support
283285
^^^^^^^^^^^^^^^^^^^
284286

@@ -585,6 +587,8 @@ Bug Fixes in This Version
585587
the unsupported type instead of the ``register`` keyword (#GH109776).
586588
- Fixed a crash when emit ctor for global variant with flexible array init (#GH113187).
587589
- Fixed a crash when GNU statement expression contains invalid statement (#GH113468).
590+
- Fixed a failed assertion when using ``__attribute__((noderef))`` on an
591+
``_Atomic``-qualified type (#GH116124).
588592

589593
Bug Fixes to Compiler Builtins
590594
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -784,6 +788,7 @@ X86 Support
784788
- Support ISA of ``AMX-MOVRS``.
785789
- Support ISA of ``AMX-AVX512``.
786790
- Support ISA of ``AMX-TF32``.
791+
- Support ISA of ``MOVRS``.
787792

788793
Arm and AArch64 Support
789794
^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/Attr.td

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,9 @@ def TargetELF : TargetSpec {
477477
def TargetELFOrMachO : TargetSpec {
478478
let ObjectFormats = ["ELF", "MachO"];
479479
}
480+
def TargetIFuncSupport : TargetSpec {
481+
let CustomCode = [{ Target.supportsIFunc() }];
482+
}
480483
def TargetWindowsArm64EC : TargetSpec {
481484
let CustomCode = [{ Target.getTriple().isWindowsArm64EC() }];
482485
}
@@ -1855,7 +1858,7 @@ def IBOutletCollection : InheritableAttr {
18551858
let Documentation = [Undocumented];
18561859
}
18571860

1858-
def IFunc : Attr, TargetSpecificAttr<TargetELFOrMachO> {
1861+
def IFunc : Attr, TargetSpecificAttr<TargetIFuncSupport> {
18591862
let Spellings = [GCC<"ifunc">];
18601863
let Args = [StringArgument<"Resolver">];
18611864
let Subjects = SubjectList<[Function]>;

clang/include/clang/Basic/AttrDocs.td

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6051,12 +6051,19 @@ declared entity. The entity must not have weak linkage; for example, in C++,
60516051
it cannot be applied to a declaration if a definition at that location would be
60526052
considered inline.
60536053

6054-
Not all targets support this attribute. ELF target support depends on both the
6055-
linker and runtime linker, and is available in at least lld 4.0 and later,
6056-
binutils 2.20.1 and later, glibc v2.11.1 and later, and FreeBSD 9.1 and later.
6057-
Mach-O targets support it, but with slightly different semantics: the resolver
6058-
is run at first call, instead of at load time by the runtime linker. Targets
6059-
other than ELF and Mach-O currently do not support this attribute.
6054+
Not all targets support this attribute:
6055+
6056+
- ELF target support depends on both the linker and runtime linker, and is
6057+
available in at least lld 4.0 and later, binutils 2.20.1 and later, glibc
6058+
v2.11.1 and later, and FreeBSD 9.1 and later.
6059+
- Mach-O targets support it, but with slightly different semantics: the resolver
6060+
is run at first call, instead of at load time by the runtime linker.
6061+
- Windows target supports it on AArch64, but with different semantics: the
6062+
``ifunc`` is replaced with a global function pointer, and the call is replaced
6063+
with an indirect call. The function pointer is initialized by a constructor
6064+
that calls the resolver.
6065+
- Baremetal target supports it on AVR.
6066+
- Other targets currently do not support this attribute.
60606067
}];
60616068
}
60626069

clang/include/clang/Basic/BuiltinsX86.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,9 @@ TARGET_BUILTIN(__builtin_ia32_vpdpbuud256, "V8iV8iV8iV8i", "ncV:256:", "avxvnnii
660660
TARGET_BUILTIN(__builtin_ia32_vpdpbuuds128, "V4iV4iV4iV4i", "ncV:128:", "avxvnniint8|avx10.2-256")
661661
TARGET_BUILTIN(__builtin_ia32_vpdpbuuds256, "V8iV8iV8iV8i", "ncV:256:", "avxvnniint8|avx10.2-256")
662662

663+
// MOVRS
664+
TARGET_BUILTIN(__builtin_ia32_prefetchrs, "vvC*", "nc", "movrs")
665+
663666
TARGET_BUILTIN(__builtin_ia32_gather3div2df, "V2dV2dvC*V2OiUcIi", "nV:128:", "avx512vl")
664667
TARGET_BUILTIN(__builtin_ia32_gather3div2di, "V2OiV2OivC*V2OiUcIi", "nV:128:", "avx512vl")
665668
TARGET_BUILTIN(__builtin_ia32_gather3div4df, "V4dV4dvC*V4OiUcIi", "nV:256:", "avx512vl")

clang/include/clang/Basic/BuiltinsX86_64.def

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ TARGET_BUILTIN(__builtin_ia32_aand64, "vv*SOi", "n", "raoint")
228228
TARGET_BUILTIN(__builtin_ia32_aor64, "vv*SOi", "n", "raoint")
229229
TARGET_BUILTIN(__builtin_ia32_axor64, "vv*SOi", "n", "raoint")
230230

231+
// MOVRS
232+
TARGET_BUILTIN(__builtin_ia32_movrsqi, "ScvC*", "n", "movrs")
233+
TARGET_BUILTIN(__builtin_ia32_movrshi, "SsvC*", "n", "movrs")
234+
TARGET_BUILTIN(__builtin_ia32_movrssi, "SivC*", "n", "movrs")
235+
TARGET_BUILTIN(__builtin_ia32_movrsdi, "SLLivC*", "n", "movrs")
236+
231237
// MOVRS and AVX10.2
232238
TARGET_BUILTIN(__builtin_ia32_vmovrsb128, "V16cV16cC*", "nV:128:", "movrs,avx10.2-256")
233239
TARGET_BUILTIN(__builtin_ia32_vmovrsb256, "V32cV32cC*", "nV:256:", "movrs,avx10.2-256")

clang/include/clang/Basic/TargetInfo.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,6 +1497,10 @@ class TargetInfo : public TransferrableTargetInfo,
14971497
bool supportsIFunc() const {
14981498
if (getTriple().isOSBinFormatMachO())
14991499
return true;
1500+
if (getTriple().isOSWindows() && getTriple().isAArch64())
1501+
return true;
1502+
if (getTriple().getArch() == llvm::Triple::ArchType::avr)
1503+
return true;
15001504
return getTriple().isOSBinFormatELF() &&
15011505
((getTriple().isOSLinux() && !getTriple().isMusl()) ||
15021506
getTriple().isOSFreeBSD());

clang/include/clang/Basic/arm_sve.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1964,7 +1964,7 @@ let SVETargetGuard = "sve2,lut,bf16", SMETargetGuard = "sme2,lut,bf16" in {
19641964
////////////////////////////////////////////////////////////////////////////////
19651965
// SVE2 - Optional
19661966

1967-
let SVETargetGuard = "sve2-aes", SMETargetGuard = InvalidMode in {
1967+
let SVETargetGuard = "sve2,sve-aes", SMETargetGuard = InvalidMode in {
19681968
def SVAESD : SInst<"svaesd[_{d}]", "ddd", "Uc", MergeNone, "aarch64_sve_aesd", [IsOverloadNone]>;
19691969
def SVAESIMC : SInst<"svaesimc[_{d}]", "dd", "Uc", MergeNone, "aarch64_sve_aesimc", [IsOverloadNone]>;
19701970
def SVAESE : SInst<"svaese[_{d}]", "ddd", "Uc", MergeNone, "aarch64_sve_aese", [IsOverloadNone]>;

clang/lib/Basic/Targets/AArch64.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions &Opts,
473473
if (HasSVE2p1)
474474
Builder.defineMacro("__ARM_FEATURE_SVE2p1", "1");
475475

476-
if (HasSVE2 && HasSVE2AES)
476+
if (HasSVE2 && HasSVEAES)
477477
Builder.defineMacro("__ARM_FEATURE_SVE2_AES", "1");
478478

479479
if (HasSVE2 && HasSVE2BitPerm)
@@ -769,7 +769,7 @@ bool AArch64TargetInfo::hasFeature(StringRef Feature) const {
769769
.Case("f32mm", FPU & SveMode && HasMatmulFP32)
770770
.Case("f64mm", FPU & SveMode && HasMatmulFP64)
771771
.Case("sve2", FPU & SveMode && HasSVE2)
772-
.Case("sve2-pmull128", FPU & SveMode && HasSVE2AES)
772+
.Case("sve-aes", HasSVEAES)
773773
.Case("sve2-bitperm", FPU & SveMode && HasSVE2BitPerm)
774774
.Case("sve2-sha3", FPU & SveMode && HasSVE2SHA3)
775775
.Case("sve2-sm4", FPU & SveMode && HasSVE2SM4)
@@ -861,12 +861,10 @@ bool AArch64TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
861861
HasSVE2 = true;
862862
HasSVE2p1 = true;
863863
}
864-
if (Feature == "+sve2-aes") {
864+
if (Feature == "+sve-aes") {
865865
FPU |= NeonMode;
866-
FPU |= SveMode;
867866
HasFullFP16 = true;
868-
HasSVE2 = true;
869-
HasSVE2AES = true;
867+
HasSVEAES = true;
870868
}
871869
if (Feature == "+sve2-sha3") {
872870
FPU |= NeonMode;

clang/lib/Basic/Targets/AArch64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
7878
bool HasBFloat16 = false;
7979
bool HasSVE2 = false;
8080
bool HasSVE2p1 = false;
81-
bool HasSVE2AES = false;
81+
bool HasSVEAES = false;
8282
bool HasSVE2SHA3 = false;
8383
bool HasSVE2SM4 = false;
8484
bool HasSVEB16B16 = false;

0 commit comments

Comments
 (0)