Skip to content

Commit 736dd31

Browse files
committed
allow using k0 register
1 parent c37f997 commit 736dd31

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

SDK/C/TitanEngine.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ typedef struct
681681
#else // x86
682682
ZmmRegister_t ZmmRegisters[8];
683683
#endif
684-
ULONGLONG Opmask[7]; // k0 is omitted; AVX-512BW extends these registers from 16 bits to 64 bits
684+
ULONGLONG Opmask[8];
685685
} TITAN_ENGINE_CONTEXT_AVX512_t;
686686

687687
#ifdef __cplusplus

TitanEngine/TitanEngine.Debugger.Context.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -1141,9 +1141,8 @@ __declspec(dllexport) bool TITCALL SetAVX512Context(HANDLE hActiveThread, TITAN_
11411141

11421142
if (Avx512_KMASK != NULL) //If the feature is unsupported by the processor it will return NULL
11431143
{
1144-
// k0 is always 0, don't store it.
1145-
for (int i = 1; i < MIN(FeatureLengthAvx512_KMASK / sizeof(ULONGLONG) - 1, _countof(titcontext->Opmask)); i++)
1146-
Avx512_KMASK[i] = titcontext->Opmask[i - 1];
1144+
for (int i = 0; i < MIN(FeatureLengthAvx512_KMASK / sizeof(ULONGLONG), _countof(titcontext->Opmask)); i++)
1145+
Avx512_KMASK[i] = titcontext->Opmask[i];
11471146
}
11481147

11491148
return (SetThreadContext(hActiveThread, Context) == TRUE);
@@ -1241,9 +1240,8 @@ __declspec(dllexport) bool TITCALL GetAVX512Context(HANDLE hActiveThread, TITAN_
12411240

12421241
if (Avx512_KMASK != NULL) //If the feature is unsupported by the processor it will return NULL
12431242
{
1244-
// k0 is always 0, don't store it.
1245-
for (int i = 1; i < MIN(FeatureLengthAvx512_KMASK / sizeof(ULONGLONG) - 1, _countof(titcontext->Opmask)); i++)
1246-
titcontext->Opmask[i - 1] = Avx512_KMASK[i];
1243+
for (int i = 0; i < MIN(FeatureLengthAvx512_KMASK / sizeof(ULONGLONG), _countof(titcontext->Opmask)); i++)
1244+
titcontext->Opmask[i] = Avx512_KMASK[i];
12471245
}
12481246

12491247
return true;

TitanEngine/stdafx.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ typedef struct
203203
#else // x86
204204
ZmmRegister_t ZmmRegisters[8];
205205
#endif
206-
ULONGLONG Opmask[7]; // k0 is omitted; AVX-512BW extends these registers from 16 bits to 64 bits
206+
ULONGLONG Opmask[8]; // k0 is omitted; AVX-512BW extends these registers from 16 bits to 64 bits
207207
} TITAN_ENGINE_CONTEXT_AVX512_t;
208208

209209
typedef struct

0 commit comments

Comments
 (0)