1
0
mirror of https://github.com/google/cpu_features.git synced 2025-06-30 21:02:34 +02:00
Commit Graph

37 Commits

Author SHA1 Message Date
8a494eb1e1 Release v0.7.0 2022-03-08 10:31:24 +00:00
69d39934e8 Fix arm64 detection precedence in CMakeLists.txt (#209)
Fixes #179
2021-11-30 10:45:28 +01:00
deb2a61b80 New code layout - breaking change in cpu_features_macros.h (#194)
This commit helps with platform code separation (fixes #3). It should also help with the build as we can simply include all `impl_*.c` files regardless of OS / arch.

Note: this patch contains breaking changes in `include/cpu_features_macros.h`
 - `CPU_FEATURES_OS_LINUX_OR_ANDROID` does not exist anymore
 - `CPU_FEATURES_OS_FREEBSD`, `CPU_FEATURES_OS_ANDROID` and `CPU_FEATURES_OS_LINUX` are now mutually exclusive (i.e. `CPU_FEATURES_OS_ANDROID` does not imply `CPU_FEATURES_OS_LINUX`)
 - `CPU_FEATURES_OS_DARWIN` has been renamed into `CPU_FEATURES_OS_MACOS` to be able to target non-Mac Apple products (IOS, TV, WATCH). They are now targetable with `CPU_FEATURES_OS_IPHONE`. This matches Apple naming convention described in [this stackoverflow](https://stackoverflow.com/a/49560690).
2021-10-28 13:52:46 +02:00
545b2e84ec cmake: Use of CMAKE_POSITION_INDEPENDENT_CODE instead of BUILD_PIC (Fix #143) 2021-10-25 12:01:38 +00:00
2939ece4d2 add BUNDLE DESTINATION (#177)
required for installation of executable target if cross-build to iOS/tvOS/watchOS
see https://cmake.org/cmake/help/latest/policy/CMP0006.html
2021-10-18 13:29:39 +02:00
06fdc0aa1d cmake: Use CTest default (Fix #169) (#170)
note: this is the default behaviour when using include(CTest)
2021-06-30 15:15:01 +02:00
a8397ba459 Bump version to v0.6.0 2020-10-15 11:09:51 +02:00
9a8f04b24c [NFC] Generate separate tables via macro (#137)
This is a non functional change, it allows:
 - Getting rid of `unix_features_aggregator`
 - Have a single blob describing the features
 - Fix wrong mocking of `hwcaps`

Downside: abuse of macros makes the code slightly magical and harder to understand.
It think it's still an improvement over the current situation as there's less repetition and less chances to get something wrong.
2020-10-12 09:50:35 +00:00
e63405f118 Remove need for utsname (#136) 2020-10-09 20:40:06 +00:00
4795373db2 Fix SSE detection on non-AVX CPUs (#135)
Fixes #4. This is based on #115 with a few modifications:
 - Removed use of __builtin_cpu_supports since it relies on cpuid and doesn't improve on the current situation,
 - Added detection for all of sse, sse2, sse3, ssse3, sse4_1 and sse4_2,
 - Added tests for Atom, Nehalem, and P3 processors,

Thx to @gadoofou87 for providing the original PR.
It also removes the need for #92

* Fix SSE detection on non-AVX CPUs
* Fixes typo
* Mock OSX sysctlbyname in tests
* Also update other tests
* FakeCpu is reset between each tests
* Fix conflicting name on Windows
* Disable pre AVX cpu sse detection tests on Windows
* Guard OS specific code with macros
* Fix missing import for tests
* Fix wrong function prototype
* Fix wrong mocking of P3 on Windows
* Completely guard OS specific parts in x86 tests
* Store DWORD instead unsigned long for x86 tests
2020-10-09 15:20:25 +00:00
a7e0963508 Fix trailing spaces. (#133) 2020-09-23 07:27:23 +00:00
4efc837a92 Bump version 0.1.0 -> 0.5.0 (Fix #118) (#129) 2020-09-21 09:59:55 +00:00
eb168a2da2 Fix shared build (#113)
* Fix PIC property in util library.
* Force PIC when building shared lib on unix.
* Enable CMP0077 for better option handling.
2020-03-11 21:54:42 +01:00
ba81cb3da9 CMake: Enable CXX compiler for tests only (#110)
CMake: Enable CXX compiler for tests only

Co-authored-by: Mizux <mizux.dev@gmail.com>
2020-03-11 14:40:23 +01:00
b5c271c537 CMake: Add missing alias for cpu_feature (#107)
For customers using add_subdirectory() approach

related to #106
2020-02-06 09:42:20 +01:00
bd358abe6a Fix cmake install 2019-07-16 13:45:33 +03:00
f832ad2b12 Fix builds on BSD
Fix the build on BSD by setting PROCESSOR_IS_X86 when CMAKE_SYSTEM_PROCESSOR
matches amd64.

Signed-off-by: Steven Kreuzer <skreuzer@FreeBSD.org>
2019-07-13 22:33:31 -04:00
653d581e03 Add support for leaf2 and leaf4 on Intel's x86 arch (#80)
* Add support for leaf4 on Intel's x86 arch
* Update cpuinfo_x86.h
* Fix typo
* Force compiler to use C99
* Add Intel x86 leaf2 support
* Fixes after review
* Fix review comments
2019-07-02 16:52:25 +02:00
7806502271 Add PIC option (#66) 2019-02-13 11:55:17 +01:00
20fa92a02a Release ndk support (#62)
Fixes #47
2019-01-23 12:59:46 +01:00
dfdac6adfc Add partial implementation of ndk_compat (#54)
* First implementation of ndk_compat
* Restrict building of linux_based_hardware_detection to UNIX
* Fix variable declaration and printf formatting
* Restrict ndk compat to UNIX style systems
* Restrict cpu_mask index to 32
* Fix values display in ndk-compat-test
* Addressing comments
2019-01-17 18:00:21 +01:00
98bd43ffce UNIX works for Unix like OS so no need to add APPLE. 2019-01-15 17:35:04 +01:00
b3bb9048f4 Fix discovery of <sys/auxv.h> 2019-01-15 17:34:52 +01:00
347065af95 Add AMD64 and i386/i686 to x86 detection 2019-01-15 15:30:43 +01:00
122b067087 Use Cmake macros to detect getauxval and dlopen 2019-01-15 15:18:08 +01:00
e8e5610fc4 Per arch build and inlining of cpuid_x86. 2019-01-15 10:52:56 +01:00
ce4637008d without cpu_features_macros.h in the install tree, the library cannot
be used after `make install`
2018-05-22 10:09:00 +02:00
3adafbfe66 powerpc: Added PowerPC implementation
Signed-off-by: Rashmica Gupta <rashmica.gupta@au1.ibm.com>
2018-05-15 14:24:45 +10:00
07fd90d4f5 Add JSON output. Fixes #24 2018-03-27 15:28:40 +02:00
7634420f31 GCC does not discover all cpu features. Fixes #22 2018-02-13 10:12:21 +01:00
9df2d78b8d Update googletest management. 2018-02-13 10:07:02 +01:00
57917d2b12 Fix typo in CMakeLists.txt 2018-02-12 16:48:57 +01:00
1976dcd4d2 Adding CMake install. Fixes #18 2018-02-12 16:17:21 +01:00
6a959dcc1a Use fPIC when building as a shared library
Also include a note stating that the use of shared libraries is
discouraged.
2018-02-09 13:14:49 -08:00
4189efff92 Converts list_cpu_features to C 2018-02-09 10:08:23 +01:00
3a156dada7 Fixes #14 - Defaulting to Release and no unit test 2018-02-08 16:59:18 +01:00
439d371594 Adding code. Closes #0. 2018-02-01 10:03:09 +01:00