[arm] Fix use of CRC32 intrinsics with Armv8-a and hard-float
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Thu, 22 Aug 2019 15:55:39 +0000 (15:55 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Thu, 22 Aug 2019 15:55:39 +0000 (15:55 +0000)
commit943766d37ae4131aa6cbf9e0b2a660ffea3482a8
tree5854dbaa393d0f29f0c8d33300599446348aa2d3
parentef27f40f488c590d796036ff9ad0ee572d8d8bfe
[arm] Fix use of CRC32 intrinsics with Armv8-a and hard-float

We currently have a nasty error when trying to use the __crc* intrinsics
with an -mfloat-abi=hard.
That is because the target pragma guarding them uses armv8-a+crc that
does not include fp by default.
So we get errors like:
error: '-mfloat-abi=hard': selected processor lacks an FPU

This patch fixes that by using an FP-enabled arch target pragma to guard
these intrinsics when floating-point is available.
That way both the softfloat and hardfloat variants work.

     * config/arm/arm_acle.h: Use arch=armv8-a+crc+simd pragma for CRC32
     intrinsics if __ARM_FP.
     Use __ARM_FEATURE_CRC32 ifdef guard.

     * gcc.target/arm/acle/crc_hf_1.c: New test.

From-SVN: r274827
gcc/ChangeLog
gcc/config/arm/arm_acle.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/acle/crc_hf_1.c [new file with mode: 0644]