Skip to content

Commit bce2cc1

Browse files
committed
[clang] Set __GCC_*STRUCTIVE_SIZE on Aarch64
Before this change, we would set this to Clang's default of {64, 64}. Now, we explicitly set it to {256, 64} which matches our ARM behavior for ARMv8 targets and GCC's behavior for AArch64 targets.
1 parent 72b73c9 commit bce2cc1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

clang/lib/Basic/Targets/AArch64.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,11 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
227227
bool validatePointerAuthKey(const llvm::APSInt &value) const override;
228228

229229
const char *getBFloat16Mangling() const override { return "u6__bf16"; };
230+
231+
std::pair<unsigned, unsigned> hardwareInterferenceSizes() const override {
232+
return std::make_pair(256, 64);
233+
}
234+
230235
bool hasInt128Type() const override;
231236

232237
bool hasBitIntType() const override { return true; }

clang/test/Preprocessor/init-aarch64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@
125125
// AARCH64-NEXT: #define __FP_FAST_FMAF 1
126126
// AARCH64-NEXT: #define __FUNCTION_MULTI_VERSIONING_SUPPORT_LEVEL 202430
127127
// AARCH64-NEXT: #define __GCC_ASM_FLAG_OUTPUTS__ 1
128-
// AARCH64-NEXT: #define __GCC_CONSTRUCTIVE_SIZE {{.+}}
129-
// AARCH64-NEXT: #define __GCC_DESTRUCTIVE_SIZE {{.+}}
128+
// AARCH64-NEXT: #define __GCC_CONSTRUCTIVE_SIZE 64
129+
// AARCH64-NEXT: #define __GCC_DESTRUCTIVE_SIZE 256
130130
// AARCH64-NEXT: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
131131
// AARCH64-NEXT: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 1
132132
// AARCH64-NEXT: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1

0 commit comments

Comments
 (0)