Skip to content

Commit 957f929

Browse files
authored
[RISCV] Set __GCC_CONSTRUCTIVE_SIZE/__GCC_DESTRUCTIVE_SIZE to 64 (#162986)
These two macros were added in #89446. But the previous values may not be reasonable for RV64 systems because most of them have a cache line size 64B. So here we change them to 64.
1 parent 1b4f226 commit 957f929

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,9 @@ RISC-V Support
598598
- Add `-march=unset` to clear any previous `-march=` value. This ISA string will
599599
be computed from `-mcpu` or the platform default.
600600

601+
- `__GCC_CONSTRUCTIVE_SIZE` and `__GCC_DESTRUCTIVE_SIZE` are changed to 64. These values are
602+
unstable according to `Clang's documentation <https://clang.llvm.org/docs/LanguageExtensions.html#gcc-destructive-size-and-gcc-constructive-size>`_.
603+
601604
CUDA/HIP Language Changes
602605
^^^^^^^^^^^^^^^^^^^^^^^^^
603606

clang/lib/Basic/Targets/RISCV.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class RISCVTargetInfo : public TargetInfo {
126126
llvm::APInt getFMVPriority(ArrayRef<StringRef> Features) const override;
127127

128128
std::pair<unsigned, unsigned> hardwareInterferenceSizes() const override {
129-
return std::make_pair(32, 32);
129+
return std::make_pair(64, 64);
130130
}
131131

132132
bool supportsCpuSupports() const override { return getTriple().isOSLinux(); }
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: %clang_cc1 -E -dM -triple=riscv32 < /dev/null | \
2+
// RUN: FileCheck -match-full-lines -check-prefixes=RV32 %s
3+
// RUN: %clang_cc1 -E -dM -triple=riscv64 < /dev/null | \
4+
// RUN: FileCheck -match-full-lines -check-prefixes=RV64 %s
5+
6+
// RV32: #define __GCC_CONSTRUCTIVE_SIZE 64
7+
// RV32: #define __GCC_DESTRUCTIVE_SIZE 64
8+
9+
// RV64: #define __GCC_CONSTRUCTIVE_SIZE 64
10+
// RV64: #define __GCC_DESTRUCTIVE_SIZE 64

0 commit comments

Comments
 (0)