aboutsummaryrefslogtreecommitdiff
path: root/src/hwcaps.c
AgeCommit message (Collapse)Author
2023-09-19Add FreeBSD Arm64 support (#295)Mykola Hohsadze
* Add FreeBSD Arm64 detection Getting all the features is handled by reading /var/run/dmesg.boot. Feature detections were taken from the freebsd kernel code sys/arm64/arm64/identcpu.c * Add FreeBSD Arm64 tests * Add flagm, flagm2 and rng detection * Add HWCAP FreeBSD AArch64 * Update include to use linux hwcaps for powerpc * Add FreeBSD aarch64 impl * Separate Hwacps to freebsd and linux implementation * Add aarch64 midr_el1 implementation * Add detection hwcap cpuid to hwcaps.h * Add MIDR_EL1 tests
2022-02-01Fix a getauxval comment and expand the Krait idiv workaround (#206)Ryan Prichard
* 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] https://github.com/torvalds/linux/commit/120ecfafabec382c4feb79ff159ef42a39b6d33b
2021-06-30Avoid leaking internal headers for ppc (#164)Guillaume Chatelet
2020-10-12[NFC] Generate separate tables via macro (#137)Guillaume Chatelet
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[NFC] Update copyright from Google Inc. to Google LLCGuillaume Chatelet
2020-09-23[NFC] clang-format codebase (#134)Guillaume Chatelet
* [NFC] clang-format codebase * revert to 80 char columns at the price of uglier table init * Specifically disabling clang-format for table initialization
2019-01-15Use Cmake macros to detect getauxval and dlopenGuillaume Chatelet
2019-01-15Per arch build and inlining of cpuid_x86.Guillaume Chatelet
2018-05-15powerpc: Add AT_PLATFORM and AT_BASE_PLATFORMRashmica Gupta
Some PowerPC machines can operate in a mode that appears different to a process than the actual hardware. AT_PLATFORM indicates the supported instruction set and AT_BASE_PLATFORM indicates the actual microarchitecture of the hardware. Signed-off-by: Rashmica Gupta <rashmica.gupta@au1.ibm.com>
2018-05-15hwcaps: Change uint32_t to unsigned longRashmica Gupta
getauxval() returns an unsigned long which can be defined to be more than 32 bits so don't force the result into a uint32_t. Signed-off-by: Rashmica Gupta <rashmica.gupta@au1.ibm.com>
2018-05-04Fix failing tests on Linux & AndroidArvid Gerstmann
2018-05-03Fix tests & fix missing GetHardwareCapabilities() changeArvid Gerstmann
2018-04-26Explicitly namespace every extern identifierArvid Gerstmann
2018-02-01Adding code. Closes #0.Guillaume Chatelet