arm-trusted-firmware/include/lib/libc/arm_acle.h
Manish V Badarkhe a1cedadf73 feat(hw_crc): add support for HW computed CRC
Added support for HW computed CRC using Arm ACLE intrinsics.
These are built-in intrinsics available for ARMv8.1-A, and
onwards.
These intrinsics are enabled via '-march=armv8-a+crc' compile
switch for ARMv8-A (supports CRC instructions optionally).

HW CRC support is enabled unconditionally in BL2 for all Arm
platforms.

HW CRC calculation is verified offline to ensure a similar
result as its respective ZLib utility function.

HW CRC calculation support will be used in the upcoming
firmware update patches.

Change-Id: Ia2ae801f62d2003e89a9c3e6d77469b5312614b3
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
2021-05-19 19:34:34 +01:00

24 lines
624 B
C

/*
* Copyright (c) 2021 ARM Limited
*
* SPDX-License-Identifier: BSD-3-Clause
*
* The definitions below are a subset of what we would normally get by using
* the compiler's version of arm_acle.h. We can't use that directly because
* we specify -nostdinc in the Makefiles.
*
* We just define the functions we need so far.
*/
#ifndef ARM_ACLE_H
#define ARM_ACLE_H
#if !defined(__aarch64__) || defined(__clang__)
# define __crc32b __builtin_arm_crc32b
# define __crc32w __builtin_arm_crc32w
#else
# define __crc32b __builtin_aarch64_crc32b
# define __crc32w __builtin_aarch64_crc32w
#endif
#endif /* ARM_ACLE_H */