-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move x86 cpuid code from cpuid.hpp to src/arch/x86/cpuid.cpp
- Loading branch information
1 parent
f4f3c91
commit a1f8ea1
Showing
8 changed files
with
181 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# On x86 CPUs we need to enable the use of cpuid.cpp. | ||
# If cpuid.cpp compiles we assume it is a x86 CPU. | ||
|
||
include(CheckCXXSourceCompiles) | ||
include(CMakePushCheckState) | ||
|
||
cmake_push_check_state() | ||
set(CMAKE_REQUIRED_INCLUDES "${PROJECT_SOURCE_DIR}") | ||
|
||
check_cxx_source_compiles(" | ||
#include <src/arch/x86/cpuid.cpp> | ||
#include <iostream> | ||
int main() | ||
{ | ||
int abcd[4]; | ||
primecount::run_cpuid(1, 0, abcd); | ||
int ecx = abcd[2]; | ||
if (ecx & (1 << 23)) == (1 << 23)) | ||
std::cout << \"CPU supports POPCNT!\" << std::endl; | ||
else | ||
std::cout << \"CPU does not support POPCNT!\" << std::endl; | ||
return 0; | ||
} | ||
" x86_cpuid) | ||
|
||
cmake_pop_check_state() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.