[PATCH] D118850: [PS4] Make __BIGGEST_ALIGNMENT__ 32bytes

Yuanfang Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 2 14:43:06 PST 2022


ychen created this revision.
ychen added a reviewer: probinson.
ychen requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

So it matches `__STDCPP_DEFAULT_NEW_ALIGNMENT__`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118850

Files:
  clang/include/clang/Basic/TargetInfo.h
  clang/lib/Basic/Targets/OSTargets.h
  clang/test/Preprocessor/init.c


Index: clang/test/Preprocessor/init.c
===================================================================
--- clang/test/Preprocessor/init.c
+++ clang/test/Preprocessor/init.c
@@ -1252,6 +1252,7 @@
 // RUN: %clang_cc1 -E -dM -ffreestanding -fgnuc-version=4.2.1 -triple=x86_64-scei-ps4 < /dev/null | FileCheck -match-full-lines -check-prefix PS4 %s
 //
 // PS4:#define _LP64 1
+// PS4:#define __BIGGEST_ALIGNMENT__ 32
 // PS4:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
 // PS4:#define __CHAR16_TYPE__ unsigned short
 // PS4:#define __CHAR32_TYPE__ unsigned int
Index: clang/lib/Basic/Targets/OSTargets.h
===================================================================
--- clang/lib/Basic/Targets/OSTargets.h
+++ clang/lib/Basic/Targets/OSTargets.h
@@ -570,6 +570,7 @@
     case llvm::Triple::x86_64:
       this->MCountName = ".mcount";
       this->NewAlign = 256;
+      this->SuitableAlign = 256;
       break;
     }
   }
Index: clang/include/clang/Basic/TargetInfo.h
===================================================================
--- clang/include/clang/Basic/TargetInfo.h
+++ clang/include/clang/Basic/TargetInfo.h
@@ -101,10 +101,10 @@
   unsigned char AccumScale;
   unsigned char LongAccumScale;
 
-  unsigned char SuitableAlign;
   unsigned char DefaultAlignForAttributeAligned;
   unsigned char MinGlobalAlign;
 
+  unsigned short SuitableAlign;
   unsigned short NewAlign;
   unsigned MaxVectorAlign;
   unsigned MaxTLSAlign;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118850.405454.patch
Type: text/x-patch
Size: 1450 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220202/9453dd38/attachment.bin>


More information about the cfe-commits mailing list