Skip to content

Commit

Permalink
[hexagon] Add {con,de}structive interference size defn
Browse files Browse the repository at this point in the history
This support was originally added in 72c373b ([C++17] Support
__GCC_[CON|DE]STRUCTIVE_SIZE (llvm#89446), 2024-04-26).  We're overriding
the values for Hexagon here.

Signed-off-by: Brian Cain <bcain@quicinc.com>
  • Loading branch information
androm3da committed Jun 10, 2024
1 parent dcb71c0 commit 537cda8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clang/lib/Basic/Targets/Hexagon.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ class LLVM_LIBRARY_VISIBILITY HexagonTargetInfo : public TargetInfo {
}

bool hasBitIntType() const override { return true; }

std::pair<unsigned, unsigned> hardwareInterferenceSizes() const override {
return std::make_pair(32, 32);
}
};
} // namespace targets
} // namespace clang
Expand Down
9 changes: 9 additions & 0 deletions clang/test/Preprocessor/hexagon-predefines.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,12 @@
// CHECK-ATOMIC: #define __CLANG_ATOMIC_POINTER_LOCK_FREE 2
// CHECK-ATOMIC: #define __CLANG_ATOMIC_SHORT_LOCK_FREE 2
// CHECK-ATOMIC: #define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 2

// RUN: %clang_cc1 -E -dM -triple hexagon-unknown-linux-musl \
// RUN: -target-cpu hexagonv67 | FileCheck \
// RUN: %s -check-prefix CHECK-INTERFERENCE
// RUN: %clang_cc1 -E -dM -triple hexagon-unknown-none-elf \
// RUN: -target-cpu hexagonv67 | FileCheck \
// RUN: %s -check-prefix CHECK-INTERFERENCE
// CHECK-INTERFERENCE: #define __GCC_CONSTRUCTIVE_SIZE 32
// CHECK-INTERFERENCE: #define __GCC_DESTRUCTIVE_SIZE 32

0 comments on commit 537cda8

Please sign in to comment.