Skip to content

Move helper functions out of sse4.2 object #5

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

Merged
merged 3 commits into from
Jul 21, 2017
Merged
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions port/port_posix_sse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ static inline uint64_t LE_LOAD64(const uint8_t *p) {

static inline bool HaveSSE42() {
#if defined(_MSC_VER)
int cpu_info[4];
int cpu_info[4] = {};
__cpuid(cpu_info, 1);
return (cpu_info[2] & (1 << 20)) != 0;
#elif defined(__GNUC__)
unsigned int eax, ebx, ecx, edx;
unsigned int eax, ebx, ecx=0, edx;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this isn't the best way to silence this warning. :P The warning was because the compiler is smart enough to see that __cpuid can fail. it'll still work but it's ugly, better to handle the failure like Bitcoin core does?

__get_cpuid(1, &eax, &ebx, &ecx, &edx);
return (ecx & (1 << 20)) != 0;
#else
Expand Down