libyuv/unit_test
George Steed f5882ed1c5 [AArch64] getauxval(AT_HWCAP{,2}) feature detection, attempt #2
This re-lands commit ba0bba5b2b7e38c9365a5d152b4efa0458863213.

Now with additional #ifdef __linux__ guards to avoid compiling
Linux-specific code on non-Linux platforms. Non-linux feature detection
will be added in a separate patch.

Using getauxval(AT_HWCAP{,2}) has the advantage of also working under
emulation where faking /proc/cpuinfo is not supported.

For the Chromium sandbox, getauxval is supported since API version 18.
The minimum supported API version at time of writing is 21 so we should
be able to use getauxval unconditionally. On the off-chance the call
fails it will return 0 and we will correctly fall-back to using only
Neon.

If we want to read the current CPU implementer or part number we could
do this by checking HWCAP_CPUID and then reading MIDR_EL1. This will
cause a kernel trap to emulate the EL1 read but should still be a lot
faster than reading the whole of /proc/cpuinfo.

Bug: libyuv:980
Change-Id: I8ae103ea7e32ef44db72f3c9896417bfe97ff5c5
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5465590
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
2024-04-25 21:26:31 +00:00
..
testdata [AArch64] getauxval(AT_HWCAP{,2}) feature detection, attempt #2 2024-04-25 21:26:31 +00:00
basictypes_test.cc Switch to C99 types 2018-01-23 19:16:05 +00:00
color_test.cc YUY2ToNV12 using YUY2ToY and YUY2ToNVUV 2022-09-30 22:41:21 +00:00
compare_test.cc fix compare row test for avx2 which does 64 bytes per loop 2021-04-06 22:37:25 +00:00
convert_argb_test.cc YUY2ToARGBMatrix and UYVYToARGBMatrix added to allow any color matrix 2024-01-19 21:21:37 +00:00
convert_test.cc AVX10 cpuid detect added 2024-01-10 00:08:22 +00:00
cpu_test.cc [AArch64] getauxval(AT_HWCAP{,2}) feature detection, attempt #2 2024-04-25 21:26:31 +00:00
cpu_thread_test.cc clamp C functions use compare 2020-07-16 22:03:34 +00:00
math_test.cc Disable tests via macro that refer to row.h 2019-08-20 18:44:36 +00:00
planar_test.cc ARGBAttenuate use (a + b + 255) >> 8 2023-06-16 21:37:53 +00:00
rotate_argb_test.cc Add 10 bit rotate methods. 2023-01-04 21:10:01 +00:00
rotate_test.cc Transpose 4x4 for SSE2 and AVX2 2023-03-03 17:46:23 +00:00
scale_argb_test.cc Enable 256x144 scale tests for libyuv 2022-07-13 11:08:29 +00:00
scale_plane_test.cc Split scale_test and scale_plane_test to allow building on small devices 2023-12-09 18:39:41 +00:00
scale_rgb_test.cc Enable 256x144 scale tests for libyuv 2022-07-13 11:08:29 +00:00
scale_test.cc Split scale_test and scale_plane_test to allow building on small devices 2023-12-09 18:39:41 +00:00
scale_uv_test.cc cpuid for arm/mips/riscv initialize buffer 2023-04-27 22:46:27 +00:00
unit_test.cc Fix environment variable LIBYUV_CPU_INFO for unittests 2024-04-20 17:41:56 +00:00
unit_test.h I422Rotate take stride for temporary buffers 2023-01-04 23:11:52 +00:00
video_common_test.cc Add support for AR64 format 2021-03-13 20:55:21 +00:00