1
0
mirror of https://github.com/google/cpu_features.git synced 2025-04-27 15:12:30 +02:00

25 Commits

Author SHA1 Message Date
Brad Smith
aabbd16864
Add OpenBSD Arm64 support (#367) 2024-11-08 11:14:32 +01:00
Guillaume Chatelet
8e60d3f9be
Forward fix cpu_features_macros.h (#364)
This is a fix for https://github.com/google/cpu_features/pull/363 . The preprocessor check must be done in two steps.
2024-09-10 13:12:11 +02:00
Jamie Vital
6aecde59d3
Fix: Windows does not define __ARM_NEON (#363)
* Windows does not define __ARM_NEON

However, Windows requires NEON to work, so assume it is there if build with MSVC

* Clarify NEON availability in MSVC targeting arm64

* Fix Formatting
2024-09-05 16:23:19 +02:00
Guillaume Chatelet
a4890d1ba1
Revert s/__ARM_NEON/__ARM_NEON__/g (#361) 2024-08-27 14:33:23 +02:00
Wang Xiang
0d5f398c58
Add loongarch64 Support (#314)
* Add macros for LOONGARCH hwcaps

* Update hwcaps.h

* LoongArch Support

* Remove unused definitions.

* Add ignored feature in test.
2023-08-23 20:35:29 +02:00
Mykola Hohsadze
a6bf4f9031
Add Windows Arm64 support (#291)
* Add Windows Arm64 support

To add Windows Arm64 support was added detection of features via Windows API function IsProcessorFeaturePresent. Added _M_ARM64 to detect CPU_FEATURES_AARCH64 macro on Windows. Added initial code for Windows Arm64 testing and provided test for Raspberry PI 4. We can't use "define_introspection_and_hwcaps.inl" as a common file for all operating systems due to msvc compiler error C2099: initializer is not a constant, so as a workaround for Windows I used separate "define_introspection.inl"

See also: #268, #284, #186

* [CMake] Add  windows_utils.h to PROCESSOR_IS_AARCH64

* Add detection of armv8.1 atomic instructions

* Update note on win-arm64 implementation and move to cpuinfo_aarch64.h

* Remove redundant #ifdef CPU_FEATURES_OS_WINDOWS

* Add note on FP/SIMD and Cryptographic Extension for win-arm64

* Add comments to Aarch64Info fields

Added comments to specify that implementer, part and variant we set 0 for Windows, since Win API does not provide a way to get information. For revision added comment that we use GetNativeSystemInfo
2023-02-23 11:41:33 +01:00
marquitos0119
981fbe3914
S390X Support (#274)
* support for s390x

* added z15 T01, T02 model checking

* removed z15 checking

* removed empty strings

* added s390x unit tests

* added reference url for hwcaps

* moved documentation to S390XFeatures struct, updated copyright date, removed unused include statement

* changed num_processors to int

* removed newlines from test inputs

* scripts: Add bootlin s390x support

* cmake(ci): Add s390x support

* ci: Add s390x workflow

Co-authored-by: Marcos <marcos.araque.fiallos@ibm.com>
Co-authored-by: Corentin Le Molgat <corentinl@google.com>
2022-11-02 09:38:13 +01:00
Andrei Kurushin
677d6419b2
remove internal FillX86BrandString usage (#258) 2022-07-25 17:39:50 +02:00
michael-roe
8360923923
Add macros for RISCV features (#244)
Co-authored-by: Michael Roe <michael-roe@users.noreply.github.com>
2022-07-12 11:41:15 +02:00
michael-roe
8b3f891d9b
Added CPU_FEATURES_COMPILED_MIPS_MIPS3D. (#240)
Co-authored-by: Michael Roe <michael-roe@users.noreply.github.com>
2022-05-19 11:57:13 +02:00
Guillaume Chatelet
149916384b
[x86] Embed brand_string and mark FillX86BrandString as deprecated (#214) 2022-01-14 17:20:31 +01:00
Guillaume Chatelet
aa642e573e [NFC] Avoid polluting global scope 2022-01-14 16:06:30 +00:00
Guillaume Chatelet
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
Guillaume Chatelet
119943707c
Add support for FreeBSD on x86 (#163) 2021-07-02 15:37:03 +02:00
Kris Kwiatkowski
001faefdc3
fix: Return default value from ‘GetCacheTypeString’ (#162)
The build fails with following message when -Werror
and -Werror=return-type are enabled.

In function ‘GetCacheTypeString’:
	error: control reaches end of non-void function [-Werror=return-type]

Simple fix is to return explicitly communicate to
the compiler that certain block is not reachable.
2021-06-25 10:28:26 +02:00
Guillaume Chatelet
3cc8f310d9 [NFC] Update copyright from Google Inc. to Google LLC 2020-10-12 08:55:20 +00:00
Guillaume Chatelet
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
Corentin Le Molgat
ec6354f0f4 Fix case in CPU_FEATURES_COMPILED_X86_AVX2 (Fix #102) 2020-01-29 11:00:11 +01:00
Guillaume Chatelet
a6d219bed7 Fixes #102 - wrong macros 2020-01-29 11:00:11 +01:00
Guillaume Chatelet
fc7efb4c14 Fix Mips32 and add an alias for Mips32/64. 2019-01-16 14:26:18 +01:00
Guillaume Chatelet
d864585dc9 Update macros to detect mips64 and differentiate between x86 32/64. 2019-01-16 14:02:24 +01:00
Rashmica Gupta
3adafbfe66
powerpc: Added PowerPC implementation
Signed-off-by: Rashmica Gupta <rashmica.gupta@au1.ibm.com>
2018-05-15 14:24:45 +10:00
Guillaume Chatelet
e419573d10 Use CPU_FEATURES_ prefix for namespace macros. 2018-02-12 16:15:15 +01:00
Guillaume Chatelet
8e58ef0d2b Removing THIRD_PARTY_ from C headers. 2018-02-01 10:38:48 +01:00
Guillaume Chatelet
439d371594 Adding code. Closes #0. 2018-02-01 10:03:09 +01:00