Skip to content

Commit

Permalink
gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
w17 committed Aug 30, 2017
1 parent ab8bc52 commit f2d72d4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
4 changes: 4 additions & 0 deletions far/changelog
@@ -1,3 +1,7 @@
w17 30.08.2017 13:53:46 +0300 - build 5017

1. Уточнение+ 5015

w17 30.08.2017 13:19:19 +0300 - build 5016

1. Уточнение 5015
Expand Down
25 changes: 14 additions & 11 deletions far/legacy_cpu_check.cpp
Expand Up @@ -3,22 +3,25 @@

#include "legacy_cpu_check.hpp"

#if defined(_WIN32) && !defined(_WIN64)
# if defined(_MSC_VER)
# include <intrin.h>
# define cpuid(inf, n) __cpuidex(inf, n, 0)
# elif defined(__GNUC__)
# include <cpuid.h>
# define cpuid(inf, n) __cpuid_count(n, 0, inf[0], inf[1], inf[2], inf[3])
# endif
#endif

bool IsLegacyCPU()
{
#if defined(_WIN32) && !defined(_WIN64) && (defined(_MSC_VER) || defined(__GNUC__))
bool have_sse2 = false;
int info[4] = { 0, 0, 0, 0 };
#ifdef _MSC_VER
#include <intrin.h>
__cpuidex(info, 0, 0);
if (info[0] >= 1) {
__cpuidex(info, 1, 0);
#else
#include <cpuid.h>
__cpuid_count(0, 0, info[0], info[1], info[2], info[3]);
if (info[0] >= 1) {
__cpuid_count(1, 0, info[0], info[1], info[2], info[3]);
#endif
cpuid(info, 0);
if (info[0] >= 1)
{
cpuid(info, 1);
have_sse2 = (info[3] & ((int)1 << 26)) != 0;
}
return !have_sse2;
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
@@ -1 +1 @@
m4_define(BUILD,5016)m4_dnl
m4_define(BUILD,5017)m4_dnl

0 comments on commit f2d72d4

Please sign in to comment.