HomeFreeBSD

aarch64: Use proper guards for NEON instructions

Description

aarch64: Use proper guards for NEON instructions

The zstd code assumes that if you are on aarch64, you have NEON
instructions. This is not necessarily true. In a boot loader, where
you might not have the VFP properly initialized, these instructions
may not be available. It's also an error to include arm_neon.h when
the NEON insturctions aren't enabled. Change the guards for using the
NEON instructions from aarch64 to __ARM_NEON which is the standard
symbol for knowing if they are available.

ARM_NEON is the proper symbol, defined in ARM C Language Extensions
Release 2.1 (https://developer.arm.com/documentation/ihi0053/d/). Some
sources suggest
ARM_NEON__, but that's the obsolete spelling from
prior versions of the standard.

Updated based on zstd pull request https://github.com/facebook/zstd/pull/2356

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Warner Losh <imp@bsdimp.com>
Closes #11055

Details

Provenance
imp_bsdimp.comAuthored on Oct 14 2020, 4:01 AM
GitHub <noreply@github.com>Committed on Oct 14 2020, 4:01 AM
Parents
rG92286311f824: Add zfs.sh module unload error message
Branches
Unknown
Tags
Unknown