From 6e7778eddbd88715688e99339dc57f6cbdd765d7 Mon Sep 17 00:00:00 2001 From: "Mr. eXoDia" Date: Tue, 30 Dec 2014 02:01:11 +0100 Subject: [PATCH] compiler generic XmmRegister types (mingw doesn't like M128A) --- SDK/C/TitanEngine.h | 22 +++++++++----------- TitanEngine/TitanEngine.Debugger.Context.cpp | 8 +++---- TitanEngine/stdafx.h | 14 +++++++++---- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/SDK/C/TitanEngine.h b/SDK/C/TitanEngine.h index 0576db7..771b4c9 100644 --- a/SDK/C/TitanEngine.h +++ b/SDK/C/TitanEngine.h @@ -10,14 +10,6 @@ #include #include -#ifdef __GNUC__ -typedef struct DECLSPEC_ALIGN(16) _M128A -{ - ULONGLONG Low; - LONGLONG High; -} M128A, *PM128A; -#endif //__GNUC__ - #pragma pack(push, 1) // Global.Constant.Structure.Declaration: @@ -596,8 +588,14 @@ typedef struct typedef struct { - M128A Low; //XMM/SSE part - M128A High; //AVX part + ULONGLONG Low; + LONGLONG High; +} XmmRegister_t; + +typedef struct +{ + XmmRegister_t Low; //XMM/SSE part + XmmRegister_t High; //AVX part } YmmRegister_t; typedef struct @@ -657,10 +655,10 @@ typedef struct x87FPU_t x87fpu; DWORD MxCsr; #ifdef _WIN64 - M128A XmmRegisters[16]; + XmmRegister_t XmmRegisters[16]; YmmRegister_t YmmRegisters[16]; #else // x86 - M128A XmmRegisters[8]; + XmmRegister_t XmmRegisters[8]; YmmRegister_t YmmRegisters[8]; #endif } TITAN_ENGINE_CONTEXT_t; diff --git a/TitanEngine/TitanEngine.Debugger.Context.cpp b/TitanEngine/TitanEngine.Debugger.Context.cpp index ccde362..76b53f1 100644 --- a/TitanEngine/TitanEngine.Debugger.Context.cpp +++ b/TitanEngine/TitanEngine.Debugger.Context.cpp @@ -962,8 +962,8 @@ __declspec(dllexport) bool TITCALL SetAVXContext(HANDLE hActiveThread, TITAN_ENG return false; DWORD FeatureLength; - PM128A Sse = (PM128A)_LocateXStateFeature(Context, XSTATE_LEGACY_SSE, &FeatureLength); - PM128A Avx = (PM128A)_LocateXStateFeature(Context, XSTATE_AVX, NULL); + XmmRegister_t* Sse = (XmmRegister_t*)_LocateXStateFeature(Context, XSTATE_LEGACY_SSE, &FeatureLength); + XmmRegister_t* Avx = (XmmRegister_t*)_LocateXStateFeature(Context, XSTATE_AVX, NULL); int NumberOfRegisters = FeatureLength / sizeof(Sse[0]); if(Sse != NULL) //If the feature is unsupported by the processor it will return NULL @@ -1022,8 +1022,8 @@ __declspec(dllexport) bool TITCALL GetAVXContext(HANDLE hActiveThread, TITAN_ENG return false; DWORD FeatureLength; - PM128A Sse = (PM128A)_LocateXStateFeature(Context, XSTATE_LEGACY_SSE, &FeatureLength); - PM128A Avx = (PM128A)_LocateXStateFeature(Context, XSTATE_AVX, NULL); + XmmRegister_t* Sse = (XmmRegister_t*)_LocateXStateFeature(Context, XSTATE_LEGACY_SSE, &FeatureLength); + XmmRegister_t* Avx = (XmmRegister_t*)_LocateXStateFeature(Context, XSTATE_AVX, NULL); int NumberOfRegisters = FeatureLength / sizeof(Sse[0]); if(Sse != NULL) //If the feature is unsupported by the processor it will return NULL diff --git a/TitanEngine/stdafx.h b/TitanEngine/stdafx.h index 4649439..4b19eca 100644 --- a/TitanEngine/stdafx.h +++ b/TitanEngine/stdafx.h @@ -95,8 +95,14 @@ typedef struct { - M128A Low; //XMM/SSE part - M128A High; //AVX part + ULONGLONG Low; + LONGLONG High; +} XmmRegister_t; + +typedef struct +{ + XmmRegister_t Low; //XMM/SSE part + XmmRegister_t High; //AVX part } YmmRegister_t; typedef struct @@ -156,10 +162,10 @@ typedef struct x87FPU_t x87fpu; DWORD MxCsr; #ifdef _WIN64 - M128A XmmRegisters[16]; + XmmRegister_t XmmRegisters[16]; YmmRegister_t YmmRegisters[16]; #else // x86 - M128A XmmRegisters[8]; + XmmRegister_t XmmRegisters[8]; YmmRegister_t YmmRegisters[8]; #endif } TITAN_ENGINE_CONTEXT_t;