[clang] 7e80976 - [PS4] Make __BIGGEST_ALIGNMENT__ 32bytes

Yuanfang Chen via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 17 10:12:50 PDT 2022


Author: Yuanfang Chen
Date: 2022-03-17T10:12:38-07:00
New Revision: 7e80976fdf3f0af87780f6490f39a1d500fc9886

URL: https://github.com/llvm/llvm-project/commit/7e80976fdf3f0af87780f6490f39a1d500fc9886
DIFF: https://github.com/llvm/llvm-project/commit/7e80976fdf3f0af87780f6490f39a1d500fc9886.diff

LOG: [PS4] Make __BIGGEST_ALIGNMENT__ 32bytes

So it matches `__STDCPP_DEFAULT_NEW_ALIGNMENT__`.

Reviewed By: probinson, aaron.ballman

Differential Revision: https://reviews.llvm.org/D118850

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/TargetInfo.h b/clang/include/clang/Basic/TargetInfo.h
index 94da7ac593a07..470d153d845de 100644
--- a/clang/include/clang/Basic/TargetInfo.h
+++ b/clang/include/clang/Basic/TargetInfo.h
@@ -101,10 +101,10 @@ struct TransferrableTargetInfo {
   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;

diff  --git a/clang/lib/Basic/Targets/OSTargets.h b/clang/lib/Basic/Targets/OSTargets.h
index f61652d285a89..9dd5debf1c47a 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -570,6 +570,7 @@ class LLVM_LIBRARY_VISIBILITY PS4OSTargetInfo : public OSTargetInfo<Target> {
     case llvm::Triple::x86_64:
       this->MCountName = ".mcount";
       this->NewAlign = 256;
+      this->SuitableAlign = 256;
       break;
     }
   }

diff  --git a/clang/test/Preprocessor/init.c b/clang/test/Preprocessor/init.c
index 33354e8975fd2..2d488159ea2c6 100644
--- a/clang/test/Preprocessor/init.c
+++ b/clang/test/Preprocessor/init.c
@@ -1247,6 +1247,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


        


More information about the cfe-commits mailing list