Replaced ALIGN macro with alignas

This commit is contained in:
Tom Lally 2022-08-27 20:34:04 +01:00
parent ad1b38c3a9
commit f33540faa1
3 changed files with 16 additions and 18 deletions

View file

@ -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 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 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 // x64 data
uint64 ALIGN(16) _x64XMM_xorNegateMaskBottom[2]; alignas(16) uint64 _x64XMM_xorNegateMaskBottom[2];
uint64 ALIGN(16) _x64XMM_xorNegateMaskPair[2]; alignas(16) uint64 _x64XMM_xorNegateMaskPair[2];
uint64 ALIGN(16) _x64XMM_xorNOTMask[2]; alignas(16) uint64 _x64XMM_xorNOTMask[2];
uint64 ALIGN(16) _x64XMM_andAbsMaskBottom[2]; alignas(16) uint64 _x64XMM_andAbsMaskBottom[2];
uint64 ALIGN(16) _x64XMM_andAbsMaskPair[2]; alignas(16) uint64 _x64XMM_andAbsMaskPair[2];
uint32 ALIGN(16) _x64XMM_andFloatAbsMaskBottom[4]; alignas(16) uint32 _x64XMM_andFloatAbsMaskBottom[4];
uint64 ALIGN(16) _x64XMM_singleWordMask[2]; alignas(16) uint64 _x64XMM_singleWordMask[2];
double ALIGN(16) _x64XMM_constDouble1_1[2]; alignas(16) double _x64XMM_constDouble1_1[2];
double ALIGN(16) _x64XMM_constDouble0_0[2]; alignas(16) double _x64XMM_constDouble0_0[2];
float ALIGN(16) _x64XMM_constFloat0_0[2]; alignas(16) float _x64XMM_constFloat0_0[2];
float ALIGN(16) _x64XMM_constFloat1_1[2]; alignas(16) float _x64XMM_constFloat1_1[2];
float ALIGN(16) _x64XMM_constFloatMin[2]; alignas(16) float _x64XMM_constFloatMin[2];
uint32 ALIGN(16) _x64XMM_flushDenormalMask1[4]; alignas(16) uint32 _x64XMM_flushDenormalMask1[4];
uint32 ALIGN(16) _x64XMM_flushDenormalMaskResetSignBits[4]; alignas(16) uint32 _x64XMM_flushDenormalMaskResetSignBits[4];
// PSQ load/store scale tables // PSQ load/store scale tables
double _psq_ld_scale_ps0_ps1[64 * 2]; double _psq_ld_scale_ps0_ps1[64 * 2];
double _psq_ld_scale_ps0_1[64 * 2]; double _psq_ld_scale_ps0_1[64 * 2];

View file

@ -229,7 +229,6 @@ typedef union _LARGE_INTEGER {
#define DLLEXPORT __declspec(dllexport) #define DLLEXPORT __declspec(dllexport)
#define DLLIMPORT __declspec(dllimport) #define DLLIMPORT __declspec(dllimport)
#define DEBUG_BREAK __debugbreak() #define DEBUG_BREAK __debugbreak()
#define ALIGN(N) __declspec(align(N))
#define NOINLINE __declspec(noinline) #define NOINLINE __declspec(noinline)
#define ASSUME(X) __assume(X) #define ASSUME(X) __assume(X)
#define THREAD_LOCAL __declspec(thread) #define THREAD_LOCAL __declspec(thread)
@ -240,7 +239,6 @@ typedef union _LARGE_INTEGER {
// fixme: random stack overflow solution. use with caution // fixme: random stack overflow solution. use with caution
#include <csignal> #include <csignal>
#define DEBUG_BREAK raise(SIGTRAP) #define DEBUG_BREAK raise(SIGTRAP)
#define ALIGN(N) __attribute__((aligned (N)))
#define NOINLINE __attribute__((noinline)) #define NOINLINE __attribute__((noinline))
// fixme: random stack overflow solution. use it with caution // fixme: random stack overflow solution. use it with caution
#define ASSUME(X) do { if (!(X)) __builtin_unreachable(); } while (0) #define ASSUME(X) do { if (!(X)) __builtin_unreachable(); } while (0)

View file

@ -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) 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); AESNI128_KeyExpansionDecrypt(key, expandedKey);
if (iv) 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) 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); AESNI128_KeyExpansionEncrypt(key, expandedKey);
// encrypt single ECB block // encrypt single ECB block
__m128i feedback; __m128i feedback;