This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, ARM] Implement __ARM_FEATURE_COPROC coprocessor intrinsic feature macro


The ARM ACLE defines the __ARM_FEATURE_COPROC macro which indicates which
coprocessor intrinsics are available for the target. If __ARM_FEATURE_COPROC is
undefined, the target does not support coprocessor intrinsics. The feature
levels are defined as follows:

+---------+-----------+--------------------------------------------------+
| **Bit** | **Value** | **Intrinsics Available**                         |
+---------+-----------+--------------------------------------------------+
| 0       | 0x1       | __arm_cdp __arm_ldc, __arm_ldcl, __arm_stc,      |
|         |           | __arm_stcl, __arm_mcr and __arm_mrc              |
+---------+-----------+--------------------------------------------------+
| 1       | 0x2       | __arm_cdp2, __arm_ldc2, __arm_stc2, __arm_ldc2l, |
|         |           | __arm_stc2l, __arm_mcr2 and __arm_mrc2           |
+---------+-----------+--------------------------------------------------+
| 2       | 0x4       | __arm_mcrr and __arm_mrrc                        |
+---------+-----------+--------------------------------------------------+
| 3       | 0x8       | __arm_mcrr2 and __arm_mrrc2                      |
+---------+-----------+--------------------------------------------------+

This patch implements full support for this feature macro as defined in section
5.9 of the ACLE
(https://developer.arm.com/products/software-development-tools/compilers/arm-compiler-5/docs/101028/latest/5-feature-test-macros).

gcc/ChangeLog:

2017-06-14  Prakhar Bahuguna  <prakhar.bahuguna@arm.com>

	* config/arm/arm-c.c (arm_cpu_builtins): New block to define
	 __ARM_FEATURE_COPROC according to support.

2017-06-14  Prakhar Bahuguna  <prakhar.bahuguna@arm.com>
	* gcc/testsuite/gcc.target/arm/acle/cdp.c: Add feature macro bitmap
	test.
	* gcc/testsuite/gcc.target/arm/acle/cdp2.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/ldc.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/ldc2.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/ldc2l.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/ldcl.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/mcr.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/mcr2.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/mcrr.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/mcrr2.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/mrc.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/mrc2.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/mrrc.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/mrrc2.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/stc.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/stc2.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/stc2l.c: Likewise.
	* gcc/testsuite/gcc.target/arm/acle/stcl.c: Likewise.

Testing done: ACLE regression tests updated with tests for feature macro bits.
All regression tests pass.

Okay for trunk?

-- 

Prakhar Bahuguna

Attachment: 0001-Implement-__ARM_FEATURE_COPROC-coprocessor-intrinsic.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]