Skip to content

Commit

Permalink
merge 8.7 (windows only: obtain cpuid data with clang/gcc)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebres committed Dec 29, 2024
2 parents 530640f + 6eb30e7 commit 92fd1eb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions win/tclWin32Dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
*/

#include "tclWinInt.h"
#if defined(HAVE_INTRIN_H)
#if defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8))))
# include <cpuid.h>
#elif defined(HAVE_INTRIN_H)
# include <intrin.h>
#endif

Expand Down Expand Up @@ -437,7 +439,13 @@ TclWinCPUID(
{
int status = TCL_ERROR;

#if defined(HAVE_INTRIN_H) && defined(_WIN64) && defined(HAVE_CPUID)
#if defined (__clang__) || ((__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8))))

unsigned int *regs = (unsigned int *)regsPtr;
__get_cpuid(index, &regs[0], &regs[1], &regs[2], &regs[3]);
status = TCL_OK;

#elif defined(HAVE_INTRIN_H) && defined(_WIN64) && defined(HAVE_CPUID)

__cpuid((int *)regsPtr, index);
status = TCL_OK;
Expand Down

0 comments on commit 92fd1eb

Please sign in to comment.