From f33540faa1808bdf268521d0c41205038baca3b9 Mon Sep 17 00:00:00 2001 From: Tom Lally Date: Sat, 27 Aug 2022 20:34:04 +0100 Subject: [PATCH] Replaced ALIGN macro with alignas --- .../HW/Espresso/Recompiler/PPCRecompiler.h | 28 +++++++++---------- src/Common/precompiled.h | 2 -- src/util/crypto/aes128.cpp | 4 +-- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/Cafe/HW/Espresso/Recompiler/PPCRecompiler.h b/src/Cafe/HW/Espresso/Recompiler/PPCRecompiler.h index 7a74749d..ee0454ce 100644 --- a/src/Cafe/HW/Espresso/Recompiler/PPCRecompiler.h +++ b/src/Cafe/HW/Espresso/Recompiler/PPCRecompiler.h @@ -345,20 +345,20 @@ typedef struct PPCRecFunction_t* ppcRecompilerFuncTable[PPC_REC_ALIGN_TO_4MB(PPC_REC_CODE_AREA_SIZE/4)]; // one virtual-function pointer for each potential ppc instruction PPCREC_JUMP_ENTRY ppcRecompilerDirectJumpTable[PPC_REC_ALIGN_TO_4MB(PPC_REC_CODE_AREA_SIZE/4)]; // lookup table for ppc offset to native code function // x64 data - uint64 ALIGN(16) _x64XMM_xorNegateMaskBottom[2]; - uint64 ALIGN(16) _x64XMM_xorNegateMaskPair[2]; - uint64 ALIGN(16) _x64XMM_xorNOTMask[2]; - uint64 ALIGN(16) _x64XMM_andAbsMaskBottom[2]; - uint64 ALIGN(16) _x64XMM_andAbsMaskPair[2]; - uint32 ALIGN(16) _x64XMM_andFloatAbsMaskBottom[4]; - uint64 ALIGN(16) _x64XMM_singleWordMask[2]; - double ALIGN(16) _x64XMM_constDouble1_1[2]; - double ALIGN(16) _x64XMM_constDouble0_0[2]; - float ALIGN(16) _x64XMM_constFloat0_0[2]; - float ALIGN(16) _x64XMM_constFloat1_1[2]; - float ALIGN(16) _x64XMM_constFloatMin[2]; - uint32 ALIGN(16) _x64XMM_flushDenormalMask1[4]; - uint32 ALIGN(16) _x64XMM_flushDenormalMaskResetSignBits[4]; + alignas(16) uint64 _x64XMM_xorNegateMaskBottom[2]; + alignas(16) uint64 _x64XMM_xorNegateMaskPair[2]; + alignas(16) uint64 _x64XMM_xorNOTMask[2]; + alignas(16) uint64 _x64XMM_andAbsMaskBottom[2]; + alignas(16) uint64 _x64XMM_andAbsMaskPair[2]; + alignas(16) uint32 _x64XMM_andFloatAbsMaskBottom[4]; + alignas(16) uint64 _x64XMM_singleWordMask[2]; + alignas(16) double _x64XMM_constDouble1_1[2]; + alignas(16) double _x64XMM_constDouble0_0[2]; + alignas(16) float _x64XMM_constFloat0_0[2]; + alignas(16) float _x64XMM_constFloat1_1[2]; + alignas(16) float _x64XMM_constFloatMin[2]; + alignas(16) uint32 _x64XMM_flushDenormalMask1[4]; + alignas(16) uint32 _x64XMM_flushDenormalMaskResetSignBits[4]; // PSQ load/store scale tables double _psq_ld_scale_ps0_ps1[64 * 2]; double _psq_ld_scale_ps0_1[64 * 2]; diff --git a/src/Common/precompiled.h b/src/Common/precompiled.h index b5ee0936..09b485cb 100644 --- a/src/Common/precompiled.h +++ b/src/Common/precompiled.h @@ -229,7 +229,6 @@ typedef union _LARGE_INTEGER { #define DLLEXPORT __declspec(dllexport) #define DLLIMPORT __declspec(dllimport) #define DEBUG_BREAK __debugbreak() - #define ALIGN(N) __declspec(align(N)) #define NOINLINE __declspec(noinline) #define ASSUME(X) __assume(X) #define THREAD_LOCAL __declspec(thread) @@ -240,7 +239,6 @@ typedef union _LARGE_INTEGER { // fixme: random stack overflow solution. use with caution #include #define DEBUG_BREAK raise(SIGTRAP) - #define ALIGN(N) __attribute__((aligned (N))) #define NOINLINE __attribute__((noinline)) // fixme: random stack overflow solution. use it with caution #define ASSUME(X) do { if (!(X)) __builtin_unreachable(); } while (0) diff --git a/src/util/crypto/aes128.cpp b/src/util/crypto/aes128.cpp index bfd42232..2c7bfa35 100644 --- a/src/util/crypto/aes128.cpp +++ b/src/util/crypto/aes128.cpp @@ -759,7 +759,7 @@ void AESNI128_CBC_decryptWithExpandedKey(const unsigned char *in, void __aesni__AES128_CBC_decrypt(uint8* output, uint8* input, uint32 length, const uint8* key, const uint8* iv) { - ALIGN(16) uint8 expandedKey[11 * 16]; + alignas(16) uint8 expandedKey[11 * 16]; AESNI128_KeyExpansionDecrypt(key, expandedKey); if (iv) { @@ -774,7 +774,7 @@ void __aesni__AES128_CBC_decrypt(uint8* output, uint8* input, uint32 length, con void __aesni__AES128_ECB_encrypt(uint8* input, const uint8* key, uint8* output) { - ALIGN(16) uint8 expandedKey[11 * 16]; + alignas(16) uint8 expandedKey[11 * 16]; AESNI128_KeyExpansionEncrypt(key, expandedKey); // encrypt single ECB block __m128i feedback;