[Arm] Implement scalar Custom Datapath Extension intrinsics
authorMatthew Malcomson <matthew.malcomson@arm.com>
Wed, 8 Apr 2020 15:06:45 +0000 (16:06 +0100)
committerMatthew Malcomson <matthew.malcomson@arm.com>
Wed, 8 Apr 2020 15:06:45 +0000 (16:06 +0100)
commita5f3c89e1b78dbb69d3c7a47d2c9fd7ad93fe136
treec8b7f6e518a91b4b7272b1ae7757c0bb1362451c
parent07b9bfd02b88cad2f6b3f50ad610dd75cb989ed3
[Arm] Implement scalar Custom Datapath Extension intrinsics

This patch introduces the scalar CDE (Custom Datapath Extension)
intrinsics for the arm backend.

There is nothing beyond the standard in this patch.  We simply build upon what
has been done by Dennis for the vector intrinsics.

We do add `+cdecp6` to the default arguments for `target-supports.exp`, this
allows for using coprocessor 6 in tests. This patch uses an alternate
coprocessor to ease assembler scanning by looking for a use of coprocessor 6.

We also ensure that any DImode registers are put in an even-odd register pair
when compiling for a target with CDE -- this avoids faulty code generation for
-Os when producing the cx*d instructions.

Testing done:
Bootstrapped and regtested for arm-none-linux-gnueabihf.

gcc/ChangeLog:

2020-03-03  Matthew Malcomson  <matthew.malcomson@arm.com>

* config/arm/arm.c (arm_hard_regno_mode_ok): DImode registers forced
into even-odd register pairs for TARGET_CDE.
* config/arm/arm.h (ARM_CCDE_CONST_1): New.
(ARM_CCDE_CONST_2): New.
(ARM_CCDE_CONST_3): New.
* config/arm/arm.md (arm_cx1si, arm_cx1di arm_cx1asi, arm_cx1adi,
arm_cx2si, arm_cx2di arm_cx2asi, arm_cx2adi arm_cx3si, arm_cx3di,
arm_cx3asi, arm_cx3adi): New patterns.
* config/arm/arm_cde.h (__arm_cx1, __arm_cx1a, __arm_cx2, __arm_cx2a,
__arm_cx3, __arm_cx3a, __arm_cx1d, __arm_cx1da, __arm_cx2d, __arm_cx2da,
__arm_cx3d, __arm_cx3da): New ACLE function macros.
* config/arm/arm_cde_builtins.def (cx1, cx1a, cx2, cx2a, cx3, cx3a):
Define intrinsics.
* config/arm/iterators.md (cde_suffix, cde_dest): New mode attributes.
* config/arm/predicates.md (const_int_ccde1_operand,
const_int_ccde2_operand, const_int_ccde3_operand): New.
* config/arm/unspecs.md (UNSPEC_CDE, UNSPEC_CDEA): New.

gcc/testsuite/ChangeLog:

2020-03-03  Matthew Malcomson  <matthew.malcomson@arm.com>

* gcc.target/arm/acle/cde-errors.c: New test.
* gcc.target/arm/acle/cde.c: New test.
* lib/target-supports.exp: Update CDE flags to enable coprocessor 6.
gcc/config/arm/arm.c
gcc/config/arm/arm.h
gcc/config/arm/arm.md
gcc/config/arm/arm_cde.h
gcc/config/arm/arm_cde_builtins.def
gcc/config/arm/iterators.md
gcc/config/arm/predicates.md
gcc/config/arm/unspecs.md
gcc/testsuite/gcc.target/arm/acle/cde-errors.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/acle/cde.c [new file with mode: 0644]
gcc/testsuite/lib/target-supports.exp