Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Hygon Dhyana SoC support #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src-cryptopp/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,14 @@ static inline bool IsAMD(const word32 output[4])
(output[3] /*EDX*/ == 0x69746E65);
}

static inline bool IsHygon(const word32 output[4])
{
// This is the "HygonGenuine" string.
return (output[1] /*EBX*/ == 0x6f677948) &&
(output[2] /*ECX*/ == 0x656e6975) &&
(output[3] /*EDX*/ == 0x6e65476e);
}

static inline bool IsVIA(const word32 output[4])
{
// This is the "CentaurHauls" string. Some non-PadLock's can return "VIA VIA VIA "
Expand Down Expand Up @@ -270,7 +278,7 @@ void DetectX86Features()
g_hasRDSEED = !!(cpuid3[1] /*EBX*/ & RDSEED_FLAG);
}
}
else if (IsAMD(cpuid))
else if (IsAMD(cpuid) || IsHygon(cpuid))
{
static const unsigned int RDRAND_FLAG = (1 << 30);

Expand Down