isa-l/mem
Jerry Yu 183385f02f multibinary: Add run-time cpu feature detect for aarch64
Some CPUs  report "illegal instruction" error for the crc test because
they do not support the relevant optional feature . This can be fixed by
introducing CPU feature detection for AArch64 .

The difference with the x86 implementation is the dispatcher . It is based
on the glibc function `getauxval(AT_HWCAP)` and `getauxval(AT_HWCAP2)` , not
registers or instructions .

On a  heterogeneous system (big.LITTLE) , it is dangerous to detect CPU
features using identification registers . And while it is possible to use
architectural feature registers from userspace on recent kernels, this
won't necessarily work with older platforms . Thus we use the HW_CAPs
exported from the kernel (and visible in getauxval) as the solution.

- According to kernel suggestion , getauxval should be used for this purpose .
  - [CPU Feature detection](https://github.com/torvalds/linux/blob/master/Documentation/arm64/cpu-feature-registers.rst)
- According to  AAPCS result/paramter registers should be saved/restore for function call
  - [AAPCS](http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055b/IHI0055B_aapcs64.pdf)
  - [GLibc](https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=blob;f=sysdeps/aarch64/dl-trampoline.S)

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
Change-Id: Ic9abe0d2268ac95537e1abf10acc642fc58a5054
2019-08-26 17:58:42 +08:00
..
aarch64 multibinary: Add run-time cpu feature detect for aarch64 2019-08-26 17:58:42 +08:00
Makefile.am mem: mem-zero-detect optimization on Arm64 2019-02-22 08:15:22 +00:00
mem_multibinary.asm mem: Add zero detect memory functions 2018-09-25 14:33:31 -07:00
mem_zero_detect_avx.asm build: Fix for mac nasm lack of symbol types 2018-11-29 13:54:36 -07:00
mem_zero_detect_base_aliases.c mem: Add zero detect memory functions 2018-09-25 14:33:31 -07:00
mem_zero_detect_base.c mem: Remove unaligned loads in base function 2019-03-07 09:27:50 -07:00
mem_zero_detect_perf.c all: Revamp performance testing to be time based 2019-03-07 09:28:04 -07:00
mem_zero_detect_sse.asm build: Fix for mac nasm lack of symbol types 2018-11-29 13:54:36 -07:00
mem_zero_detect_test.c mem: Change test r and l data type to avoid unsigned add overflow 2019-03-07 09:27:50 -07:00