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

420 Commits

Author SHA1 Message Date
Guillaume Chatelet
de700c4a30
Improve the release process (#231) 2022-03-09 11:05:08 +01:00
Guillaume Chatelet
8a494eb1e1 Release v0.7.0 v0.7.0 2022-03-08 10:31:24 +00:00
Guillaume Chatelet
bdb54a2ed4 Fix release script 2022-03-08 10:30:23 +00:00
jmfriedt
40e1c7158d
replace sse3 detection with pni when reading /proc/cpuinfo (#225) 2022-02-22 14:19:17 +01:00
Peter Gavin
5649bdff4e
Fix include paths in BUILD (#226)
Include paths should be specified through includes
rather than copts, so that they are handled correctly when
cpu_features is included in another project as an external repository.
2022-02-22 11:38:11 +01:00
AnvilaWang
1d02169588
Add support for ZHAOXIN CPU (#218) 2022-02-18 16:32:06 +01:00
Mykola Hohsdze
9edae37fc7 Fix windows amd64 ci 2022-02-17 11:19:22 +01:00
Guillaume Chatelet
e38dc6d2a8
[NFC] Add bazel support to cpu_features (#222) 2022-02-03 13:56:31 +01:00
Ryan Prichard
5f5e6d620f
Fix a getauxval comment and expand the Krait idiv workaround (#206)
* Fix getauxval comment (API 18 not 20)

getauxval is available in Android starting with API 18, not 20.

The comment about __ANDROID_API__ appears to have been copied from the
NDK's cpufeatures, which always uses dlopen/dlsym and doesn't assume it
can directly call getauxval, even if __ANDROID_API__ is new enough.
With this project, though, when __ANDROID_API__ is 18 or up, the
CMakeLists.txt file would detect that getauxval is available and define
HAVE_STRONG_GETAUXVAL.

* Broaden Qualcomm Krait idiv workaround

Some Qualcomm Krait CPUs have IDIV support but the kernel doesn't
report it. Previously, this code looked for two CPUs:
 - 0x510006F2 (0x51/'Q', variant 0, part 0x06f, rev 2)
 - 0x510006F3 (0x51/'Q', variant 0, part 0x06f, rev 3)

This check misses my 2013 Nexus 7 device, which has this CPU ID:
 - 0x511006f0 (0x51/'Q', variant 1, part 0x06f, rev 0)

My Nexus 7 device doesn't report idiv through AT_HWCAP or through
/proc/cpuinfo (AT_HWCAP is 0x1b0d7).

Expand the check to anything with:
 - implementer 0x51
 - architecture 7
 - part 0x4d or 0x6f

Part 0x4d appears to be a dual-core Krait (e.g. see
https://crbug.com/341598#c43).

This new matching behavior is a subset of what the upstream kernel
does (patch[1] contributed by CodeAurora), and also closely matches the
behavior of pytorch/cpuinfo.

[1] 120ecfafab
2022-02-01 17:25:05 +01:00
Mykola Hohsadze
f1801f0ca1
Fix list_cpu_features.exe does not detect SSE42 on Xeon X5650 (Windows) (#220) 2022-01-31 10:15:17 +01:00
Guillaume Chatelet
2f5a7bf80a
Rename 'master' branch into 'main' (#219) 2022-01-24 16:01:45 +01: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
5ed8ef4bbe
[NFC][x86] Read all cpuid leaves at once (#213)
This patch reads the most important cpuid leaves and stores the data in
a struct. A followup patch will inline micro architecture detection and
brand string inside X86Info so we don't have to call `ReadLeaves` multiple
times. This wil allow further simplification of `HasSecondFMA` and help
fix https://github.com/google/cpu_features/issues/200.
2022-01-14 14:14:07 +01:00
Guillaume Chatelet
69d39934e8
Fix arm64 detection precedence in CMakeLists.txt (#209)
Fixes #179
2021-11-30 10:45:28 +01:00
Guillaume Chatelet
9d34e6a1c8 Fix #205
Since buffers are a few tens of bytes there is no need for optimized memfunctions. For compile time sizes, the compiler will generate optimal code already.
2021-11-22 16:50:29 +00:00
Mykola Hohsdze
fc52c64ebc fix googletest download 2021-11-16 09:20:01 +01:00
Guillaume Chatelet
ebcdfcaeff Fix missing header 2021-10-29 13:54:41 +00:00
Guillaume Chatelet
f69a25811f make copy and equals inline headers 2021-10-29 12:41:43 +00:00
Guillaume Chatelet
990c55c50f Silence unsused parameters 2021-10-29 10:48:52 +00:00
Guillaume Chatelet
6fd9a8ca58 Make getter/setter static so they don't leak 2021-10-29 10:47:01 +00:00
Guillaume Chatelet
400d4f2836 Fix CpuFeatures_memchr to actually use the provided size argument 2021-10-29 10:10:20 +00:00
Nikolay Hohsadze
5695cc4817
Update uarch detection for Intel processors (#184) 2021-10-29 10:41:50 +02:00
Guillaume Chatelet
5ef0db4bba
Update README.md 2021-10-28 16:36:10 +02:00
Corentin Le Molgat
1601db5335 ci: Update Linux jobs to run inside a docker container. 2021-10-28 16:24:54 +02:00
Corentin Le Molgat
ccc3a51e4c ci: Add docker based test framework
* Add documentation
* Add .dockerignore: minimize docker context size to improve speed
* Add Makefile: to easily run various docker stages
* Add a CMake sample project to check CMake install rules
2021-10-28 16:24:54 +02:00
Corentin Le Molgat
ca84b91d34 scripts: Fixup for run_integration.sh 2021-10-28 16:24:54 +02:00
Guillaume Chatelet
f96d5f74d4 NFC remove reference to libc memory functions 2021-10-28 11:56:57 +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
0dd8b41eca
Update README.md (#193)
Change `Quickstart` section to match new default value for testing.
2021-10-27 14:48:47 +02:00
Corentin Le Molgat
8e5c298d1d Update README.md 2021-10-27 13:24:05 +02:00
Mizux Seiha
06abc90b45 ci: Fix windows workflow filename 2021-10-27 13:24:05 +02:00
Mizux Seiha
9178459627 ci: Drop use of Travis-CI and Appveyor 2021-10-27 13:24:05 +02:00
Corentin Le Molgat
a707bef49d cmake: Fix enabling ndk_compat 2021-10-27 13:22:49 +02:00
Guillaume Chatelet
c5659bf16f Override CacheInfo only if new data is available via Deterministic Cache Parameters Leaf
#190
2021-10-26 15:21:27 +00:00
Mizux
5d871e7569
ci: Migrate FreeBSD to macos-10.15 virtual env (#191)
note: In preparation to https://github.com/actions/virtual-environments/issues/4060
which will drop Vagrant/VirtualBox

ref: https://github.com/actions/virtual-environments/pull/4010
2021-10-26 16:01:14 +02:00
Guillaume Chatelet
7bd206a75f Fix memory overflow
Duplicate of #190
2021-10-26 13:58:42 +00:00
Guillaume Chatelet
55ac9f0556
Set CTest output on failure (#189) 2021-10-26 15:08:38 +02:00
Corentin Le Molgat
d4252660a2 ci(github): Add workflows 2021-10-26 11:42:29 +00:00
Corentin Le Molgat
440452e9a3 ci(travis): adapt it to the new run_integration.sh 2021-10-26 11:42:29 +00:00
Corentin Le Molgat
8971bf0b0e tools: Rework cross compilation scripts
- Use stderr for issues
- Add usage to run_integration.sh (-h or --help)
- deduce toolchain and qemu config from TARGET
- Bump QEMU from 2.11.1 to 5.2.0
  - fix qemu build on Archlinux
- Bump Linaro:
    toolchain 7.2-2017.11 -> 7.5-2019.12
    sysroot 2.25-2017.11 -> 2.25-2019.12
- Bump codescape from 2017.10-08 to 2020.06-01
  - migrate from mips-r2-hard to mips-r6-hard
2021-10-26 11:42:29 +00:00
Corentin Le Molgat
239c2e5660 ci(appveyor): Add VS 2019 job 2021-10-26 11:42:29 +00:00
Corentin Le Molgat
0f07e4b9eb .gitignore: Add build_cross/
note: Used by scripts/*.sh
2021-10-26 11:42:29 +00:00
Corentin Le Molgat
545b2e84ec cmake: Use of CMAKE_POSITION_INDEPENDENT_CODE instead of BUILD_PIC (Fix #143) 2021-10-25 12:01:38 +00:00
Guillaume Chatelet
769287c384
Fixes #185 (#187)
Missing `string_view` header and invalid `_Static_assert` statement
2021-10-25 09:48:46 +02:00
Guillaume Chatelet
cf589a2844
[NFC] Change implementation of FillX86BrandString (#181) 2021-10-21 10:51:00 +02:00
Guillaume Chatelet
32b49eb5e7
Fixes wrong cache detection of old processors (#183) 2021-10-20 17:02:52 +02:00
Guillaume Chatelet
4a81f3756e [NFC] encapsulate fake cpu instance in x86 test 2021-10-20 08:15:44 +00:00
Guillaume Chatelet
b324a7043c
Showcase community bindings (#180) 2021-10-18 15:53:02 +02:00
Nikolay Hohsadze
0925f6953c
Add cache info for new AMD CPUs (0x8000001D) (#171) 2021-10-18 14:14:29 +02:00